1.1.0 • Published 1 year ago

vscode-semantic-tokens v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

vscode-semantic-tokens

NPM

Small utility to get the semantic tokens of a VS Code document in a more nicer format.

This basically computes the semantic tokens you would get from DocumentSemanticTokensProvider.provideDocumentSemanticTokens method.

Usage

The API is fairly simple. You just need to pass a TextDocument and you will get an array of semantic tokens.

import { getSemanticTokens } from 'vscode-semantic-tokens';

// ...

const tokens = getSemanticTokens(document);

The semantic tokens have the following shape:

export type SemanticToken = {
  text: string;
  line: number;
  startChar: number;
  length: number;
  tokenType: string;
  tokenModifiers: string[];
};
1.0.2

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago