Skip to content

feat(lsp): clearer completion list — source tags, import clubbing, signature docs#2991

Merged
abose merged 5 commits into
mainfrom
ai
Jun 26, 2026
Merged

feat(lsp): clearer completion list — source tags, import clubbing, signature docs#2991
abose merged 5 commits into
mainfrom
ai

Conversation

@abose

@abose abose commented Jun 26, 2026

Copy link
Copy Markdown
Member

Several related improvements to the LSP code-hint UI, matching VS Code/WebStorm:

  • Annotate auto-import completions with their source module (labelDetails. description), dimmed and right-aligned, so same-named items from different modules read as distinct rows instead of confusing duplicates. Advertise completionItem.labelDetailsSupport.

  • When several modules export the same name, collapse the auto-imports into a single "N imports…" row. Accepting it re-opens the list filtered to just that name's sources (reusing the existing list's positioning, keyboard nav, doc popups and import insertion); picking one inserts the symbol and its import.

  • Lead the side doc popup with the item's signature (token.detail) as a highlighted code block, and show the popup whenever there's a signature OR documentation — so a doc-less item still shows its signature instead of nothing.

abose added 5 commits June 26, 2026 12:00
…gnature docs

Several related improvements to the LSP code-hint UI, matching VS Code/WebStorm:

- Annotate auto-import completions with their source module (labelDetails.
  description), dimmed and right-aligned, so same-named items from different
  modules read as distinct rows instead of confusing duplicates. Advertise
  completionItem.labelDetailsSupport.

- When several modules export the same name, collapse the auto-imports into a
  single "N imports…" row. Accepting it re-opens the list filtered to just that
  name's sources (reusing the existing list's positioning, keyboard nav, doc
  popups and import insertion); picking one inserts the symbol and its import.

- Lead the side doc popup with the item's signature (token.detail) as a
  highlighted code block, and show the popup whenever there's a signature OR
  documentation — so a doc-less item still shows its signature instead of nothing.
…uage

The signature block in the completion doc popup was hard-wired to ```typescript.
The LSP `detail` string carries no language tag, so derive the highlight language
from the active editor instead. The JS family maps to ts/tsx because vtsls emits
TypeScript-syntax signatures even in .js/.jsx (TS is a superset); every other
language uses its own id, and _highlightCode no-ops gracefully for ids hljs
doesn't know.
The popup defined its own ::-webkit-scrollbar (9px wide, 5px-radius block thumb
with no padding), which read chunkier than the rest of the app. Drop it so the
popup inherits the app-wide scrollbar (brackets_scrollbars.less) - the same 12px
slim, rounded pill thumb the editor uses.
The LSP parameter-hint popup rendered "((tableName: any)" - a doubled, unbalanced
paren and no function name. requestParameterHints dropped the signature label and
activeSignature, so the provider couldn't supply the function name; the manager
then fell back to editor.getToken() at the caret, which is the just-typed "(".

- LSPClient: pass the full signature label and activeSignature through.
- DefaultProviders: use the active signature (not all overloads merged into one
  param list) and derive the function name from its label.
- ParameterHintsManager: use the provider-supplied functionName when present,
  falling back to the editor token only when absent (preserves Tern behavior).

Now renders e.g. "getTableIndexes(tableName: any)" - named and balanced.
Clicking an empty part of the editor's scrollbar track now jumps straight to that
proportional position, instead of the browser default of paging one viewport at a
time - which is painfully slow to reach a far-off spot in a large file. A click on
the thumb is left to the native drag.

Logic lives in a new EditorHelper/ScrollbarHelper.js (installClickToJump), wired
from the Editor constructor so it applies to every editor, including inline ones.
Works on both the vertical and horizontal scrollbars.
@abose abose merged commit b8dbbcd into main Jun 26, 2026
8 of 21 checks passed
@abose abose deleted the ai branch June 26, 2026 14:27
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant