mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
update semantic token sample
This commit is contained in:
3
semantic-tokens-sample/.vscode/launch.json
vendored
3
semantic-tokens-sample/.vscode/launch.json
vendored
@ -10,7 +10,8 @@
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"${workspaceFolder}/sample",
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
This is an extension sample showing a very simple semantic tokens provider. This semantic tokens provider always returns all the tokens in a file.
|
||||
|
||||
For more background on semantic highlighting read [here](https://github.com/microsoft/vscode/wiki/Semantic-Highlighting-Overview)
|
||||
|
||||

|
||||
|
||||
## How to run
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 80 KiB |
@ -1,7 +1,7 @@
|
||||
Available token types:
|
||||
[comment] [string] [keyword] [number] [regexp] [operator] [namespace]
|
||||
[type] [struct] [class] [interface] [enum] [parameterType] [function]
|
||||
[macro] [variable] [constant] [parameter] [property] [label]
|
||||
[type] [struct] [class] [interface] [enum] [typeParameter] [function]
|
||||
[member] [macro] [variable] [parameter] [property] [label]
|
||||
|
||||
Available token modifiers:
|
||||
[type.declaration] [type.documentation] [type.member] [type.static]
|
||||
|
||||
@ -6,13 +6,13 @@ const tokenModifiers = new Map<string, number>();
|
||||
const legend = (function () {
|
||||
const tokenTypesLegend = [
|
||||
'comment', 'string', 'keyword', 'number', 'regexp', 'operator', 'namespace',
|
||||
'type', 'struct', 'class', 'interface', 'enum', 'parameterType', 'function',
|
||||
'macro', 'variable', 'constant', 'parameter', 'property', 'label'
|
||||
'type', 'struct', 'class', 'interface', 'enum', 'typeParameter', 'function',
|
||||
'member', 'macro', 'variable', 'parameter', 'property', 'label'
|
||||
];
|
||||
tokenTypesLegend.forEach((tokenType, index) => tokenTypes.set(tokenType, index));
|
||||
|
||||
const tokenModifiersLegend = [
|
||||
'declaration', 'documentation', 'member', 'static', 'abstract', 'deprecated',
|
||||
'declaration', 'documentation', 'readonly', 'static', 'abstract', 'deprecated',
|
||||
'modification', 'async'
|
||||
];
|
||||
tokenModifiersLegend.forEach((tokenModifier, index) => tokenModifiers.set(tokenModifier, index));
|
||||
|
||||
Reference in New Issue
Block a user