Skip to content

Add parameter name inlay hints#1703

Draft
chrisdp wants to merge 1 commit into
masterfrom
feature/inlay-hints-parameter-names
Draft

Add parameter name inlay hints#1703
chrisdp wants to merge 1 commit into
masterfrom
feature/inlay-hints-parameter-names

Conversation

@chrisdp
Copy link
Copy Markdown
Contributor

@chrisdp chrisdp commented May 8, 2026

Summary

  • Adds parameter-name inlay hints at call sites: foo(name: "bar", count: 5) style ghost annotations next to each argument.
  • New provideInlayHints plugin event mirrors the existing provideHover / provideSelectionRanges shape, with before / after variants for plugins that want to filter or augment results.
  • LSP server advertises inlayHintProvider and registers textDocument/inlayHint via connection.languages.inlayHint.on(...).
  • Resolves call targets across plain calls, namespace calls (ns.foo), m.method() inside a class, new ClassName(...) constructors, and callfunc dispatches. Suppresses hints when the argument is a bare identifier already matching the parameter name.

Out of scope (future PRs)

  • Variable / inferred-type hints next to declarations.
  • Function return-type hints.
  • Per-category opt-in settings (brighterscript.inlayHints.parameterNames, etc.).

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.
@chrisdp
Copy link
Copy Markdown
Contributor Author

chrisdp commented May 8, 2026

@copilot link this PR to the following issue. rokucommunity/vscode-brightscript-language#745

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

@copilot link this PR to the following issue. rokucommunity/vscode-brightscript-language#745

Added a reference to rokucommunity/vscode-brightscript-language#745 in the PR description.

Copilot finished work on behalf of chrisdp May 8, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants