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

Semantic highlighting protocol extension #513

Open
kittaakos opened this Issue Jul 4, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@kittaakos

kittaakos commented Jul 4, 2018

Note: The description was copied as is from Microsoft/vscode-languageserver-node#368 (comment)


I have started to work on a semantic highlighting extension of the LSP.

The semantic highlighting information is pushed from the server to the client as a notification. This notification contains the lines and the ranges where the coloring has the be applied and the desired coloring details are given as TextMate scopes.

In the reference implementation of the client, I was trying to map the TextMate scopes into the appropriate theme I can use as a decoration in the TextEditor decoration. How can one map the TextMate scopes into themes (and eventually TextEditorDecorationType) with the current VS Code API?

Any suggestions and feedback are welcome. Thanks!

Related issues:


The corresponding PR with the proposed changes is here: Microsoft/vscode-languageserver-node#367

@rcjsuen

This comment has been minimized.

Show comment
Hide comment
@rcjsuen

rcjsuen Jul 4, 2018

Contributor

@kittaakos Just to make sure I understand what's going on, would you mind showing the JSON notification of a) opening a new file and b) making a change to one line? Let's just say the URI of the file is lsp:/folder/file.ts.

A: User opens the following TypeScript file in a LSP client.

export class Sample {
    protected test = 0;
}

B: User changes 0 to "value" on the second line.

export class Sample {
    protected test = "value";
}
Contributor

rcjsuen commented Jul 4, 2018

@kittaakos Just to make sure I understand what's going on, would you mind showing the JSON notification of a) opening a new file and b) making a change to one line? Let's just say the URI of the file is lsp:/folder/file.ts.

A: User opens the following TypeScript file in a LSP client.

export class Sample {
    protected test = 0;
}

B: User changes 0 to "value" on the second line.

export class Sample {
    protected test = "value";
}
@nickmccurdy

This comment has been minimized.

Show comment
Hide comment
@nickmccurdy

nickmccurdy Aug 30, 2018

Great idea, it's always bugged me that different editors have different syntax highlighting semantics.

nickmccurdy commented Aug 30, 2018

Great idea, it's always bugged me that different editors have different syntax highlighting semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment