@volar/language-server 1.4.0-alpha.0 → 1.4.0-alpha.10
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/browser/fileSystems.js +83 -107
- package/out/browser/index.js +11 -23
- package/out/browser/typescript/core.js +2 -1
- package/out/browser/typescript/corePublic.js +3 -2
- package/out/browser/typescript/path.js +1 -0
- package/out/browser/typescript/types.js +1 -0
- package/out/browser/typescript/utilities.js +1 -0
- package/out/common/cancellationPipe.js +2 -1
- package/out/common/configurationHost.js +13 -28
- package/out/common/documents.js +3 -3
- package/out/common/features/customFeatures.js +35 -47
- package/out/common/features/languageFeatures.js +135 -163
- package/out/common/project.d.ts +66 -62
- package/out/common/project.js +205 -228
- package/out/common/schemaRequestHandlers/file.js +1 -0
- package/out/common/schemaRequestHandlers/http.js +1 -0
- package/out/common/server.js +63 -68
- package/out/common/utils/inferredCompilerOptions.js +58 -61
- package/out/common/utils/isFileInDir.js +1 -0
- package/out/common/utils/registerFeatures.js +11 -12
- package/out/common/utils/serverConfig.js +3 -2
- package/out/common/utils/uriMap.js +2 -1
- package/out/common/workspace.d.ts +605 -568
- package/out/common/workspace.js +182 -194
- package/out/common/workspaces.d.ts +726 -682
- package/out/common/workspaces.js +82 -107
- package/out/index.js +1 -0
- package/out/node/fileSystem.js +13 -16
- package/out/node/index.js +16 -19
- package/out/protocol.d.ts +0 -6
- package/out/protocol.js +2 -5
- package/out/types.d.ts +4 -6
- package/out/types.js +1 -0
- package/package.json +4 -4
package/out/common/server.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
1
|
+
"use strict";
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
3
|
exports.startCommonLanguageServer = void 0;
|
|
12
4
|
const language_service_1 = require("@volar/language-service");
|
|
@@ -30,17 +22,18 @@ function startCommonLanguageServer(connection, getCtx) {
|
|
|
30
22
|
let plugins;
|
|
31
23
|
let documents;
|
|
32
24
|
let context;
|
|
33
|
-
connection.onInitialize((_params) =>
|
|
34
|
-
var _a, _b, _c, _d;
|
|
25
|
+
connection.onInitialize(async (_params) => {
|
|
35
26
|
initParams = _params;
|
|
36
27
|
options = initParams.initializationOptions;
|
|
37
28
|
context = getCtx(options);
|
|
38
|
-
plugins = context.plugins.map(plugin => plugin(options
|
|
29
|
+
plugins = context.plugins.map(plugin => plugin(options, {
|
|
30
|
+
typescript: options.typescript ? context.runtimeEnv.loadTypescript(options.typescript.tsdk) : undefined
|
|
31
|
+
}));
|
|
39
32
|
documents = (0, documents_1.createDocuments)(context.runtimeEnv, connection);
|
|
40
33
|
if (options.l10n) {
|
|
41
|
-
|
|
34
|
+
await l10n.config({ uri: options.l10n.location });
|
|
42
35
|
}
|
|
43
|
-
if (
|
|
36
|
+
if (initParams.capabilities.workspace?.workspaceFolders && initParams.workspaceFolders) {
|
|
44
37
|
roots = initParams.workspaceFolders.map(folder => vscode_uri_1.URI.parse(folder.uri));
|
|
45
38
|
}
|
|
46
39
|
else if (initParams.rootUri) {
|
|
@@ -51,27 +44,36 @@ function startCommonLanguageServer(connection, getCtx) {
|
|
|
51
44
|
}
|
|
52
45
|
const result = {
|
|
53
46
|
capabilities: {
|
|
54
|
-
textDocumentSync:
|
|
47
|
+
textDocumentSync: vscode.TextDocumentSyncKind.Incremental,
|
|
48
|
+
workspace: {
|
|
49
|
+
// #18
|
|
50
|
+
workspaceFolders: {
|
|
51
|
+
supported: true,
|
|
52
|
+
changeNotifications: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
|
-
configurationHost =
|
|
57
|
+
configurationHost = initParams.capabilities.workspace?.configuration ? (0, configurationHost_1.createConfigurationHost)(initParams, connection) : undefined;
|
|
58
58
|
let lsPlugins = {};
|
|
59
|
-
const ts = options.typescript ? context.runtimeEnv.loadTypescript(options.typescript.tsdk) : undefined;
|
|
60
59
|
for (const root of roots) {
|
|
61
60
|
if (root.scheme === 'file') {
|
|
62
|
-
let config = (
|
|
61
|
+
let config = (0, serverConfig_1.loadConfig)(root.path, options.configFilePath) ?? {};
|
|
63
62
|
for (const plugin of plugins) {
|
|
64
63
|
if (plugin.resolveConfig) {
|
|
65
|
-
config = plugin.resolveConfig(config,
|
|
64
|
+
config = plugin.resolveConfig(config, undefined);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
if (config.plugins) {
|
|
69
|
-
lsPlugins =
|
|
68
|
+
lsPlugins = {
|
|
69
|
+
...lsPlugins,
|
|
70
|
+
...config.plugins,
|
|
71
|
+
};
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
(0, registerFeatures_1.setupCapabilities)(result.capabilities, options, plugins, getSemanticTokensLegend(), lsPlugins);
|
|
74
|
-
|
|
76
|
+
await createLanguageServiceHost();
|
|
75
77
|
try {
|
|
76
78
|
// show version on LSP logs
|
|
77
79
|
const packageJson = require('../package.json');
|
|
@@ -80,26 +82,25 @@ function startCommonLanguageServer(connection, getCtx) {
|
|
|
80
82
|
version: packageJson.version,
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
|
-
catch
|
|
85
|
+
catch { }
|
|
84
86
|
return result;
|
|
85
|
-
})
|
|
87
|
+
});
|
|
86
88
|
connection.onInitialized(() => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if ((_a = initParams.capabilities.workspace) === null || _a === void 0 ? void 0 : _a.workspaceFolders) {
|
|
89
|
+
fsHost?.ready(connection);
|
|
90
|
+
configurationHost?.ready();
|
|
91
|
+
if (initParams.capabilities.workspace?.workspaceFolders) {
|
|
91
92
|
connection.workspace.onDidChangeWorkspaceFolders(e => {
|
|
92
93
|
for (const folder of e.added) {
|
|
93
|
-
projects
|
|
94
|
+
projects?.add(vscode_uri_1.URI.parse(folder.uri));
|
|
94
95
|
}
|
|
95
96
|
for (const folder of e.removed) {
|
|
96
|
-
projects
|
|
97
|
+
projects?.remove(vscode_uri_1.URI.parse(folder.uri));
|
|
97
98
|
}
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
101
|
if (options.serverMode !== types_1.ServerMode.Syntactic
|
|
101
102
|
&& !options.disableFileWatcher
|
|
102
|
-
&&
|
|
103
|
+
&& initParams.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration) {
|
|
103
104
|
const exts = plugins.map(plugin => plugin.watchFileExtensions).flat();
|
|
104
105
|
if (exts.length) {
|
|
105
106
|
connection.client.register(vscode.DidChangeWatchedFilesNotification.type, {
|
|
@@ -112,50 +113,44 @@ function startCommonLanguageServer(connection, getCtx) {
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
|
-
connection.onShutdown(() =>
|
|
116
|
+
connection.onShutdown(async () => {
|
|
116
117
|
if (projects) {
|
|
117
118
|
for (const workspace of projects.workspaces) {
|
|
118
|
-
(
|
|
119
|
+
(await workspace[1]).dispose();
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
|
-
})
|
|
122
|
+
});
|
|
122
123
|
connection.listen();
|
|
123
|
-
function createLanguageServiceHost() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
cancelTokenHost,
|
|
140
|
-
plugins,
|
|
141
|
-
});
|
|
142
|
-
projects = _projects;
|
|
143
|
-
for (const root of roots) {
|
|
144
|
-
projects.add(root);
|
|
145
|
-
}
|
|
146
|
-
(yield Promise.resolve().then(() => require('./features/customFeatures'))).register(connection, projects, context.runtimeEnv);
|
|
147
|
-
(yield Promise.resolve().then(() => require('./features/languageFeatures'))).register(connection, projects, initParams, options, cancelTokenHost, getSemanticTokensLegend(), context.runtimeEnv, documents);
|
|
148
|
-
for (const plugin of plugins) {
|
|
149
|
-
(_a = plugin.onInitialized) === null || _a === void 0 ? void 0 : _a.call(plugin, getLanguageService, context.runtimeEnv);
|
|
150
|
-
}
|
|
151
|
-
function getLanguageService(uri) {
|
|
152
|
-
var _a;
|
|
153
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
const project = (_a = (yield projects.getProject(uri))) === null || _a === void 0 ? void 0 : _a.project;
|
|
155
|
-
return project === null || project === void 0 ? void 0 : project.getLanguageService();
|
|
156
|
-
});
|
|
157
|
-
}
|
|
124
|
+
async function createLanguageServiceHost() {
|
|
125
|
+
const ts = options.typescript ? context.runtimeEnv.loadTypescript(options.typescript.tsdk) : undefined;
|
|
126
|
+
fsHost = ts ? context.runtimeEnv.createFileSystemHost(ts, initParams.capabilities, context.runtimeEnv, options) : undefined;
|
|
127
|
+
const tsLocalized = options.typescript && initParams.locale ? await context.runtimeEnv.loadTypescriptLocalized(options.typescript.tsdk, initParams.locale) : undefined;
|
|
128
|
+
const cancelTokenHost = (0, cancellationPipe_1.createCancellationTokenHost)(options.cancellationPipeName);
|
|
129
|
+
const _projects = (0, workspaces_1.createWorkspaces)({
|
|
130
|
+
server: context,
|
|
131
|
+
fileSystemHost: fsHost,
|
|
132
|
+
configurationHost,
|
|
133
|
+
ts,
|
|
134
|
+
tsLocalized,
|
|
135
|
+
initParams: initParams,
|
|
136
|
+
initOptions: options,
|
|
137
|
+
documents,
|
|
138
|
+
cancelTokenHost,
|
|
139
|
+
plugins,
|
|
158
140
|
});
|
|
141
|
+
projects = _projects;
|
|
142
|
+
for (const root of roots) {
|
|
143
|
+
projects.add(root);
|
|
144
|
+
}
|
|
145
|
+
(await Promise.resolve().then(() => require('./features/customFeatures'))).register(connection, projects, context.runtimeEnv);
|
|
146
|
+
(await Promise.resolve().then(() => require('./features/languageFeatures'))).register(connection, projects, initParams, options, cancelTokenHost, getSemanticTokensLegend(), context.runtimeEnv, documents);
|
|
147
|
+
for (const plugin of plugins) {
|
|
148
|
+
plugin.onInitialized?.(getLanguageService, context.runtimeEnv);
|
|
149
|
+
}
|
|
150
|
+
async function getLanguageService(uri) {
|
|
151
|
+
const project = (await projects.getProject(uri))?.project;
|
|
152
|
+
return project?.getLanguageService();
|
|
153
|
+
}
|
|
159
154
|
}
|
|
160
155
|
function getSemanticTokensLegend() {
|
|
161
156
|
if (!options.semanticTokensLegend) {
|
|
@@ -1,71 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
1
|
+
"use strict";
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
3
|
exports.getInferredCompilerOptions = void 0;
|
|
12
|
-
function getInferredCompilerOptions(configurationHost) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
async function getInferredCompilerOptions(configurationHost) {
|
|
5
|
+
let [implicitProjectConfig_1, implicitProjectConfig_2] = await Promise.all([
|
|
6
|
+
configurationHost?.getConfiguration('js/ts.implicitProjectConfig'),
|
|
7
|
+
configurationHost?.getConfiguration('javascript.implicitProjectConfig'),
|
|
8
|
+
]);
|
|
9
|
+
implicitProjectConfig_1 = implicitProjectConfig_1 ?? {};
|
|
10
|
+
implicitProjectConfig_2 = implicitProjectConfig_2 ?? {};
|
|
11
|
+
const checkJs = readCheckJs();
|
|
12
|
+
const experimentalDecorators = readExperimentalDecorators();
|
|
13
|
+
const strictNullChecks = readImplicitStrictNullChecks();
|
|
14
|
+
const strictFunctionTypes = readImplicitStrictFunctionTypes();
|
|
15
|
+
const options = {
|
|
16
|
+
...inferredProjectCompilerOptions('typescript'),
|
|
17
|
+
allowJs: true,
|
|
18
|
+
allowSyntheticDefaultImports: true,
|
|
19
|
+
allowNonTsExtensions: true,
|
|
20
|
+
resolveJsonModule: true,
|
|
21
|
+
jsx: 1 /* ts.JsxEmit.Preserve */,
|
|
22
|
+
};
|
|
23
|
+
return options;
|
|
24
|
+
function readCheckJs() {
|
|
25
|
+
return implicitProjectConfig_1['checkJs']
|
|
26
|
+
?? implicitProjectConfig_2['checkJs']
|
|
27
|
+
?? false;
|
|
28
|
+
}
|
|
29
|
+
function readExperimentalDecorators() {
|
|
30
|
+
return implicitProjectConfig_1['experimentalDecorators']
|
|
31
|
+
?? implicitProjectConfig_2['experimentalDecorators']
|
|
32
|
+
?? false;
|
|
33
|
+
}
|
|
34
|
+
function readImplicitStrictNullChecks() {
|
|
35
|
+
return implicitProjectConfig_1['strictNullChecks'] ?? false;
|
|
36
|
+
}
|
|
37
|
+
function readImplicitStrictFunctionTypes() {
|
|
38
|
+
return implicitProjectConfig_1['strictFunctionTypes'] ?? true;
|
|
39
|
+
}
|
|
40
|
+
function inferredProjectCompilerOptions(projectType) {
|
|
41
|
+
const projectConfig = {
|
|
42
|
+
module: 1 /* ts.ModuleKind.CommonJS */,
|
|
43
|
+
target: 7 /* ts.ScriptTarget.ES2020 */,
|
|
44
|
+
jsx: 1 /* ts.JsxEmit.Preserve */,
|
|
45
|
+
};
|
|
46
|
+
if (checkJs) {
|
|
47
|
+
projectConfig.checkJs = true;
|
|
48
|
+
if (projectType === 'typescript') {
|
|
49
|
+
projectConfig.allowJs = true;
|
|
50
|
+
}
|
|
29
51
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (_b = (_a = implicitProjectConfig_1['experimentalDecorators']) !== null && _a !== void 0 ? _a : implicitProjectConfig_2['experimentalDecorators']) !== null && _b !== void 0 ? _b : false;
|
|
52
|
+
if (experimentalDecorators) {
|
|
53
|
+
projectConfig.experimentalDecorators = true;
|
|
33
54
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return (_a = implicitProjectConfig_1['strictNullChecks']) !== null && _a !== void 0 ? _a : false;
|
|
55
|
+
if (strictNullChecks) {
|
|
56
|
+
projectConfig.strictNullChecks = true;
|
|
37
57
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return (_a = implicitProjectConfig_1['strictFunctionTypes']) !== null && _a !== void 0 ? _a : true;
|
|
58
|
+
if (strictFunctionTypes) {
|
|
59
|
+
projectConfig.strictFunctionTypes = true;
|
|
41
60
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
module: 1 /* ts.ModuleKind.CommonJS */,
|
|
45
|
-
target: 7 /* ts.ScriptTarget.ES2020 */,
|
|
46
|
-
jsx: 1 /* ts.JsxEmit.Preserve */,
|
|
47
|
-
};
|
|
48
|
-
if (checkJs) {
|
|
49
|
-
projectConfig.checkJs = true;
|
|
50
|
-
if (projectType === 'typescript') {
|
|
51
|
-
projectConfig.allowJs = true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (experimentalDecorators) {
|
|
55
|
-
projectConfig.experimentalDecorators = true;
|
|
56
|
-
}
|
|
57
|
-
if (strictNullChecks) {
|
|
58
|
-
projectConfig.strictNullChecks = true;
|
|
59
|
-
}
|
|
60
|
-
if (strictFunctionTypes) {
|
|
61
|
-
projectConfig.strictFunctionTypes = true;
|
|
62
|
-
}
|
|
63
|
-
if (projectType === 'typescript') {
|
|
64
|
-
projectConfig.sourceMap = true;
|
|
65
|
-
}
|
|
66
|
-
return projectConfig;
|
|
61
|
+
if (projectType === 'typescript') {
|
|
62
|
+
projectConfig.sourceMap = true;
|
|
67
63
|
}
|
|
68
|
-
|
|
64
|
+
return projectConfig;
|
|
65
|
+
}
|
|
69
66
|
}
|
|
70
67
|
exports.getInferredCompilerOptions = getInferredCompilerOptions;
|
|
71
68
|
//# sourceMappingURL=inferredCompilerOptions.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
exports.setupCapabilities = void 0;
|
|
3
|
-
const embedded = require("@volar/language-service");
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const vscode = require("vscode-languageserver");
|
|
6
6
|
function setupCapabilities(server, initOptions, plugins, semanticTokensLegend, lsPlugins) {
|
|
7
|
-
var _a, _b, _c;
|
|
8
7
|
const lsPluginInstances = Object.values(lsPlugins)
|
|
9
8
|
.map(plugin => typeof plugin === 'function' ? plugin() : plugin)
|
|
10
9
|
.filter((plugin) => !!plugin);
|
|
11
|
-
|
|
10
|
+
const serverMode = initOptions.serverMode ?? types_1.ServerMode.Semantic;
|
|
11
|
+
if (serverMode === types_1.ServerMode.Semantic || serverMode === types_1.ServerMode.Syntactic) {
|
|
12
12
|
server.selectionRangeProvider = true;
|
|
13
13
|
server.foldingRangeProvider = true;
|
|
14
14
|
server.linkedEditingRangeProvider = true;
|
|
@@ -16,7 +16,7 @@ function setupCapabilities(server, initOptions, plugins, semanticTokensLegend, l
|
|
|
16
16
|
server.documentSymbolProvider = true;
|
|
17
17
|
server.documentFormattingProvider = true;
|
|
18
18
|
server.documentRangeFormattingProvider = true;
|
|
19
|
-
const characters = [...new Set(lsPluginInstances.map(plugin =>
|
|
19
|
+
const characters = [...new Set(lsPluginInstances.map(plugin => plugin.autoFormatTriggerCharacters ?? []).flat())];
|
|
20
20
|
if (characters.length) {
|
|
21
21
|
server.documentOnTypeFormattingProvider = {
|
|
22
22
|
firstTriggerCharacter: characters[0],
|
|
@@ -24,7 +24,7 @@ function setupCapabilities(server, initOptions, plugins, semanticTokensLegend, l
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
27
|
+
if (serverMode === types_1.ServerMode.Semantic || serverMode === types_1.ServerMode.PartialSemantic) {
|
|
28
28
|
server.referencesProvider = true;
|
|
29
29
|
server.implementationProvider = true;
|
|
30
30
|
server.definitionProvider = true;
|
|
@@ -35,15 +35,16 @@ function setupCapabilities(server, initOptions, plugins, semanticTokensLegend, l
|
|
|
35
35
|
prepareProvider: true,
|
|
36
36
|
};
|
|
37
37
|
server.signatureHelpProvider = {
|
|
38
|
-
triggerCharacters: [...new Set(lsPluginInstances.map(plugin =>
|
|
39
|
-
retriggerCharacters: [...new Set(lsPluginInstances.map(plugin =>
|
|
38
|
+
triggerCharacters: [...new Set(lsPluginInstances.map(plugin => plugin.signatureHelpTriggerCharacters ?? []).flat())],
|
|
39
|
+
retriggerCharacters: [...new Set(lsPluginInstances.map(plugin => plugin.signatureHelpRetriggerCharacters ?? []).flat())],
|
|
40
40
|
};
|
|
41
41
|
server.completionProvider = {
|
|
42
|
-
triggerCharacters: [...new Set(lsPluginInstances.map(plugin =>
|
|
42
|
+
triggerCharacters: [...new Set(lsPluginInstances.map(plugin => plugin.triggerCharacters ?? []).flat())],
|
|
43
43
|
resolveProvider: true,
|
|
44
44
|
};
|
|
45
45
|
if (initOptions.ignoreTriggerCharacters) {
|
|
46
|
-
server.completionProvider.triggerCharacters =
|
|
46
|
+
server.completionProvider.triggerCharacters = server.completionProvider.triggerCharacters
|
|
47
|
+
?.filter(c => !initOptions.ignoreTriggerCharacters.includes(c));
|
|
47
48
|
}
|
|
48
49
|
server.documentHighlightProvider = true;
|
|
49
50
|
server.documentLinkProvider = {
|
|
@@ -52,8 +53,6 @@ function setupCapabilities(server, initOptions, plugins, semanticTokensLegend, l
|
|
|
52
53
|
server.codeLensProvider = {
|
|
53
54
|
resolveProvider: true,
|
|
54
55
|
};
|
|
55
|
-
(_b = server.executeCommandProvider) !== null && _b !== void 0 ? _b : (server.executeCommandProvider = { commands: [] });
|
|
56
|
-
server.executeCommandProvider.commands.push(embedded.showReferencesCommand);
|
|
57
56
|
server.semanticTokensProvider = {
|
|
58
57
|
range: true,
|
|
59
58
|
full: false,
|
|
@@ -93,7 +92,7 @@ function setupCapabilities(server, initOptions, plugins, semanticTokensLegend, l
|
|
|
93
92
|
server.workspaceSymbolProvider = true;
|
|
94
93
|
}
|
|
95
94
|
// diagnostics are shunted in the api
|
|
96
|
-
if ((
|
|
95
|
+
if ((initOptions.diagnosticModel ?? types_1.DiagnosticModel.Push) === types_1.DiagnosticModel.Pull) {
|
|
97
96
|
server.diagnosticProvider = {
|
|
98
97
|
interFileDependencies: true,
|
|
99
98
|
workspaceDiagnostics: false,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
exports.loadConfig = void 0;
|
|
3
4
|
function loadConfig(dir, configFile) {
|
|
4
5
|
let configPath;
|
|
5
6
|
try {
|
|
6
|
-
configPath = require.resolve(configFile
|
|
7
|
+
configPath = require.resolve(configFile ?? './volar.config.js', { paths: [dir] });
|
|
7
8
|
}
|
|
8
|
-
catch
|
|
9
|
+
catch { }
|
|
9
10
|
try {
|
|
10
11
|
if (configPath) {
|
|
11
12
|
const config = require(configPath);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
exports.createUriMap = exports._ = void 0;
|
|
3
4
|
const vscode_uri_1 = require("vscode-uri");
|
|
@@ -64,7 +65,7 @@ function normalizeUri(uri) {
|
|
|
64
65
|
try {
|
|
65
66
|
return vscode_uri_1.URI.parse(uri).toString();
|
|
66
67
|
}
|
|
67
|
-
catch
|
|
68
|
+
catch {
|
|
68
69
|
return '';
|
|
69
70
|
}
|
|
70
71
|
}
|