Add parameter name inlay hints#1703
Draft
chrisdp wants to merge 1 commit into
Draft
Conversation
Surface the parameter names of called functions as inlay hints next to each argument at the call site. Adds a new `provideInlayHints` plugin event, `Program.getInlayHints`, plumbing through `Project` / `ProjectManager` / `WorkerThreadProject`, and an LSP `onInlayHint` handler advertised via `inlayHintProvider`. The `InlayHintProcessor` walks each `CallExpression` / `CallfuncExpression` in the requested range and resolves the target across plain calls, namespace calls, `m.method()` inside classes, constructors via `new`, and callfunc dispatches. Hints are suppressed when an argument is a bare identifier that already matches the parameter name.
Contributor
Author
|
@copilot link this PR to the following issue. rokucommunity/vscode-brightscript-language#745 |
Contributor
Added a reference to rokucommunity/vscode-brightscript-language#745 in the PR description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
foo(name: "bar", count: 5)style ghost annotations next to each argument.provideInlayHintsplugin event mirrors the existingprovideHover/provideSelectionRangesshape, withbefore/aftervariants for plugins that want to filter or augment results.inlayHintProviderand registerstextDocument/inlayHintviaconnection.languages.inlayHint.on(...).ns.foo),m.method()inside a class,new ClassName(...)constructors, andcallfuncdispatches. Suppresses hints when the argument is a bare identifier already matching the parameter name.Out of scope (future PRs)
brighterscript.inlayHints.parameterNames, etc.).