mnespor / vscode-color-identifiers-mode

GNU General Public License v3.0
14 stars 3 forks source link

provideDocumentSemanticTokensLegend not in VS Code API? #10

Closed annahosanna closed 2 years ago

annahosanna commented 2 years ago

I was having some issues with the plugin recently and couldn't find provideDocumentSemanticTokensLegend in the VS Code API documents. Does that call still exist?

Appears that provideDocumentSemanticTokens is fine, but since it only returns a numeric table there is no way to determine if the number corresponds to a variable, parameter, or property.

There are really computationally complex solutions like cross referencing the DocumentSemanticTokens against the entire document, and then assigning a variable + its semantic token type to a hash of unique colors - except then every token gets a color - rather that just what is useful.

annahosanna commented 2 years ago

I may have made a mistake. After further review it is not in the VS Code API (which turned out to be the extension interface), but it is in the VS Code Built-In Commands (per the reference documentation)

Sorry for the trouble