Skip to content

vscode-languageserver-node: Is there some document about how language server receive semantic tokens request? #819

Discussion options

You must be logged in to vote

Hi @imbant,

The connection.languages.semanticTokens.on event is not typically used for providing semantic tokens to the client in response to a request like textDocument/semanticTokens/full. Instead, you should implement the textDocument/semanticTokens request handler in your language server.

Here's how you can set up your language server to handle textDocument/semanticTokens/full requests:

import { createConnection, ProposedFeatures } from "vscode-languageserver/node";

const connection = createConnection(ProposedFeatures.all);

connection.onInitialize(() => {
  // ...
  return {
    semanticTokensProvider: {
      legend: {
        tokenTypes: ["function", "namespace"], // register lege…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@imbant
Comment options

Answer selected by theReynald
Comment options

You must be logged in to vote
4 replies
@imbant
Comment options

@imbant
Comment options

@deanmaster
Comment options

@imbant
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants