@volar/language-server 1.0.0-beta.8 → 1.0.0-rc.2

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.
@@ -134,9 +134,9 @@ function setupSemanticCapabilities(params, server, options, plugins) {
134
134
  },
135
135
  };
136
136
  for (const plugin of plugins) {
137
- if ((_u = plugin.languageService) === null || _u === void 0 ? void 0 : _u.semanticTokenLegend) {
138
- server.semanticTokensProvider.legend.tokenModifiers = server.semanticTokensProvider.legend.tokenModifiers.concat(plugin.languageService.semanticTokenLegend.tokenModifiers);
139
- server.semanticTokensProvider.legend.tokenTypes = server.semanticTokensProvider.legend.tokenTypes.concat(plugin.languageService.semanticTokenLegend.tokenTypes);
137
+ if ((_u = plugin.semanticService) === null || _u === void 0 ? void 0 : _u.semanticTokenLegend) {
138
+ server.semanticTokensProvider.legend.tokenModifiers = server.semanticTokensProvider.legend.tokenModifiers.concat(plugin.semanticService.semanticTokenLegend.tokenModifiers);
139
+ server.semanticTokensProvider.legend.tokenTypes = server.semanticTokensProvider.legend.tokenTypes.concat(plugin.semanticService.semanticTokenLegend.tokenTypes);
140
140
  }
141
141
  }
142
142
  }
package/out/server.js CHANGED
@@ -94,7 +94,7 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
94
94
  }
95
95
  (yield Promise.resolve().then(() => require('./features/documentFeatures'))).register(connection, documents, documentServiceHost);
96
96
  for (const plugin of plugins) {
97
- (_b = (_a = plugin.documentService) === null || _a === void 0 ? void 0 : _a.onInitialize) === null || _b === void 0 ? void 0 : _b.call(_a, connection);
97
+ (_b = (_a = plugin.syntacticService) === null || _a === void 0 ? void 0 : _a.onInitialize) === null || _b === void 0 ? void 0 : _b.call(_a, connection);
98
98
  }
99
99
  });
100
100
  }
@@ -113,7 +113,7 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
113
113
  (yield Promise.resolve().then(() => require('./features/customFeatures'))).register(connection, projects);
114
114
  (yield Promise.resolve().then(() => require('./features/languageFeatures'))).register(connection, projects, params, cancelTokenHost);
115
115
  for (const plugin of plugins) {
116
- (_b = (_a = plugin.languageService) === null || _a === void 0 ? void 0 : _a.onInitialize) === null || _b === void 0 ? void 0 : _b.call(_a, connection, getLanguageService);
116
+ (_b = (_a = plugin.semanticService) === null || _a === void 0 ? void 0 : _a.onInitialize) === null || _b === void 0 ? void 0 : _b.call(_a, connection, getLanguageService);
117
117
  }
118
118
  function getLanguageService(uri) {
119
119
  var _a;
package/out/types.d.ts CHANGED
@@ -26,14 +26,14 @@ export interface RuntimeEnvironment {
26
26
  }
27
27
  export type LanguageServerPlugin<A extends LanguageServerInitializationOptions = LanguageServerInitializationOptions, B extends embedded.LanguageServiceHost = embedded.LanguageServiceHost, C = embeddedLS.LanguageService> = (initOptions: A) => {
28
28
  extraFileExtensions: ts.FileExtensionInfo[];
29
- languageService?: {
29
+ semanticService?: {
30
30
  semanticTokenLegend?: vscode.SemanticTokensLegend;
31
31
  resolveLanguageServiceHost?(ts: typeof import('typescript/lib/tsserverlibrary'), sys: FileSystem, tsConfig: string | ts.CompilerOptions, host: embedded.LanguageServiceHost): B;
32
32
  getLanguageModules?(host: B): embedded.EmbeddedLanguageModule[];
33
33
  getServicePlugins?(host: B, service: embeddedLS.LanguageService): embeddedLS.LanguageServicePlugin[];
34
34
  onInitialize?(connection: vscode.Connection, getLangaugeService: (uri: string) => Promise<C>): void;
35
35
  };
36
- documentService?: {
36
+ syntacticService?: {
37
37
  getLanguageModules?(ts: typeof import('typescript/lib/tsserverlibrary'), env: embeddedLS.LanguageServicePluginContext['env']): embedded.EmbeddedLanguageModule[];
38
38
  getServicePlugins?(context: embeddedLS.DocumentServiceRuntimeContext): embeddedLS.LanguageServicePlugin[];
39
39
  onInitialize?(connection: vscode.Connection): void;
@@ -35,12 +35,12 @@ function createDocumentServiceHost(runtimeEnv, plugins, ts, configHost) {
35
35
  ts,
36
36
  env,
37
37
  getLanguageModules() {
38
- return plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.documentService) === null || _a === void 0 ? void 0 : _a.getLanguageModules) === null || _b === void 0 ? void 0 : _b.call(_a, ts, env)) !== null && _c !== void 0 ? _c : []; }).flat();
38
+ return plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.syntacticService) === null || _a === void 0 ? void 0 : _a.getLanguageModules) === null || _b === void 0 ? void 0 : _b.call(_a, ts, env)) !== null && _c !== void 0 ? _c : []; }).flat();
39
39
  },
40
40
  getPlugins() {
41
41
  return [
42
42
  ...(0, config_1.loadCustomPlugins)(rootUri.fsPath),
43
- ...plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.documentService) === null || _a === void 0 ? void 0 : _a.getServicePlugins) === null || _b === void 0 ? void 0 : _b.call(_a, serviceContext)) !== null && _c !== void 0 ? _c : []; }).flat(),
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
  },
46
46
  });
@@ -41,7 +41,7 @@ function createProject(runtimeEnv, plugins, fsHost, ts, rootUri, tsConfig, tsLoc
41
41
  };
42
42
  function getLanguageService() {
43
43
  if (!vueLs) {
44
- const languageModules = plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.languageService) === null || _a === void 0 ? void 0 : _a.getLanguageModules) === null || _b === void 0 ? void 0 : _b.call(_a, languageServiceHost)) !== null && _c !== void 0 ? _c : []; }).flat();
44
+ const languageModules = plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.semanticService) === null || _a === void 0 ? void 0 : _a.getLanguageModules) === null || _b === void 0 ? void 0 : _b.call(_a, languageServiceHost)) !== null && _c !== void 0 ? _c : []; }).flat();
45
45
  const languageContext = embedded.createEmbeddedLanguageServiceHost(languageServiceHost, languageModules);
46
46
  const languageServiceContext = embeddedLS.createLanguageServiceContext({
47
47
  host: languageServiceHost,
@@ -49,7 +49,7 @@ function createProject(runtimeEnv, plugins, fsHost, ts, rootUri, tsConfig, tsLoc
49
49
  getPlugins() {
50
50
  return [
51
51
  ...(0, config_1.loadCustomPlugins)(languageServiceHost.getCurrentDirectory()),
52
- ...plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.languageService) === null || _a === void 0 ? void 0 : _a.getServicePlugins) === null || _b === void 0 ? void 0 : _b.call(_a, languageServiceHost, vueLs)) !== null && _c !== void 0 ? _c : []; }).flat(),
52
+ ...plugins.map(plugin => { var _a, _b, _c; return (_c = (_b = (_a = plugin.semanticService) === null || _a === void 0 ? void 0 : _a.getServicePlugins) === null || _b === void 0 ? void 0 : _b.call(_a, languageServiceHost, vueLs)) !== null && _c !== void 0 ? _c : []; }).flat(),
53
53
  ];
54
54
  },
55
55
  env: {
@@ -142,8 +142,8 @@ function createProject(runtimeEnv, plugins, fsHost, ts, rootUri, tsConfig, tsLoc
142
142
  host.getLocalizedDiagnosticMessages = () => tsLocalized;
143
143
  }
144
144
  for (const plugin of plugins) {
145
- if ((_a = plugin.languageService) === null || _a === void 0 ? void 0 : _a.resolveLanguageServiceHost) {
146
- host = plugin.languageService.resolveLanguageServiceHost(ts, sys, tsConfig, host);
145
+ if ((_a = plugin.semanticService) === null || _a === void 0 ? void 0 : _a.resolveLanguageServiceHost) {
146
+ host = plugin.semanticService.resolveLanguageServiceHost(ts, sys, tsConfig, host);
147
147
  }
148
148
  }
149
149
  return host;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-server",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.0-rc.2",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -17,16 +17,16 @@
17
17
  "directory": "packages/language-server"
18
18
  },
19
19
  "dependencies": {
20
- "@volar/language-core": "1.0.0-beta.8",
21
- "@volar/language-service": "1.0.0-beta.8",
22
- "@volar/shared": "1.0.0-beta.8",
20
+ "@volar/language-core": "1.0.0-rc.2",
21
+ "@volar/language-service": "1.0.0-rc.2",
22
+ "@volar/shared": "1.0.0-rc.2",
23
23
  "request-light": "^0.5.8",
24
- "typesafe-path": "^0.2.0",
24
+ "typesafe-path": "^0.2.1",
25
25
  "vscode-html-languageservice": "^5.0.1",
26
26
  "vscode-languageserver": "^8.0.2",
27
27
  "vscode-languageserver-protocol": "^3.17.2",
28
28
  "vscode-languageserver-textdocument": "^1.0.7",
29
29
  "vscode-uri": "^3.0.3"
30
30
  },
31
- "gitHead": "7c437b60144d4160410eb96e644e09665daeee6d"
31
+ "gitHead": "f963241a38a0cc51ee8ff2a6aaa5a025e19fdfcb"
32
32
  }