Update to the released semantic token apis.
This commit is contained in:
Родитель
8c2f3402bc
Коммит
5295a552ea
|
@ -1609,12 +1609,6 @@
|
|||
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
|
||||
"dev": true
|
||||
},
|
||||
"browser-stdout": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz",
|
||||
"integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=",
|
||||
"dev": true
|
||||
},
|
||||
"browserify-aes": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||
|
@ -4672,12 +4666,6 @@
|
|||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
||||
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
|
||||
},
|
||||
"growl": {
|
||||
"version": "1.10.3",
|
||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz",
|
||||
"integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==",
|
||||
"dev": true
|
||||
},
|
||||
"gulp": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.0.tgz",
|
||||
|
@ -5006,12 +4994,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
|
||||
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
|
||||
"dev": true
|
||||
},
|
||||
"has-symbols": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
|
||||
|
@ -10445,62 +10427,18 @@
|
|||
}
|
||||
},
|
||||
"vscode": {
|
||||
"version": "1.1.33",
|
||||
"resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.33.tgz",
|
||||
"integrity": "sha512-sXedp2oF6y4ZvqrrFiZpeMzaCLSWV+PpYkIxjG/iYquNZ9KrLL2LujltGxPLvzn49xu2sZkyC+avVNFgcJD1Iw==",
|
||||
"version": "1.1.36",
|
||||
"resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.36.tgz",
|
||||
"integrity": "sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.2",
|
||||
"mocha": "^4.0.1",
|
||||
"mocha": "^5.2.0",
|
||||
"request": "^2.88.0",
|
||||
"semver": "^5.4.1",
|
||||
"source-map-support": "^0.5.0",
|
||||
"url-parse": "^1.4.4",
|
||||
"vscode-test": "^0.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"mocha": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz",
|
||||
"integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browser-stdout": "1.3.0",
|
||||
"commander": "2.11.0",
|
||||
"debug": "3.1.0",
|
||||
"diff": "3.3.1",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"glob": "7.1.2",
|
||||
"growl": "1.10.3",
|
||||
"he": "1.1.1",
|
||||
"mkdirp": "0.5.1",
|
||||
"supports-color": "4.4.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
|
||||
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^2.0.0"
|
||||
}
|
||||
}
|
||||
"vscode-test": "^0.4.1"
|
||||
}
|
||||
},
|
||||
"vscode-debugprotocol": {
|
||||
|
@ -10590,9 +10528,9 @@
|
|||
"integrity": "sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw=="
|
||||
},
|
||||
"vscode-test": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.1.5.tgz",
|
||||
"integrity": "sha512-s+lbF1Dtasc0yXVB9iQTexBe2JK6HJAUJe3fWezHKIjq+xRw5ZwCMEMBaonFIPy7s95qg2HPTRDR5W4h4kbxGw==",
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-0.4.3.tgz",
|
||||
"integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"http-proxy-agent": "^2.1.0",
|
||||
|
|
96
package.json
96
package.json
|
@ -152,7 +152,7 @@
|
|||
"typescript": "^3.8.3",
|
||||
"unzipper": "0.9.10",
|
||||
"vsce": "1.57.0",
|
||||
"vscode": "1.1.33",
|
||||
"vscode": "1.1.36",
|
||||
"webpack": "4.29.3",
|
||||
"webpack-cli": "^3.2.3"
|
||||
},
|
||||
|
@ -360,7 +360,7 @@
|
|||
}
|
||||
],
|
||||
"engines": {
|
||||
"vscode": "^1.36.0"
|
||||
"vscode": "^1.44.0"
|
||||
},
|
||||
"activationEvents": [
|
||||
"onDebugInitialConfigurations",
|
||||
|
@ -3093,93 +3093,59 @@
|
|||
}
|
||||
],
|
||||
"semanticTokenModifiers": [],
|
||||
"semanticTokenStyleDefaults": [
|
||||
"semanticTokenScopes": [
|
||||
{
|
||||
"selector": "plainKeyword",
|
||||
"scope": [
|
||||
"language": "csharp",
|
||||
"scopes": {
|
||||
"plainKeyword": [
|
||||
"keyword"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "controlKeyword",
|
||||
"scope": [
|
||||
],
|
||||
"controlKeyword": [
|
||||
"keyword.control"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "operatorOverloaded",
|
||||
"scope": [
|
||||
],
|
||||
"operatorOverloaded": [
|
||||
"entity.name.function.member",
|
||||
"support.function"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "preprocessorKeyword",
|
||||
"scope": [
|
||||
],
|
||||
"preprocessorKeyword": [
|
||||
"keyword.preprocessor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "preprocessorText",
|
||||
"scope": [
|
||||
],
|
||||
"preprocessorText": [
|
||||
"meta.preprocessor.string"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "punctuation",
|
||||
"scope": [
|
||||
],
|
||||
"punctuation": [
|
||||
"punctuation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "stringVerbatim",
|
||||
"scope": [
|
||||
],
|
||||
"stringVerbatim": [
|
||||
"string.verbatim",
|
||||
"string"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "stringEscapeCharacter",
|
||||
"scope": [
|
||||
],
|
||||
"stringEscapeCharacter": [
|
||||
"constant.character.escape"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "delegate",
|
||||
"scope": [
|
||||
],
|
||||
"delegate": [
|
||||
"entity.name.type.delegate",
|
||||
"entity.name.type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "module",
|
||||
"scope": [
|
||||
],
|
||||
"module": [
|
||||
"entity.name.type.module",
|
||||
"entity.name.type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "extensionMethod",
|
||||
"scope": [
|
||||
],
|
||||
"extensionMethod": [
|
||||
"entity.name.function.extension",
|
||||
"entity.name.function.member",
|
||||
"support.function"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "field",
|
||||
"scope": [
|
||||
],
|
||||
"field": [
|
||||
"entity.name.variable.field",
|
||||
"entity.name.variable"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "local",
|
||||
"scope": [
|
||||
],
|
||||
"local": [
|
||||
"entity.name.variable.local",
|
||||
"entity.name.variable"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"languages": [
|
||||
{
|
||||
|
|
|
@ -207,7 +207,7 @@ export default class SemanticTokensProvider extends AbstractProvider implements
|
|||
builder.push(line, startCharacter, endCharacter - startCharacter, tokenType, tokenModifiers);
|
||||
}
|
||||
}
|
||||
return new vscode.SemanticTokens(builder.build());
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,12 +95,9 @@ export async function activate(context: vscode.ExtensionContext, packageJSON: an
|
|||
localDisposables.add(trackVirtualDocuments(server, eventStream));
|
||||
localDisposables.add(vscode.languages.registerFoldingRangeProvider(documentSelector, new StructureProvider(server, languageMiddlewareFeature)));
|
||||
|
||||
// Do not set during tests
|
||||
if (process.env.OSVC_SUITE === undefined && vscode.languages.registerDocumentSemanticTokensProvider !== undefined) {
|
||||
const semanticTokensProvider = new SemanticTokensProvider(server, languageMiddlewareFeature);
|
||||
localDisposables.add(vscode.languages.registerDocumentSemanticTokensProvider(documentSelector, semanticTokensProvider, semanticTokensProvider.getLegend()));
|
||||
localDisposables.add(vscode.languages.registerDocumentRangeSemanticTokensProvider(documentSelector, semanticTokensProvider, semanticTokensProvider.getLegend()));
|
||||
}
|
||||
}));
|
||||
|
||||
disposables.add(server.onServerStop(() => {
|
||||
|
|
|
@ -40,11 +40,11 @@ export class StatusBarItemAdapter implements vscodeAdapter.StatusBarItem {
|
|||
this.statusBarItem.color = value;
|
||||
}
|
||||
|
||||
get command(): string {
|
||||
get command(): string | vscode.Command {
|
||||
return this.statusBarItem.command;
|
||||
}
|
||||
|
||||
set command(value: string) {
|
||||
set command(value: string | vscode.Command) {
|
||||
this.statusBarItem.command = value;
|
||||
}
|
||||
|
||||
|
|
|
@ -194,6 +194,34 @@ export enum StatusBarAlignment {
|
|||
Right = 2
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a reference to a command. Provides a title which
|
||||
* will be used to represent a command in the UI and, optionally,
|
||||
* an array of arguments which will be passed to the command handler
|
||||
* function when invoked.
|
||||
*/
|
||||
export interface Command {
|
||||
/**
|
||||
* Title of the command, like `save`.
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* The identifier of the actual command handler.
|
||||
*/
|
||||
command: string;
|
||||
|
||||
/**
|
||||
* A tooltip for the command, when represented in the UI.
|
||||
*/
|
||||
tooltip?: string;
|
||||
|
||||
/**
|
||||
* Arguments that the command handler should be
|
||||
* invoked with.
|
||||
*/
|
||||
arguments?: any[];
|
||||
}
|
||||
|
||||
export interface StatusBarItem {
|
||||
|
||||
|
@ -232,7 +260,7 @@ export interface StatusBarItem {
|
|||
* The identifier of a command to run on click. The command must be
|
||||
* [known](#commands.getCommands).
|
||||
*/
|
||||
command: string | undefined;
|
||||
command: string | Command | undefined;
|
||||
|
||||
/**
|
||||
* Shows the entry in the status bar.
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче