Skip to content

Hook up Typescript Lang Features to new multi-doc highlight api #198469

Closed

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.

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);
}
}

Activity

  1. added
    editor-highlight
    on Nov 16, 2023
  2. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Nov 22, 2023
  3. locked and limited conversation to collaborators on Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-highlightinsiders-releasedon-testplan

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions