Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions - Language Features: Implement semantic highlighting #3370

Open
bryphe opened this issue Apr 5, 2021 · 1 comment
Open

Extensions - Language Features: Implement semantic highlighting #3370

bryphe opened this issue Apr 5, 2021 · 1 comment
Labels
A-extension Area: Extension/plugin integration, vscode or VimL A-language-support Area: Language support, syntax highlighting, language server etc. A-syntax-highlighting Area: Syntax Highlighting enhancement New feature or request

Comments

@bryphe
Copy link
Member

bryphe commented Apr 5, 2021

The extension host provides some APIs for semantic highlighting:

	$registerDocumentSemanticTokensProvider(handle: number, selector: IDocumentFilterDto[], legend: modes.SemanticTokensLegend, eventHandle: number | undefined): void;
	$emitDocumentSemanticTokensEvent(eventHandle: number): void;
	$registerDocumentRangeSemanticTokensProvider(handle: number, selector: IDocumentFilterDto[], legend: modes.SemanticTokensLegend): void;

https://github.com/onivim/vscode-exthost/blob/0d6b39803352369daaa97a444ff76352d8452be2/src/vs/workbench/api/common/extHost.protocol.ts#L400

and

	$provideDocumentSemanticTokens(handle: number, resource: UriComponents, previousResultId: number, token: CancellationToken): Promise<VSBuffer | null>;
	$releaseDocumentSemanticTokens(handle: number, semanticColoringResultId: number): void;
	$provideDocumentRangeSemanticTokens(handle: number, resource: UriComponents, range: IRange, token: CancellationToken): Promise<VSBuffer | null>;

https://github.com/onivim/vscode-exthost/blob/0d6b39803352369daaa97a444ff76352d8452be2/src/vs/workbench/api/common/extHost.protocol.ts#L1508

We need to wire these APIs up, and integrate them into our language feature / syntax highlighting pipeline, to support languages that use these rich semantic highlights.

Some extensions to test with semantic token support:

@bryphe bryphe added A-extension Area: Extension/plugin integration, vscode or VimL A-language-support Area: Language support, syntax highlighting, language server etc. A-syntax-highlighting Area: Syntax Highlighting enhancement New feature or request labels Apr 5, 2021
@lougreenwood
Copy link

lougreenwood commented Apr 30, 2021

I was just about to post an issue about this in relation to differences between the same theme in VSCode & Oni2.

But I noticed that switching off semantic highlighting in VSCode will render things (virtually?) identically to Oni2, so I guess the discrepancies are semantic highlighting... 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-extension Area: Extension/plugin integration, vscode or VimL A-language-support Area: Language support, syntax highlighting, language server etc. A-syntax-highlighting Area: Syntax Highlighting enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants