Repository navigation
Closed
Labels
editor-highlightEditor selection/word highlight issuesinsiders-releasedPatch has been released in VS Code Insiderson-testplan
Milestone
Description
Looking at the Typescript word highlighter, it looks like typescript already supports multi-document semantic highlighting. Using the parameter on L29 in the below snippet, more files can likely be passed in via the extHost and semantic highlight should work for multiple files out of the box.
vscode/extensions/typescript-language-features/src/languageFeatures/documentHighlight.ts
Lines 17 to 38 in 0acd272
| public async provideDocumentHighlights( | |
| document: vscode.TextDocument, | |
| position: vscode.Position, | |
| token: vscode.CancellationToken | |
| ): Promise<vscode.DocumentHighlight[]> { | |
| const file = this.client.toOpenTsFilePath(document); | |
| if (!file) { | |
| return []; | |
| } | |
| const args = { | |
| ...typeConverters.Position.toFileLocationRequestArgs(file, position), | |
| filesToSearch: [file] | |
| }; | |
| const response = await this.client.execute('documentHighlights', args, token); | |
| if (response.type !== 'response' || !response.body) { | |
| return []; | |
| } | |
| return response.body.flatMap(convertDocumentHighlight); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
editor-highlightEditor selection/word highlight issuesinsiders-releasedPatch has been released in VS Code Insiderson-testplan
Activity