@volar/language-server 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/{utils/webFileSystemHost.d.ts → browser/fileSystems.d.ts} +0 -0
- package/out/{utils/webFileSystemHost.js → browser/fileSystems.js} +4 -4
- package/out/{browser.d.ts → browser/index.d.ts} +2 -2
- package/out/{browser.js → browser/index.js} +32 -28
- package/out/{utils/ts → browser/typescript}/core.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/core.js +0 -0
- package/out/{utils/ts → browser/typescript}/corePublic.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/corePublic.js +0 -0
- package/out/{utils/ts → browser/typescript}/path.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/path.js +0 -0
- package/out/{utils/ts → browser/typescript}/types.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/types.js +0 -0
- package/out/{utils/ts → browser/typescript}/utilities.d.ts +0 -0
- package/out/{utils/ts → browser/typescript}/utilities.js +0 -0
- package/out/{utils → common}/cancellationPipe.d.ts +0 -0
- package/out/{utils → common}/cancellationPipe.js +0 -0
- package/out/{utils → common}/configurationHost.d.ts +1 -1
- package/out/{utils → common}/configurationHost.js +7 -5
- package/out/{utils/snapshots.d.ts → common/documents.d.ts} +1 -1
- package/out/{utils/snapshots.js → common/documents.js} +5 -5
- package/out/{features → common/features}/customFeatures.d.ts +1 -1
- package/out/{features → common/features}/customFeatures.js +20 -42
- package/out/common/features/documentFeatures.d.ts +4 -0
- package/out/{features → common/features}/documentFeatures.js +1 -1
- package/out/common/features/languageFeatures.d.ts +4 -0
- package/out/{features → common/features}/languageFeatures.js +4 -5
- package/out/{utils → common}/project.d.ts +13 -8
- package/out/{utils → common}/project.js +19 -16
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/file.d.ts +0 -0
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/file.js +0 -0
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/http.d.ts +0 -0
- package/out/{schemaRequestHandlers → common/schemaRequestHandlers}/http.js +0 -0
- package/out/common/server.d.ts +8 -0
- package/out/{server.js → common/server.js} +94 -33
- package/out/{utils/documentServiceHost.d.ts → common/syntaxServicesHost.d.ts} +2 -2
- package/out/{utils/documentServiceHost.js → common/syntaxServicesHost.js} +10 -10
- package/out/{utils → common/utils}/inferredCompilerOptions.d.ts +0 -0
- package/out/{utils → common/utils}/inferredCompilerOptions.js +0 -0
- package/out/{registerFeatures.d.ts → common/utils/registerFeatures.d.ts} +2 -3
- package/out/{registerFeatures.js → common/utils/registerFeatures.js} +5 -48
- package/out/{utils/config.d.ts → common/utils/serverConfig.d.ts} +0 -0
- package/out/{utils/config.js → common/utils/serverConfig.js} +1 -1
- package/out/{utils → common/utils}/uriMap.d.ts +0 -0
- package/out/{utils → common/utils}/uriMap.js +0 -0
- package/out/common/workspace.d.ts +1186 -0
- package/out/{utils/workspaceProjects.js → common/workspace.js} +29 -13
- package/out/common/workspaces.d.ts +1465 -0
- package/out/{utils → common}/workspaces.js +15 -10
- package/out/{utils/nodeFileSystemHost.d.ts → node/fileSystem.d.ts} +0 -0
- package/out/{utils/nodeFileSystemHost.js → node/fileSystem.js} +17 -19
- package/out/{node.d.ts → node/index.d.ts} +2 -2
- package/out/node/index.js +107 -0
- package/out/protocol.d.ts +4 -6
- package/out/protocol.js +1 -5
- package/out/types.d.ts +5 -3
- package/package.json +5 -5
- package/out/features/documentFeatures.d.ts +0 -4
- package/out/features/languageFeatures.d.ts +0 -4
- package/out/node.js +0 -103
- package/out/server.d.ts +0 -3
- package/out/utils/iterableWeakSet.d.ts +0 -7
- package/out/utils/iterableWeakSet.js +0 -40
- package/out/utils/workspaceProjects.d.ts +0 -162
- package/out/utils/workspaces.d.ts +0 -429
|
@@ -11,48 +11,49 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.createCommonLanguageServer = void 0;
|
|
12
12
|
const vscode = require("vscode-languageserver");
|
|
13
13
|
const vscode_uri_1 = require("vscode-uri");
|
|
14
|
-
const types_1 = require("
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const registerFeatures_1 = require("./registerFeatures");
|
|
20
|
-
const
|
|
21
|
-
function createCommonLanguageServer(
|
|
22
|
-
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
const cancellationPipe_1 = require("./cancellationPipe");
|
|
16
|
+
const configurationHost_1 = require("./configurationHost");
|
|
17
|
+
const documents_1 = require("./documents");
|
|
18
|
+
const syntaxServicesHost_1 = require("./syntaxServicesHost");
|
|
19
|
+
const registerFeatures_1 = require("./utils/registerFeatures");
|
|
20
|
+
const workspaces_1 = require("./workspaces");
|
|
21
|
+
function createCommonLanguageServer(params) {
|
|
22
|
+
const { connection, runtimeEnv, plugins: _plugins } = params;
|
|
23
|
+
let initParams;
|
|
23
24
|
let options;
|
|
24
25
|
let roots = [];
|
|
25
26
|
let fsHost;
|
|
26
27
|
let projects;
|
|
27
28
|
let documentServiceHost;
|
|
28
|
-
let
|
|
29
|
+
let configurationHost;
|
|
29
30
|
let plugins;
|
|
30
|
-
const documents = (0,
|
|
31
|
+
const documents = (0, documents_1.createDocuments)(connection);
|
|
31
32
|
connection.onInitialize((_params) => __awaiter(this, void 0, void 0, function* () {
|
|
32
33
|
var _a, _b, _c, _d;
|
|
33
|
-
|
|
34
|
-
options =
|
|
34
|
+
initParams = _params;
|
|
35
|
+
options = initParams.initializationOptions;
|
|
35
36
|
plugins = _plugins.map(plugin => plugin(options));
|
|
36
|
-
if (((_a =
|
|
37
|
-
roots =
|
|
37
|
+
if (((_a = initParams.capabilities.workspace) === null || _a === void 0 ? void 0 : _a.workspaceFolders) && initParams.workspaceFolders) {
|
|
38
|
+
roots = initParams.workspaceFolders.map(folder => vscode_uri_1.URI.parse(folder.uri));
|
|
38
39
|
}
|
|
39
|
-
else if (
|
|
40
|
-
roots = [vscode_uri_1.URI.parse(
|
|
40
|
+
else if (initParams.rootUri) {
|
|
41
|
+
roots = [vscode_uri_1.URI.parse(initParams.rootUri)];
|
|
41
42
|
}
|
|
42
|
-
else if (
|
|
43
|
-
roots = [vscode_uri_1.URI.file(
|
|
43
|
+
else if (initParams.rootPath) {
|
|
44
|
+
roots = [vscode_uri_1.URI.file(initParams.rootPath)];
|
|
44
45
|
}
|
|
45
46
|
const result = {
|
|
46
47
|
capabilities: {
|
|
47
48
|
textDocumentSync: (_b = options.textDocumentSync) !== null && _b !== void 0 ? _b : vscode.TextDocumentSyncKind.Incremental,
|
|
48
49
|
},
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
configurationHost = ((_c = initParams.capabilities.workspace) === null || _c === void 0 ? void 0 : _c.configuration) ? (0, configurationHost_1.createConfigurationHost)(initParams, connection) : undefined;
|
|
51
52
|
const serverMode = (_d = options.serverMode) !== null && _d !== void 0 ? _d : types_1.ServerMode.Semantic;
|
|
52
|
-
(0, registerFeatures_1.setupSyntacticCapabilities)(
|
|
53
|
+
(0, registerFeatures_1.setupSyntacticCapabilities)(initParams.capabilities, result.capabilities, options);
|
|
53
54
|
yield _createDocumentServiceHost();
|
|
54
55
|
if (serverMode === types_1.ServerMode.Semantic) {
|
|
55
|
-
(0, registerFeatures_1.setupSemanticCapabilities)(
|
|
56
|
+
(0, registerFeatures_1.setupSemanticCapabilities)(initParams.capabilities, result.capabilities, options, plugins, getSemanticTokensLegend());
|
|
56
57
|
yield createLanguageServiceHost();
|
|
57
58
|
}
|
|
58
59
|
try {
|
|
@@ -66,11 +67,11 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
66
67
|
catch (_e) { }
|
|
67
68
|
return result;
|
|
68
69
|
}));
|
|
69
|
-
connection.onInitialized(() =>
|
|
70
|
-
var
|
|
70
|
+
connection.onInitialized(() => {
|
|
71
|
+
var _a, _b, _c;
|
|
71
72
|
fsHost === null || fsHost === void 0 ? void 0 : fsHost.ready(connection);
|
|
72
|
-
|
|
73
|
-
if ((
|
|
73
|
+
configurationHost === null || configurationHost === void 0 ? void 0 : configurationHost.ready();
|
|
74
|
+
if ((_a = initParams.capabilities.workspace) === null || _a === void 0 ? void 0 : _a.workspaceFolders) {
|
|
74
75
|
connection.workspace.onDidChangeWorkspaceFolders(e => {
|
|
75
76
|
for (const folder of e.added) {
|
|
76
77
|
documentServiceHost === null || documentServiceHost === void 0 ? void 0 : documentServiceHost.add(vscode_uri_1.URI.parse(folder.uri));
|
|
@@ -84,7 +85,7 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
84
85
|
}
|
|
85
86
|
if (options.serverMode !== types_1.ServerMode.Syntactic
|
|
86
87
|
&& !options.disableFileWatcher
|
|
87
|
-
&& ((
|
|
88
|
+
&& ((_c = (_b = initParams.capabilities.workspace) === null || _b === void 0 ? void 0 : _b.didChangeWatchedFiles) === null || _c === void 0 ? void 0 : _c.dynamicRegistration)) {
|
|
88
89
|
connection.client.register(vscode.DidChangeWatchedFilesNotification.type, {
|
|
89
90
|
watchers: [
|
|
90
91
|
...plugins.map(plugin => plugin.extraFileExtensions.map(ext => ({ globPattern: `**/*.${ext.extension}` }))).flat(),
|
|
@@ -105,13 +106,13 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
105
106
|
]
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
})
|
|
109
|
+
});
|
|
109
110
|
connection.listen();
|
|
110
111
|
function _createDocumentServiceHost() {
|
|
111
112
|
var _a, _b;
|
|
112
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
114
|
const ts = runtimeEnv.loadTypescript(options.typescript.tsdk);
|
|
114
|
-
documentServiceHost = (0,
|
|
115
|
+
documentServiceHost = (0, syntaxServicesHost_1.createSyntaxServicesHost)(runtimeEnv, plugins, ts, configurationHost, options);
|
|
115
116
|
for (const root of roots) {
|
|
116
117
|
documentServiceHost.add(root);
|
|
117
118
|
}
|
|
@@ -125,16 +126,27 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
125
126
|
var _a, _b;
|
|
126
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
128
|
const ts = runtimeEnv.loadTypescript(options.typescript.tsdk);
|
|
128
|
-
fsHost = runtimeEnv.createFileSystemHost(ts,
|
|
129
|
-
const tsLocalized =
|
|
129
|
+
fsHost = runtimeEnv.createFileSystemHost(ts, initParams.capabilities);
|
|
130
|
+
const tsLocalized = initParams.locale ? yield runtimeEnv.loadTypescriptLocalized(options.typescript.tsdk, initParams.locale) : undefined;
|
|
130
131
|
const cancelTokenHost = (0, cancellationPipe_1.createCancellationTokenHost)(options.cancellationPipeName);
|
|
131
|
-
const _projects = (0, workspaces_1.createWorkspaces)(
|
|
132
|
+
const _projects = (0, workspaces_1.createWorkspaces)({
|
|
133
|
+
server: params,
|
|
134
|
+
fileSystemHost: fsHost,
|
|
135
|
+
configurationHost,
|
|
136
|
+
ts,
|
|
137
|
+
tsLocalized,
|
|
138
|
+
initParams: initParams,
|
|
139
|
+
initOptions: options,
|
|
140
|
+
documents,
|
|
141
|
+
cancelTokenHost,
|
|
142
|
+
plugins,
|
|
143
|
+
});
|
|
132
144
|
projects = _projects;
|
|
133
145
|
for (const root of roots) {
|
|
134
146
|
projects.add(root);
|
|
135
147
|
}
|
|
136
148
|
(yield Promise.resolve().then(() => require('./features/customFeatures'))).register(connection, projects);
|
|
137
|
-
(yield Promise.resolve().then(() => require('./features/languageFeatures'))).register(connection, projects,
|
|
149
|
+
(yield Promise.resolve().then(() => require('./features/languageFeatures'))).register(connection, projects, initParams, cancelTokenHost, getSemanticTokensLegend());
|
|
138
150
|
for (const plugin of plugins) {
|
|
139
151
|
(_b = (_a = plugin.semanticService) === null || _a === void 0 ? void 0 : _a.onInitialize) === null || _b === void 0 ? void 0 : _b.call(_a, connection, getLanguageService);
|
|
140
152
|
}
|
|
@@ -147,6 +159,55 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
147
159
|
}
|
|
148
160
|
});
|
|
149
161
|
}
|
|
162
|
+
function getSemanticTokensLegend() {
|
|
163
|
+
if (!options.semanticTokensLegend) {
|
|
164
|
+
return standardSemanticTokensLegend;
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
tokenTypes: [...standardSemanticTokensLegend.tokenTypes, ...options.semanticTokensLegend.tokenTypes],
|
|
168
|
+
tokenModifiers: [...standardSemanticTokensLegend.tokenModifiers, ...options.semanticTokensLegend.tokenModifiers],
|
|
169
|
+
};
|
|
170
|
+
}
|
|
150
171
|
}
|
|
151
172
|
exports.createCommonLanguageServer = createCommonLanguageServer;
|
|
173
|
+
// https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers
|
|
174
|
+
const standardSemanticTokensLegend = {
|
|
175
|
+
tokenTypes: [
|
|
176
|
+
'namespace',
|
|
177
|
+
'class',
|
|
178
|
+
'enum',
|
|
179
|
+
'interface',
|
|
180
|
+
'struct',
|
|
181
|
+
'typeParameter',
|
|
182
|
+
'type',
|
|
183
|
+
'parameter',
|
|
184
|
+
'variable',
|
|
185
|
+
'property',
|
|
186
|
+
'enumMember',
|
|
187
|
+
'decorator',
|
|
188
|
+
'event',
|
|
189
|
+
'function',
|
|
190
|
+
'method',
|
|
191
|
+
'macro',
|
|
192
|
+
'label',
|
|
193
|
+
'comment',
|
|
194
|
+
'string',
|
|
195
|
+
'keyword',
|
|
196
|
+
'number',
|
|
197
|
+
'regexp',
|
|
198
|
+
'operator',
|
|
199
|
+
],
|
|
200
|
+
tokenModifiers: [
|
|
201
|
+
'declaration',
|
|
202
|
+
'definition',
|
|
203
|
+
'readonly',
|
|
204
|
+
'static',
|
|
205
|
+
'deprecated',
|
|
206
|
+
'abstract',
|
|
207
|
+
'async',
|
|
208
|
+
'modification',
|
|
209
|
+
'documentation',
|
|
210
|
+
'defaultLibrary',
|
|
211
|
+
],
|
|
212
|
+
};
|
|
152
213
|
//# sourceMappingURL=server.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LanguageServerInitializationOptions, LanguageServerPlugin, RuntimeEnvironment } from '../types';
|
|
2
1
|
import * as embedded from '@volar/language-service';
|
|
3
2
|
import { URI } from 'vscode-uri';
|
|
3
|
+
import { LanguageServerInitializationOptions, LanguageServerPlugin, RuntimeEnvironment } from '../types';
|
|
4
4
|
import type * as _ from 'vscode-languageserver-textdocument';
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function createSyntaxServicesHost(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], ts: typeof import('typescript/lib/tsserverlibrary'), configHost: embedded.ConfigurationHost | undefined, initOptions: LanguageServerInitializationOptions): {
|
|
6
6
|
add: (rootUri: URI) => void;
|
|
7
7
|
remove: (rootUri: URI) => void;
|
|
8
8
|
get: (documentUri: string) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
2
|
+
exports.createSyntaxServicesHost = void 0;
|
|
3
3
|
const embedded = require("@volar/language-service");
|
|
4
4
|
const vscode_uri_1 = require("vscode-uri");
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
5
|
+
const serverConfig_1 = require("./utils/serverConfig");
|
|
6
|
+
function createSyntaxServicesHost(runtimeEnv, plugins, ts, configHost, initOptions) {
|
|
7
|
+
const services = new Map();
|
|
8
8
|
const untitledService = create(vscode_uri_1.URI.from({ scheme: 'untitled' }));
|
|
9
9
|
return {
|
|
10
10
|
add,
|
|
@@ -12,13 +12,13 @@ function createDocumentServiceHost(runtimeEnv, plugins, ts, configHost, initOpti
|
|
|
12
12
|
get,
|
|
13
13
|
};
|
|
14
14
|
function add(rootUri) {
|
|
15
|
-
|
|
15
|
+
services.set(rootUri.toString(), create(rootUri));
|
|
16
16
|
}
|
|
17
17
|
function remove(rootUri) {
|
|
18
|
-
|
|
18
|
+
services.delete(rootUri.toString());
|
|
19
19
|
}
|
|
20
20
|
function get(documentUri) {
|
|
21
|
-
for (const [rootUri, service] of
|
|
21
|
+
for (const [rootUri, service] of services) {
|
|
22
22
|
if (documentUri.startsWith(rootUri)) {
|
|
23
23
|
return service;
|
|
24
24
|
}
|
|
@@ -39,7 +39,7 @@ function createDocumentServiceHost(runtimeEnv, plugins, ts, configHost, initOpti
|
|
|
39
39
|
},
|
|
40
40
|
getPlugins() {
|
|
41
41
|
return [
|
|
42
|
-
...(0,
|
|
42
|
+
...(0, serverConfig_1.loadCustomPlugins)(rootUri.fsPath, initOptions.configFilePath),
|
|
43
43
|
...plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.syntacticService) === null || _a === void 0 ? void 0 : _a.getServicePlugins) === null || _b === void 0 ? void 0 : _b.call(_a, serviceContext)) !== null && _c !== void 0 ? _c : []; }).flat(),
|
|
44
44
|
];
|
|
45
45
|
},
|
|
@@ -47,5 +47,5 @@ function createDocumentServiceHost(runtimeEnv, plugins, ts, configHost, initOpti
|
|
|
47
47
|
return embedded.createDocumentService(serviceContext);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
exports.
|
|
51
|
-
//# sourceMappingURL=
|
|
50
|
+
exports.createSyntaxServicesHost = createSyntaxServicesHost;
|
|
51
|
+
//# sourceMappingURL=syntaxServicesHost.js.map
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { LanguageServerPlugin, LanguageServerInitializationOptions } from '
|
|
1
|
+
import { LanguageServerPlugin, LanguageServerInitializationOptions } from '../../types';
|
|
2
2
|
import * as vscode from 'vscode-languageserver';
|
|
3
3
|
import { ClientCapabilities } from 'vscode-languageserver';
|
|
4
|
-
export declare const semanticTokensLegend: vscode.SemanticTokensLegend;
|
|
5
4
|
export declare function setupSyntacticCapabilities(params: ClientCapabilities, server: vscode.ServerCapabilities, initOptions: LanguageServerInitializationOptions): void;
|
|
6
|
-
export declare function setupSemanticCapabilities(params: ClientCapabilities, server: vscode.ServerCapabilities, initOptions: LanguageServerInitializationOptions, plugins: ReturnType<LanguageServerPlugin>[]): void;
|
|
5
|
+
export declare function setupSemanticCapabilities(params: ClientCapabilities, server: vscode.ServerCapabilities, initOptions: LanguageServerInitializationOptions, plugins: ReturnType<LanguageServerPlugin>[], semanticTokensLegend: vscode.SemanticTokensLegend): void;
|
|
@@ -1,48 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.setupSemanticCapabilities = exports.setupSyntacticCapabilities =
|
|
2
|
+
exports.setupSemanticCapabilities = exports.setupSyntacticCapabilities = void 0;
|
|
3
3
|
const embedded = require("@volar/language-service");
|
|
4
|
-
const types_1 = require("
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
5
|
const vscode = require("vscode-languageserver");
|
|
6
|
-
// https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers
|
|
7
|
-
exports.semanticTokensLegend = {
|
|
8
|
-
tokenTypes: [
|
|
9
|
-
'namespace',
|
|
10
|
-
'class',
|
|
11
|
-
'enum',
|
|
12
|
-
'interface',
|
|
13
|
-
'struct',
|
|
14
|
-
'typeParameter',
|
|
15
|
-
'type',
|
|
16
|
-
'parameter',
|
|
17
|
-
'variable',
|
|
18
|
-
'property',
|
|
19
|
-
'enumMember',
|
|
20
|
-
'decorator',
|
|
21
|
-
'event',
|
|
22
|
-
'function',
|
|
23
|
-
'method',
|
|
24
|
-
'macro',
|
|
25
|
-
'label',
|
|
26
|
-
'comment',
|
|
27
|
-
'string',
|
|
28
|
-
'keyword',
|
|
29
|
-
'number',
|
|
30
|
-
'regexp',
|
|
31
|
-
'operator',
|
|
32
|
-
],
|
|
33
|
-
tokenModifiers: [
|
|
34
|
-
'declaration',
|
|
35
|
-
'definition',
|
|
36
|
-
'readonly',
|
|
37
|
-
'static',
|
|
38
|
-
'deprecated',
|
|
39
|
-
'abstract',
|
|
40
|
-
'async',
|
|
41
|
-
'modification',
|
|
42
|
-
'documentation',
|
|
43
|
-
'defaultLibrary',
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
6
|
function setupSyntacticCapabilities(params, server, initOptions) {
|
|
47
7
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
8
|
if (!initOptions.respectClientCapabilities || ((_a = params.textDocument) === null || _a === void 0 ? void 0 : _a.selectionRange)) {
|
|
@@ -75,7 +35,7 @@ function setupSyntacticCapabilities(params, server, initOptions) {
|
|
|
75
35
|
}
|
|
76
36
|
}
|
|
77
37
|
exports.setupSyntacticCapabilities = setupSyntacticCapabilities;
|
|
78
|
-
function setupSemanticCapabilities(params, server, initOptions, plugins) {
|
|
38
|
+
function setupSemanticCapabilities(params, server, initOptions, plugins, semanticTokensLegend) {
|
|
79
39
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
80
40
|
if (!initOptions.respectClientCapabilities || ((_a = params.textDocument) === null || _a === void 0 ? void 0 : _a.references)) {
|
|
81
41
|
server.referencesProvider = true;
|
|
@@ -162,16 +122,13 @@ function setupSemanticCapabilities(params, server, initOptions, plugins) {
|
|
|
162
122
|
resolveProvider: true,
|
|
163
123
|
};
|
|
164
124
|
server.executeCommandProvider = { commands: [...(_s = (_r = server.executeCommandProvider) === null || _r === void 0 ? void 0 : _r.commands) !== null && _s !== void 0 ? _s : []] };
|
|
165
|
-
|
|
166
|
-
if (!initOptions.__noPluginCommands) {
|
|
167
|
-
server.executeCommandProvider.commands.push(embedded.executePluginCommand);
|
|
168
|
-
}
|
|
125
|
+
server.executeCommandProvider.commands.push(embedded.executePluginCommand);
|
|
169
126
|
}
|
|
170
127
|
if (!initOptions.respectClientCapabilities || ((_t = params.textDocument) === null || _t === void 0 ? void 0 : _t.semanticTokens)) {
|
|
171
128
|
server.semanticTokensProvider = {
|
|
172
129
|
range: true,
|
|
173
130
|
full: false,
|
|
174
|
-
legend:
|
|
131
|
+
legend: semanticTokensLegend,
|
|
175
132
|
};
|
|
176
133
|
}
|
|
177
134
|
if (!initOptions.respectClientCapabilities || ((_u = params.textDocument) === null || _u === void 0 ? void 0 : _u.codeAction)) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|