astro-vscode 2.15.4 → 2.16.1
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/.turbo/turbo-build.log +3 -3
- package/.vscode-test.js +13 -0
- package/CHANGELOG.md +22 -1
- package/README.md +1 -1
- package/dist/.vscode-test.d.ts +2 -0
- package/dist/node/client.js +26 -26
- package/dist/node/server.js +519 -544
- package/package.json +21 -15
- package/src/client.ts +5 -0
- package/syntaxes/astro.tmLanguage.json +2 -4
- package/syntaxes/mdx.astro.tmLanguage.json +1 -1
- package/test/{suite/extension.test.js → extension.test.js} +1 -1
- package/test/grammar/test.mjs +4 -4
- package/tsconfig.json +4 -4
- package/test/runTest.js +0 -27
- package/test/suite/index.js +0 -40
- package/test/tsconfig.json +0 -14
- /package/dist/{client.d.ts → src/client.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -24,22 +24,21 @@
|
|
|
24
24
|
"color": "#17191E",
|
|
25
25
|
"theme": "dark"
|
|
26
26
|
},
|
|
27
|
-
"version": "2.
|
|
27
|
+
"version": "2.16.1",
|
|
28
28
|
"author": "withastro",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"publisher": "astro-build",
|
|
31
31
|
"engines": {
|
|
32
|
-
"vscode": "^1.
|
|
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/
|
|
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": [
|
|
@@ -147,7 +146,13 @@
|
|
|
147
146
|
"scope": "resource",
|
|
148
147
|
"type": "boolean",
|
|
149
148
|
"default": false,
|
|
150
|
-
"description": "Enable experimental support for content collection intellisense inside Markdown, MDX and Markdoc. Note that this
|
|
149
|
+
"description": "Enable experimental support for content collection intellisense inside Markdown, MDX and Markdoc. Note that this requires also enabling the feature in your Astro config (experimental.contentIntellisense) (Astro 4.14+)"
|
|
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 [#14642](https://github.com/withastro/astro/issues/14642)."
|
|
151
156
|
},
|
|
152
157
|
"astro.updateImportsOnFileMove.enabled": {
|
|
153
158
|
"scope": "resource",
|
|
@@ -230,28 +235,29 @@
|
|
|
230
235
|
]
|
|
231
236
|
},
|
|
232
237
|
"devDependencies": {
|
|
233
|
-
"@astrojs/language-server": "^2.
|
|
234
|
-
"@astrojs/ts-plugin": "^1.10.
|
|
238
|
+
"@astrojs/language-server": "^2.16.1",
|
|
239
|
+
"@astrojs/ts-plugin": "^1.10.6",
|
|
235
240
|
"@types/glob": "^8.1.0",
|
|
236
241
|
"@types/mocha": "^10.0.1",
|
|
237
|
-
"@types/node": "^
|
|
242
|
+
"@types/node": "^20.9.0",
|
|
238
243
|
"@types/vscode": "^1.82.0",
|
|
239
|
-
"@volar/language-server": "~2.4.
|
|
240
|
-
"@volar/vscode": "~2.4.
|
|
241
|
-
"@vscode/test-electron": "^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",
|
|
254
|
+
"ovsx": "^0.10.6",
|
|
249
255
|
"vscode-languageclient": "^9.0.1",
|
|
250
256
|
"vscode-tmgrammar-test": "^0.1.2"
|
|
251
257
|
},
|
|
252
258
|
"dependencies": {
|
|
253
259
|
"@astrojs/compiler": "^2.10.3",
|
|
254
|
-
"prettier": "^3.2
|
|
260
|
+
"prettier": "^3.6.2",
|
|
255
261
|
"prettier-plugin-astro": "^0.14.1"
|
|
256
262
|
},
|
|
257
263
|
"scripts": {
|
|
@@ -261,7 +267,7 @@
|
|
|
261
267
|
"build:grammar": "node scripts/build-grammar.mjs",
|
|
262
268
|
"dev:grammar": "node scripts/build-grammar.mjs -- --watch",
|
|
263
269
|
"test": "pnpm test:vscode && pnpm test:grammar",
|
|
264
|
-
"test:vscode": "
|
|
270
|
+
"test:vscode": "vscode-test",
|
|
265
271
|
"test:grammar": "pnpm build:grammar && node ./test/grammar/test.mjs",
|
|
266
272
|
"update-grammar-snapshots": "node ./test/grammar/test.mjs --updateSnapshot"
|
|
267
273
|
}
|
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
|
+
}
|
package/test/grammar/test.mjs
CHANGED
|
@@ -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": "
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "dist",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
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();
|
package/test/suite/index.js
DELETED
|
@@ -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
|
-
};
|
package/test/tsconfig.json
DELETED
|
@@ -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
|