Skip to content

Implement multi-file doc highlights#3334

Open
jakebailey wants to merge 2 commits intomainfrom
jabaile/multi-file-doc-highlight
Open

Implement multi-file doc highlights#3334
jakebailey wants to merge 2 commits intomainfrom
jabaile/multi-file-doc-highlight

Conversation

@jakebailey
Copy link
Copy Markdown
Member

Uses the same kind of idea as #3311, except that this is a separate method in VS Code, so it is in our LSP extension.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a custom LSP request + VS Code proposed API integration to support document highlights across multiple files (multi-document highlights), along with updated/added fourslash tests and baselines to validate the new behavior.

Changes:

  • Introduces custom/textDocument/multiDocumentHighlight in lsproto + internal/lsp/server.go and wires it to a new LanguageService.ProvideMultiDocumentHighlights implementation.
  • Updates fourslash infrastructure to request multi-document highlights with filesToSearch, and adds/updates generated tests + baselines.
  • Implements a VS Code extension feature using the proposed MultiDocumentHighlightProvider API and bumps VS Code/@types versions to a proposal-supporting engine level.

Reviewed changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/ls/documenthighlights.go Implements multi-file highlight computation and response shaping.
internal/lsp/server.go Registers the custom LSP method handler and advertises capability.
internal/lsp/lsproto/_generate/generate.mts Extends protocol model with request/structures + capability flag.
internal/lsp/lsproto/lsp_generated.go Generated protocol types for the new request/response.
_extension/src/vscode.proposed.multiDocumentHighlightProvider.d.ts Adds proposed VS Code API typings used by the extension.
_extension/src/languageFeatures/documentHighlight.ts Client-side provider that calls the custom LSP method and converts results.
_extension/src/client.ts Registers the new feature with the language client.
_extension/package.json Enables the proposal + updates VS Code engine requirement.
internal/fourslash/fourslash.go Adds VerifyBaselineDocumentHighlightsWithOptions (filesToSearch) and custom request path.
internal/fourslash/_scripts/convertFourslash.mts Updates conversion to support multi-file document highlight baselines/options.
internal/fourslash/tests/gen/*.go Updates existing tests and adds new generated tests covering multi-file behavior.
testdata/baselines/reference/fourslash/documentHighlights/*.jsonc Baseline updates/new baselines including the filesToSearch header.
package-lock.json Updates @types/vscode and engine metadata.

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