Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight related keywords under cursor #5058

Open
2 tasks done
MartinGC94 opened this issue Oct 6, 2024 · 1 comment
Open
2 tasks done

Highlight related keywords under cursor #5058

MartinGC94 opened this issue Oct 6, 2024 · 1 comment
Labels
Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed!

Comments

@MartinGC94
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

Some keywords relate to each other, like "break" or "continue" inside a loop statement. It would be nice if these keywords got highlighted when placing the cursor on them just like it happens in VS and VScode when writing C# code. Here's an example:
image

This makes it easier to tell at a glance which loop I'm breaking out of in a nested loop scenario.

The scenarios that C# covers from my memory are:
1: Obvious pairs (if/else, try/catch/finally)
2: Return statements inside methods
3: Loops and flow control statements

All 3 seem like they would be pretty simple to handle with some AST analysis, however because PowerShell has loop labels extra care should be taken when determining what loop the flow control statements relate to.

Proposed Design

No response

@MartinGC94 MartinGC94 added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! labels Oct 6, 2024
@JustinGrote
Copy link
Collaborator

I believe this is the LSP for that:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentHighlight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed!
Projects
None yet
Development

No branches or pull requests

2 participants