astro-vscode 2.15.4 → 2.16.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/package.json CHANGED
@@ -24,22 +24,21 @@
24
24
  "color": "#17191E",
25
25
  "theme": "dark"
26
26
  },
27
- "version": "2.15.4",
27
+ "version": "2.16.0",
28
28
  "author": "withastro",
29
29
  "license": "MIT",
30
30
  "publisher": "astro-build",
31
31
  "engines": {
32
- "vscode": "^1.82.0"
32
+ "vscode": "^1.90.0"
33
33
  },
34
34
  "activationEvents": [
35
- "onLanguage:astro",
36
35
  "workspaceContains:astro.config.*"
37
36
  ],
38
37
  "main": "./dist/node/client.js",
39
38
  "repository": {
40
39
  "type": "git",
41
- "url": "https://github.com/withastro/language-tools.git",
42
- "directory": "packages/vscode"
40
+ "url": "https://github.com/withastro/astro.git",
41
+ "directory": "packages/language-tools/vscode"
43
42
  },
44
43
  "contributes": {
45
44
  "snippets": [
@@ -149,6 +148,12 @@
149
148
  "default": false,
150
149
  "description": "Enable experimental support for content collection intellisense inside Markdown, MDX and Markdoc. Note that this require also enabling the feature in your Astro config (experimental.contentCollectionIntellisense) (Astro 4.14+)"
151
150
  },
151
+ "astro.auto-import-cache.enabled": {
152
+ "scope": "resource",
153
+ "type": "boolean",
154
+ "default": true,
155
+ "markdownDescription": "Enable the auto import cache. Yields a faster intellisense when automatically importing a file, but can cause issues with new files not being detected. Change is applied on restart. See [#1035](https://github.com/withastro/language-tools/issues/1035)."
156
+ },
152
157
  "astro.updateImportsOnFileMove.enabled": {
153
158
  "scope": "resource",
154
159
  "type": "boolean",
@@ -230,19 +235,19 @@
230
235
  ]
231
236
  },
232
237
  "devDependencies": {
233
- "@astrojs/language-server": "^2.15.4",
234
- "@astrojs/ts-plugin": "^1.10.4",
238
+ "@astrojs/language-server": "^2.16.0",
239
+ "@astrojs/ts-plugin": "^1.10.5",
235
240
  "@types/glob": "^8.1.0",
236
241
  "@types/mocha": "^10.0.1",
237
- "@types/node": "^18.17.8",
242
+ "@types/node": "^20.9.0",
238
243
  "@types/vscode": "^1.82.0",
239
- "@volar/language-server": "~2.4.7",
240
- "@volar/vscode": "~2.4.7",
241
- "@vscode/test-electron": "^2.3.2",
244
+ "@volar/language-server": "~2.4.23",
245
+ "@volar/vscode": "~2.4.23",
246
+ "@vscode/test-electron": "^2.5.2",
247
+ "@vscode/test-cli": "^0.0.12",
242
248
  "@vscode/vsce": "2.30.0",
243
249
  "esbuild": "^0.17.19",
244
250
  "esbuild-plugin-copy": "^2.1.1",
245
- "glob": "^8.0.3",
246
251
  "js-yaml": "^4.1.0",
247
252
  "kleur": "^4.1.5",
248
253
  "mocha": "^10.2.0",
@@ -251,7 +256,7 @@
251
256
  },
252
257
  "dependencies": {
253
258
  "@astrojs/compiler": "^2.10.3",
254
- "prettier": "^3.2.5",
259
+ "prettier": "^3.6.2",
255
260
  "prettier-plugin-astro": "^0.14.1"
256
261
  },
257
262
  "scripts": {
@@ -261,7 +266,7 @@
261
266
  "build:grammar": "node scripts/build-grammar.mjs",
262
267
  "dev:grammar": "node scripts/build-grammar.mjs -- --watch",
263
268
  "test": "pnpm test:vscode && pnpm test:grammar",
264
- "test:vscode": "node ./test/runTest.js",
269
+ "test:vscode": "vscode-test",
265
270
  "test:grammar": "pnpm build:grammar && node ./test/grammar/test.mjs",
266
271
  "update-grammar-snapshots": "node ./test/grammar/test.mjs --updateSnapshot"
267
272
  }
package/src/client.ts CHANGED
@@ -66,11 +66,16 @@ export async function activate(context: vscode.ExtensionContext): Promise<LabsIn
66
66
  const hasContentIntellisense = vscode.workspace
67
67
  .getConfiguration('astro')
68
68
  .get('content-intellisense');
69
+
70
+ const shouldDisableAutoImportCache =
71
+ vscode.workspace.getConfiguration('astro').get('auto-import-cache.enabled') === false;
72
+
69
73
  const initializationOptions = {
70
74
  typescript: {
71
75
  tsdk: (await getTsdk(context))!.tsdk,
72
76
  },
73
77
  contentIntellisense: hasContentIntellisense,
78
+ disableAutoImportCache: shouldDisableAutoImportCache,
74
79
  } satisfies InitOptions;
75
80
 
76
81
  const clientOptions = {
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "name": "Astro",
3
3
  "scopeName": "source.astro",
4
- "fileTypes": [
5
- "astro"
6
- ],
4
+ "fileTypes": ["astro"],
7
5
  "injections": {
8
6
  "L:(meta.script.astro) (meta.lang.json) - (meta source)": {
9
7
  "patterns": [
@@ -843,4 +841,4 @@
843
841
  ]
844
842
  }
845
843
  }
846
- }
844
+ }
@@ -58,4 +58,4 @@
58
58
  ]
59
59
  }
60
60
  }
61
- }
61
+ }
@@ -1,4 +1,4 @@
1
- const assert = require('assert');
1
+ const assert = require('node:assert');
2
2
  const vscode = require('vscode');
3
3
 
4
4
  suite('Extension Test Suite', () => {
@@ -1,7 +1,7 @@
1
- import { spawn } from 'child_process';
2
- import { readdirSync } from 'fs';
3
- import { dirname, join, resolve } from 'path';
4
- import { fileURLToPath } from 'url';
1
+ import { spawn } from 'node:child_process';
2
+ import { readdirSync } from 'node:fs';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
5
 
6
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
7
 
package/tsconfig.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
2
+ "extends": "../tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "dist",
5
- "rootDir": "src",
6
- "emitDeclarationOnly": true
5
+ "emitDeclarationOnly": true,
6
+ "checkJs": true
7
7
  },
8
- "include": ["src"]
8
+ "include": ["src", ".vscode-test.js"]
9
9
  }
package/test/runTest.js DELETED
@@ -1,27 +0,0 @@
1
- const path = require('path');
2
- const { runTests } = require('@vscode/test-electron');
3
-
4
- async function main() {
5
- // NOTE: Those tests are very flaky on Windows and macOS, so we'll skip them for now
6
- if (process.platform === 'win32' || process.platform === 'darwin') {
7
- process.exit(0);
8
- }
9
-
10
- try {
11
- // The folder containing the Extension Manifest package.json
12
- // Passed to `--extensionDevelopmentPath`
13
- const extensionDevelopmentPath = path.resolve(__dirname, '../');
14
-
15
- // The path to the extension test script
16
- // Passed to --extensionTestsPath
17
- const extensionTestsPath = path.resolve(__dirname, './suite/index.js');
18
-
19
- // Download VS Code, unzip it and run the integration test
20
- await runTests({ extensionDevelopmentPath, extensionTestsPath });
21
- } catch {
22
- console.error('Failed to run tests');
23
- process.exit(1);
24
- }
25
- }
26
-
27
- main();
@@ -1,40 +0,0 @@
1
- const path = require('path');
2
- const Mocha = require('mocha');
3
- const glob = require('glob');
4
-
5
- exports.run = function () {
6
- // Create the mocha test
7
- const mocha = new Mocha({
8
- ui: 'tdd',
9
- color: true,
10
- });
11
-
12
- const testsRoot = path.resolve(__dirname, '..');
13
-
14
- return /** @type {Promise<void>} */ (
15
- new Promise((c, e) => {
16
- glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
17
- if (err) {
18
- return e(err);
19
- }
20
-
21
- // Add files to the test suite
22
- files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
23
-
24
- try {
25
- // Run the mocha test
26
- mocha.run((failures) => {
27
- if (failures > 0) {
28
- e(new Error(`${failures} tests failed.`));
29
- } else {
30
- c();
31
- }
32
- });
33
- // eslint-disable-next-line @typescript-eslint/no-shadow
34
- } catch (err) {
35
- e(err);
36
- }
37
- });
38
- })
39
- );
40
- };
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "../tsconfig.json",
3
- "compilerOptions": {
4
- "module": "ES2020",
5
- "target": "ES2020",
6
- "moduleResolution": "node",
7
- "allowJs": true,
8
- "checkJs": true,
9
- "rootDir": ".",
10
- "emitDeclarationOnly": false,
11
- "noEmit": true
12
- },
13
- "include": ["**/*.js", "grammar/test.mjs"]
14
- }
File without changes