@astrojs/language-server 2.8.4 → 2.9.0

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/dist/check.js CHANGED
@@ -56,7 +56,9 @@ class AstroCheck {
56
56
  * @return {CheckResult} The result of the lint, including a list of errors, the file's content and its file path.
57
57
  */
58
58
  async lint({ fileNames = undefined, cancel = () => false, logErrors = undefined, }) {
59
- let files = (fileNames !== undefined ? fileNames : this.linter.languageHost.getScriptFileNames()).filter((file) => {
59
+ let files = (fileNames !== undefined
60
+ ? fileNames
61
+ : this.linter.language.typescript.projectHost.getScriptFileNames()).filter((file) => {
60
62
  // We don't have the same understanding of Svelte and Vue files as their own respective tools (vue-tsc, svelte-check)
61
63
  // So we don't want to check them here
62
64
  return !file.endsWith('.vue') && !file.endsWith('.svelte');
@@ -92,7 +94,7 @@ class AstroCheck {
92
94
  if (logErrors !== undefined && errorText) {
93
95
  console.info(errorText);
94
96
  }
95
- const fileSnapshot = this.linter.languageHost.getScriptSnapshot(file);
97
+ const fileSnapshot = this.linter.language.typescript.projectHost.getScriptSnapshot(file);
96
98
  const fileContent = fileSnapshot?.getText(0, fileSnapshot.getLength());
97
99
  result.fileResult.push({
98
100
  errors: fileDiagnostics,
@@ -35,21 +35,26 @@ const parseHTML_1 = require("./parseHTML");
35
35
  const parseJS_js_1 = require("./parseJS.js");
36
36
  function getLanguageModule(astroInstall, ts) {
37
37
  return {
38
- createVirtualCode(fileId, languageId, snapshot) {
38
+ getLanguageId(scriptId) {
39
+ if (scriptId.endsWith('.astro')) {
40
+ return 'astro';
41
+ }
42
+ },
43
+ createVirtualCode(scriptId, languageId, snapshot) {
39
44
  if (languageId === 'astro') {
40
- const fileName = fileId.includes('://')
41
- ? vscode_uri_1.URI.parse(fileId).fsPath.replace(/\\/g, '/')
42
- : fileId;
45
+ const fileName = scriptId.includes('://')
46
+ ? vscode_uri_1.URI.parse(scriptId).fsPath.replace(/\\/g, '/')
47
+ : scriptId;
43
48
  return new AstroVirtualCode(fileName, snapshot);
44
49
  }
45
50
  },
46
- updateVirtualCode(_fileId, astroCode, snapshot) {
51
+ updateVirtualCode(_scriptId, astroCode, snapshot) {
47
52
  astroCode.update(snapshot);
48
53
  return astroCode;
49
54
  },
50
55
  typescript: {
51
56
  extraFileExtensions: [{ extension: 'astro', isMixedContent: true, scriptKind: 7 }],
52
- getScript(astroCode) {
57
+ getServiceScript(astroCode) {
53
58
  for (const code of (0, language_core_1.forEachEmbeddedCode)(astroCode)) {
54
59
  if (code.id === 'tsx') {
55
60
  return {
@@ -61,7 +66,7 @@ function getLanguageModule(astroInstall, ts) {
61
66
  }
62
67
  return undefined;
63
68
  },
64
- getExtraScripts(fileName, astroCode) {
69
+ getExtraServiceScripts(fileName, astroCode) {
65
70
  const result = [];
66
71
  for (const code of (0, language_core_1.forEachEmbeddedCode)(astroCode)) {
67
72
  if (code.id.endsWith('.mjs') || code.id.endsWith('.mts')) {
@@ -6,21 +6,26 @@ const vscode_uri_1 = require("vscode-uri");
6
6
  const utils_js_1 = require("./utils.js");
7
7
  function getSvelteLanguageModule() {
8
8
  return {
9
- createVirtualCode(fileId, languageId, snapshot) {
9
+ getLanguageId(scriptId) {
10
+ if (scriptId.endsWith('.svelte')) {
11
+ return 'svelte';
12
+ }
13
+ },
14
+ createVirtualCode(scriptId, languageId, snapshot) {
10
15
  if (languageId === 'svelte') {
11
- const fileName = fileId.includes('://')
12
- ? vscode_uri_1.URI.parse(fileId).fsPath.replace(/\\/g, '/')
13
- : fileId;
16
+ const fileName = scriptId.includes('://')
17
+ ? vscode_uri_1.URI.parse(scriptId).fsPath.replace(/\\/g, '/')
18
+ : scriptId;
14
19
  return new SvelteVirtualCode(fileName, snapshot);
15
20
  }
16
21
  },
17
- updateVirtualCode(_fileId, svelteCode, snapshot) {
22
+ updateVirtualCode(_scriptId, svelteCode, snapshot) {
18
23
  svelteCode.update(snapshot);
19
24
  return svelteCode;
20
25
  },
21
26
  typescript: {
22
27
  extraFileExtensions: [{ extension: 'svelte', isMixedContent: true, scriptKind: 7 }],
23
- getScript(svelteCode) {
28
+ getServiceScript(svelteCode) {
24
29
  for (const code of (0, language_core_1.forEachEmbeddedCode)(svelteCode)) {
25
30
  if (code.id === 'tsx') {
26
31
  return {
package/dist/core/vue.js CHANGED
@@ -6,21 +6,26 @@ const vscode_uri_1 = require("vscode-uri");
6
6
  const utils_js_1 = require("./utils.js");
7
7
  function getVueLanguageModule() {
8
8
  return {
9
- createVirtualCode(fileId, languageId, snapshot) {
9
+ getLanguageId(scriptId) {
10
+ if (scriptId.endsWith('.vue')) {
11
+ return 'vue';
12
+ }
13
+ },
14
+ createVirtualCode(scriptId, languageId, snapshot) {
10
15
  if (languageId === 'vue') {
11
- const fileName = fileId.includes('://')
12
- ? vscode_uri_1.URI.parse(fileId).fsPath.replace(/\\/g, '/')
13
- : fileId;
16
+ const fileName = scriptId.includes('://')
17
+ ? vscode_uri_1.URI.parse(scriptId).fsPath.replace(/\\/g, '/')
18
+ : scriptId;
14
19
  return new VueVirtualCode(fileName, snapshot);
15
20
  }
16
21
  },
17
- updateVirtualCode(_fileId, vueCode, snapshot) {
22
+ updateVirtualCode(_scriptId, vueCode, snapshot) {
18
23
  vueCode.update(snapshot);
19
24
  return vueCode;
20
25
  },
21
26
  typescript: {
22
27
  extraFileExtensions: [{ extension: 'vue', isMixedContent: true, scriptKind: 7 }],
23
- getScript(vueCode) {
28
+ getServiceScript(vueCode) {
24
29
  for (const code of (0, language_core_1.forEachEmbeddedCode)(vueCode)) {
25
30
  if (code.id === 'tsx') {
26
31
  return {
@@ -1,3 +1,3 @@
1
- import { Connection } from '@volar/language-server/node';
2
- import type { ServerOptions } from '@volar/language-server/lib/server.js';
3
- export declare function createServerOptions(connection: Connection, ts: typeof import('typescript')): ServerOptions;
1
+ import { Connection, LanguagePlugin, ServiceEnvironment, VirtualCode } from '@volar/language-server/node';
2
+ export declare function getLanguagePlugins(connection: Connection, ts: typeof import('typescript'), serviceEnv: ServiceEnvironment, tsconfig: string | undefined): LanguagePlugin<VirtualCode>[];
3
+ export declare function getLanguageServicePlugins(connection: Connection, ts: typeof import('typescript')): import("@volar/language-server/node").LanguageServicePlugin<any>[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createServerOptions = void 0;
3
+ exports.getLanguageServicePlugins = exports.getLanguagePlugins = void 0;
4
4
  const node_1 = require("@volar/language-server/node");
5
5
  const vscode_uri_1 = require("vscode-uri");
6
6
  const core_1 = require("./core");
@@ -17,59 +17,40 @@ const astro_js_1 = require("./plugins/astro.js");
17
17
  const html_js_1 = require("./plugins/html.js");
18
18
  const index_js_1 = require("./plugins/typescript-addons/index.js");
19
19
  const index_js_2 = require("./plugins/typescript/index.js");
20
- function createServerOptions(connection, ts) {
21
- return {
22
- watchFileExtensions: [
23
- 'js',
24
- 'cjs',
25
- 'mjs',
26
- 'ts',
27
- 'cts',
28
- 'mts',
29
- 'jsx',
30
- 'tsx',
31
- 'json',
32
- 'astro',
33
- 'vue',
34
- 'svelte',
35
- ],
36
- getServicePlugins() {
37
- return [
38
- (0, html_js_1.create)(),
39
- (0, volar_service_css_1.create)(),
40
- (0, volar_service_emmet_1.create)(),
41
- ...(0, index_js_2.create)(ts),
42
- (0, volar_service_typescript_twoslash_queries_1.create)(ts),
43
- (0, index_js_1.create)(),
44
- (0, astro_js_1.create)(ts),
45
- getPrettierService(),
46
- ];
47
- },
48
- getLanguagePlugins(serviceEnv, projectContext) {
49
- const languagePlugins = [
50
- (0, vue_js_1.getVueLanguageModule)(),
51
- (0, svelte_js_1.getSvelteLanguageModule)(),
52
- ];
53
- if (projectContext.typescript) {
54
- const rootPath = projectContext.typescript.configFileName
55
- ? projectContext.typescript.configFileName.split('/').slice(0, -1).join('/')
56
- : serviceEnv.typescript.uriToFileName(serviceEnv.workspaceFolder);
57
- const nearestPackageJson = ts.findConfigFile(rootPath, ts.sys.fileExists, 'package.json');
58
- const astroInstall = (0, utils_js_1.getAstroInstall)([rootPath], {
59
- nearestPackageJson: nearestPackageJson,
60
- readDirectory: ts.sys.readDirectory,
61
- });
62
- if (astroInstall === 'not-found') {
63
- connection.sendNotification(node_1.ShowMessageNotification.type, {
64
- message: `Couldn't find Astro in workspace "${rootPath}". Experience might be degraded. For the best experience, please make sure Astro is installed into your project and restart the language server.`,
65
- type: node_1.MessageType.Warning,
66
- });
67
- }
68
- languagePlugins.unshift((0, core_1.getLanguageModule)(typeof astroInstall === 'string' ? undefined : astroInstall, ts));
69
- }
70
- return languagePlugins;
71
- },
72
- };
20
+ function getLanguagePlugins(connection, ts, serviceEnv, tsconfig) {
21
+ const languagePlugins = [
22
+ (0, vue_js_1.getVueLanguageModule)(),
23
+ (0, svelte_js_1.getSvelteLanguageModule)(),
24
+ ];
25
+ const rootPath = tsconfig
26
+ ? tsconfig.split('/').slice(0, -1).join('/')
27
+ : serviceEnv.typescript.uriToFileName(serviceEnv.workspaceFolder);
28
+ const nearestPackageJson = ts.findConfigFile(rootPath, ts.sys.fileExists, 'package.json');
29
+ const astroInstall = (0, utils_js_1.getAstroInstall)([rootPath], {
30
+ nearestPackageJson: nearestPackageJson,
31
+ readDirectory: ts.sys.readDirectory,
32
+ });
33
+ if (astroInstall === 'not-found') {
34
+ connection.sendNotification(node_1.ShowMessageNotification.type, {
35
+ message: `Couldn't find Astro in workspace "${rootPath}". Experience might be degraded. For the best experience, please make sure Astro is installed into your project and restart the language server.`,
36
+ type: node_1.MessageType.Warning,
37
+ });
38
+ }
39
+ languagePlugins.unshift((0, core_1.getLanguageModule)(typeof astroInstall === 'string' ? undefined : astroInstall, ts));
40
+ return languagePlugins;
41
+ }
42
+ exports.getLanguagePlugins = getLanguagePlugins;
43
+ function getLanguageServicePlugins(connection, ts) {
44
+ return [
45
+ (0, html_js_1.create)(),
46
+ (0, volar_service_css_1.create)(),
47
+ (0, volar_service_emmet_1.create)(),
48
+ ...(0, index_js_2.create)(ts),
49
+ (0, volar_service_typescript_twoslash_queries_1.create)(ts),
50
+ (0, index_js_1.create)(),
51
+ (0, astro_js_1.create)(ts),
52
+ getPrettierService(),
53
+ ];
73
54
  function getPrettierService() {
74
55
  let prettier;
75
56
  let prettierPluginPath;
@@ -91,7 +72,11 @@ function createServerOptions(connection, ts) {
91
72
  }, {
92
73
  documentSelector: ['astro'],
93
74
  getFormattingOptions: async (prettierInstance, document, formatOptions, context) => {
94
- const filePath = vscode_uri_1.URI.parse(document.uri).fsPath;
75
+ const documentUri = context.decodeEmbeddedDocumentUri(document.uri)?.[0] ?? document.uri;
76
+ const filePath = vscode_uri_1.URI.parse(documentUri).fsPath;
77
+ if (!filePath) {
78
+ return {};
79
+ }
95
80
  let configOptions = null;
96
81
  try {
97
82
  configOptions = await prettierInstance.resolveConfig(filePath, {
@@ -136,5 +121,5 @@ function createServerOptions(connection, ts) {
136
121
  });
137
122
  }
138
123
  }
139
- exports.createServerOptions = createServerOptions;
124
+ exports.getLanguageServicePlugins = getLanguageServicePlugins;
140
125
  //# sourceMappingURL=languageServerPlugin.js.map
@@ -11,9 +11,25 @@ connection.onInitialize((params) => {
11
11
  throw new Error('The `typescript.tsdk` init option is required. It should point to a directory containing a `typescript.js` or `tsserverlibrary.js` file, such as `node_modules/typescript/lib`.');
12
12
  }
13
13
  const { typescript, diagnosticMessages } = (0, node_1.loadTsdkByPath)(tsdk, params.locale);
14
- return server.initialize(params, (0, node_1.createTypeScriptProjectProviderFactory)(typescript, diagnosticMessages), (0, languageServerPlugin_js_1.createServerOptions)(connection, typescript));
14
+ return server.initialize(params, (0, languageServerPlugin_js_1.getLanguageServicePlugins)(connection, typescript), (0, node_1.createTypeScriptProjectProvider)(typescript, diagnosticMessages, (env, project) => (0, languageServerPlugin_js_1.getLanguagePlugins)(connection, typescript, env, project.configFileName)));
15
15
  });
16
16
  connection.onInitialized(() => {
17
17
  server.initialized();
18
+ server.watchFiles([
19
+ `**/*.{${[
20
+ 'js',
21
+ 'cjs',
22
+ 'mjs',
23
+ 'ts',
24
+ 'cts',
25
+ 'mts',
26
+ 'jsx',
27
+ 'tsx',
28
+ 'json',
29
+ 'astro',
30
+ 'vue',
31
+ 'svelte',
32
+ ].join(',')}}`,
33
+ ]);
18
34
  });
19
35
  //# sourceMappingURL=nodeServer.js.map
@@ -1,2 +1,2 @@
1
- import { ServicePlugin } from '@volar/language-server';
2
- export declare const create: (ts: typeof import('typescript')) => ServicePlugin;
1
+ import { LanguageServicePlugin } from '@volar/language-server';
2
+ export declare const create: (ts: typeof import('typescript')) => LanguageServicePlugin;
@@ -18,11 +18,13 @@ const create = (ts) => {
18
18
  if (token.isCancellationRequested)
19
19
  return null;
20
20
  let items = [];
21
- const [file] = context.documents.getVirtualCodeByUri(document.uri);
22
- if (!(file instanceof index_js_1.AstroVirtualCode))
21
+ const decoded = context.decodeEmbeddedDocumentUri(document.uri);
22
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
23
+ const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
24
+ if (!(virtualCode instanceof index_js_1.AstroVirtualCode))
23
25
  return;
24
26
  if (completionContext.triggerCharacter === '-') {
25
- const frontmatterCompletion = getFrontmatterCompletion(file, document, position);
27
+ const frontmatterCompletion = getFrontmatterCompletion(virtualCode, document, position);
26
28
  if (frontmatterCompletion)
27
29
  items.push(frontmatterCompletion);
28
30
  }
@@ -34,10 +36,12 @@ const create = (ts) => {
34
36
  provideSemanticDiagnostics(document, token) {
35
37
  if (token.isCancellationRequested)
36
38
  return [];
37
- const [file] = context.documents.getVirtualCodeByUri(document.uri);
38
- if (!(file instanceof index_js_1.AstroVirtualCode))
39
+ const decoded = context.decodeEmbeddedDocumentUri(document.uri);
40
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
41
+ const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
42
+ if (!(virtualCode instanceof index_js_1.AstroVirtualCode))
39
43
  return;
40
- return file.compilerDiagnostics.map(compilerMessageToDiagnostic);
44
+ return virtualCode.compilerDiagnostics.map(compilerMessageToDiagnostic);
41
45
  function compilerMessageToDiagnostic(message) {
42
46
  const start = language_server_1.Position.create(message.location.line - 1, message.location.column - 1);
43
47
  const end = document.positionAt(document.offsetAt(start) + message.location.length);
@@ -1,2 +1,2 @@
1
- import { ServicePlugin } from '@volar/language-server';
2
- export declare const create: () => ServicePlugin;
1
+ import { LanguageServicePlugin } from '@volar/language-server';
2
+ export declare const create: () => LanguageServicePlugin;
@@ -61,12 +61,13 @@ const create = () => {
61
61
  async provideCompletionItems(document, position, completionContext, token) {
62
62
  if (document.languageId !== 'html')
63
63
  return;
64
- const [_, source] = context.documents.getVirtualCodeByUri(document.uri);
65
- const code = source?.generated?.code;
66
- if (!(code instanceof index_js_1.AstroVirtualCode))
64
+ const decoded = context.decodeEmbeddedDocumentUri(document.uri);
65
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
66
+ const root = sourceScript?.generated?.root;
67
+ if (!(root instanceof index_js_1.AstroVirtualCode))
67
68
  return;
68
69
  // Don't return completions if the current node is a component
69
- if ((0, utils_js_1.isInComponentStartTag)(code.htmlDocument, document.offsetAt(position))) {
70
+ if ((0, utils_js_1.isInComponentStartTag)(root.htmlDocument, document.offsetAt(position))) {
70
71
  return null;
71
72
  }
72
73
  const completions = await htmlPlugin.provideCompletionItems(document, position, completionContext, token);
@@ -22,11 +22,13 @@ function mapCodeAction(codeAction, context) {
22
22
  return codeAction;
23
23
  codeAction.edit.documentChanges = codeAction.edit.documentChanges.map((change) => {
24
24
  if (language_server_1.TextDocumentEdit.is(change)) {
25
- const [virtualFile, source] = context.documents.getVirtualCodeByUri(change.textDocument.uri);
26
- const code = source?.generated?.code;
27
- if (!virtualFile || !(code instanceof index_js_1.AstroVirtualCode))
25
+ const decoded = context.decodeEmbeddedDocumentUri(change.textDocument.uri);
26
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
27
+ const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
28
+ const root = sourceScript?.generated?.root;
29
+ if (!virtualCode || !(root instanceof index_js_1.AstroVirtualCode))
28
30
  return change;
29
- change.edits = change.edits.map((edit) => (0, utils_js_1.mapEdit)(edit, code, virtualFile.languageId));
31
+ change.edits = change.edits.map((edit) => (0, utils_js_1.mapEdit)(edit, root, virtualCode.languageId));
30
32
  }
31
33
  return change;
32
34
  });
@@ -31,11 +31,13 @@ function enhancedResolveCompletionItem(resolvedCompletion, context) {
31
31
  resolvedCompletion.detail = getDetailForFileCompletion(resolvedCompletion.detail ?? '', resolvedCompletion.data.originalItem.source);
32
32
  }
33
33
  if (resolvedCompletion.additionalTextEdits) {
34
- const [virtualFile, source] = context.documents.getVirtualCodeByUri(resolvedCompletion.data.uri);
35
- const code = source?.generated?.code;
36
- if (!virtualFile || !(code instanceof index_js_1.AstroVirtualCode))
34
+ const decoded = context.decodeEmbeddedDocumentUri(resolvedCompletion.data.uri);
35
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
36
+ const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
37
+ const root = sourceScript?.generated?.root;
38
+ if (!virtualCode || !(root instanceof index_js_1.AstroVirtualCode))
37
39
  return resolvedCompletion;
38
- resolvedCompletion.additionalTextEdits = resolvedCompletion.additionalTextEdits.map((edit) => (0, utils_js_1.mapEdit)(edit, code, virtualFile.languageId));
40
+ resolvedCompletion.additionalTextEdits = resolvedCompletion.additionalTextEdits.map((edit) => (0, utils_js_1.mapEdit)(edit, root, virtualCode.languageId));
39
41
  }
40
42
  return resolvedCompletion;
41
43
  }
@@ -1,2 +1,2 @@
1
- import type { ServicePlugin } from '@volar/language-server';
2
- export declare const create: (ts: typeof import('typescript')) => ServicePlugin[];
1
+ import type { LanguageServicePlugin } from '@volar/language-server';
2
+ export declare const create: (ts: typeof import('typescript')) => LanguageServicePlugin[];
@@ -41,15 +41,16 @@ const create = (ts) => {
41
41
  return (0, codeActions_js_1.enhancedResolveCodeAction)(resolvedCodeAction, context);
42
42
  },
43
43
  async provideSemanticDiagnostics(document, token) {
44
- const [_, source] = context.documents.getVirtualCodeByUri(document.uri);
45
- const code = source?.generated?.code;
44
+ const decoded = context.decodeEmbeddedDocumentUri(document.uri);
45
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
46
+ const root = sourceScript?.generated?.root;
46
47
  let tsxLineCount = undefined;
47
- if (code instanceof index_js_1.AstroVirtualCode) {
48
+ if (root instanceof index_js_1.AstroVirtualCode) {
48
49
  // If we have compiler errors, our TSX isn't valid so don't bother showing TS errors
49
- if (code.hasCompilationErrors)
50
+ if (root.hasCompilationErrors)
50
51
  return null;
51
52
  // We'll use this to filter out diagnostics that are outside the mapped range of the TSX
52
- tsxLineCount = code.astroMeta.tsxRanges.body.end.line;
53
+ tsxLineCount = root.astroMeta.tsxRanges.body.end.line;
53
54
  }
54
55
  const diagnostics = await typeScriptPlugin.provideSemanticDiagnostics(document, token);
55
56
  if (!diagnostics)
@@ -1,2 +1,2 @@
1
- import type { ServicePlugin } from '@volar/language-server';
2
- export declare const create: () => ServicePlugin;
1
+ import type { LanguageServicePlugin } from '@volar/language-server';
2
+ export declare const create: () => LanguageServicePlugin;
@@ -21,17 +21,18 @@ const create = () => {
21
21
  token.isCancellationRequested ||
22
22
  completionContext.triggerKind === 2)
23
23
  return null;
24
- const [_, source] = context.documents.getVirtualCodeByUri(document.uri);
25
- const code = source?.generated?.code;
26
- if (!(code instanceof index_js_1.AstroVirtualCode))
24
+ const decoded = context.decodeEmbeddedDocumentUri(document.uri);
25
+ const sourceScript = decoded && context.language.scripts.get(decoded[0]);
26
+ const root = sourceScript?.generated?.root;
27
+ if (!(root instanceof index_js_1.AstroVirtualCode))
27
28
  return undefined;
28
- if (!(0, utils_js_1.isInsideFrontmatter)(document.offsetAt(position), code.astroMeta.frontmatter))
29
+ if (!(0, utils_js_1.isInsideFrontmatter)(document.offsetAt(position), root.astroMeta.frontmatter))
29
30
  return null;
30
31
  const completionList = {
31
32
  items: [],
32
33
  isIncomplete: false,
33
34
  };
34
- completionList.items.push(...(0, snippets_js_1.getSnippetCompletions)(code.astroMeta.frontmatter));
35
+ completionList.items.push(...(0, snippets_js_1.getSnippetCompletions)(root.astroMeta.frontmatter));
35
36
  return completionList;
36
37
  },
37
38
  resolveCompletionItem(item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/language-server",
3
- "version": "2.8.4",
3
+ "version": "2.9.0",
4
4
  "author": "withastro",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,19 +22,19 @@
22
22
  "dependencies": {
23
23
  "@astrojs/compiler": "^2.7.0",
24
24
  "@jridgewell/sourcemap-codec": "^1.4.15",
25
- "@volar/kit": "~2.1.5",
26
- "@volar/language-core": "~2.1.5",
27
- "@volar/language-server": "~2.1.5",
28
- "@volar/language-service": "~2.1.5",
29
- "@volar/typescript": "~2.1.5",
25
+ "@volar/kit": "~2.2.1",
26
+ "@volar/language-core": "~2.2.1",
27
+ "@volar/language-server": "~2.2.1",
28
+ "@volar/language-service": "~2.2.1",
29
+ "@volar/typescript": "~2.2.1",
30
30
  "fast-glob": "^3.2.12",
31
- "volar-service-css": "0.0.34",
32
- "volar-service-emmet": "0.0.34",
33
- "volar-service-html": "0.0.34",
34
- "volar-service-prettier": "0.0.34",
35
- "volar-service-typescript": "0.0.34",
36
- "volar-service-typescript-twoslash-queries": "0.0.34",
37
- "vscode-html-languageservice": "^5.1.2",
31
+ "volar-service-css": "0.0.43",
32
+ "volar-service-emmet": "0.0.43",
33
+ "volar-service-html": "0.0.43",
34
+ "volar-service-prettier": "0.0.43",
35
+ "volar-service-typescript": "0.0.43",
36
+ "volar-service-typescript-twoslash-queries": "0.0.43",
37
+ "vscode-html-languageservice": "^5.2.0",
38
38
  "vscode-uri": "^3.0.8"
39
39
  },
40
40
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "@types/chai": "^4.3.5",
45
45
  "@types/mocha": "^10.0.1",
46
46
  "@types/node": "^18.17.8",
47
- "@volar/test-utils": "~2.1.5",
47
+ "@volar/test-utils": "~2.2.1",
48
48
  "astro": "^4.3.5",
49
49
  "chai": "^4.3.7",
50
50
  "mocha": "^10.2.0",