@astrojs/language-server 2.3.2 → 2.3.3
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 +4 -4
- package/dist/languageServerPlugin.js +17 -19
- package/dist/plugins/astro.d.ts +1 -2
- package/dist/plugins/astro.js +3 -1
- package/dist/plugins/html.d.ts +1 -2
- package/dist/plugins/html.js +3 -1
- package/dist/plugins/typescript/index.d.ts +1 -2
- package/dist/plugins/typescript/index.js +3 -1
- package/dist/plugins/typescript-addons/index.d.ts +1 -1
- package/dist/plugins/typescript-addons/index.js +3 -3
- package/package.json +7 -7
package/dist/check.js
CHANGED
|
@@ -37,9 +37,9 @@ const node_url_1 = require("node:url");
|
|
|
37
37
|
const index_js_1 = require("./core/index.js");
|
|
38
38
|
const svelte_js_1 = require("./core/svelte.js");
|
|
39
39
|
const vue_js_1 = require("./core/vue.js");
|
|
40
|
-
const astro_js_1 = __importDefault(require("./plugins/astro.js"));
|
|
41
|
-
const index_js_2 = __importDefault(require("./plugins/typescript/index.js"));
|
|
42
40
|
const utils_js_1 = require("./utils.js");
|
|
41
|
+
const astro_js_1 = require("./plugins/astro.js");
|
|
42
|
+
const index_js_2 = require("./plugins/typescript/index.js");
|
|
43
43
|
class AstroCheck {
|
|
44
44
|
constructor(workspacePath, typescriptPath, tsconfigPath) {
|
|
45
45
|
this.workspacePath = workspacePath;
|
|
@@ -113,8 +113,8 @@ class AstroCheck {
|
|
|
113
113
|
vue: (0, vue_js_1.getVueLanguageModule)(),
|
|
114
114
|
},
|
|
115
115
|
services: {
|
|
116
|
-
typescript: (0, index_js_2.
|
|
117
|
-
astro: (0, astro_js_1.
|
|
116
|
+
typescript: (0, index_js_2.create)(),
|
|
117
|
+
astro: (0, astro_js_1.create)(),
|
|
118
118
|
},
|
|
119
119
|
};
|
|
120
120
|
if (tsconfigPath) {
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.plugin = void 0;
|
|
7
4
|
const node_1 = require("@volar/language-server/node");
|
|
8
|
-
const volar_service_css_1 = __importDefault(require("volar-service-css"));
|
|
9
|
-
const volar_service_emmet_1 = __importDefault(require("volar-service-emmet"));
|
|
10
|
-
const volar_service_prettier_1 = __importDefault(require("volar-service-prettier"));
|
|
11
|
-
const volar_service_typescript_twoslash_queries_1 = __importDefault(require("volar-service-typescript-twoslash-queries"));
|
|
12
5
|
const core_1 = require("./core");
|
|
13
6
|
const svelte_js_1 = require("./core/svelte.js");
|
|
14
7
|
const vue_js_1 = require("./core/vue.js");
|
|
15
8
|
const importPackage_js_1 = require("./importPackage.js");
|
|
16
|
-
const astro_js_1 = __importDefault(require("./plugins/astro.js"));
|
|
17
|
-
const html_js_1 = __importDefault(require("./plugins/html.js"));
|
|
18
|
-
const index_js_1 = require("./plugins/typescript-addons/index.js");
|
|
19
|
-
const index_js_2 = __importDefault(require("./plugins/typescript/index.js"));
|
|
20
9
|
const utils_js_1 = require("./utils.js");
|
|
10
|
+
// Services
|
|
11
|
+
const volar_service_css_1 = require("volar-service-css");
|
|
12
|
+
const volar_service_emmet_1 = require("volar-service-emmet");
|
|
13
|
+
const volar_service_prettier_1 = require("volar-service-prettier");
|
|
14
|
+
const volar_service_typescript_twoslash_queries_1 = require("volar-service-typescript-twoslash-queries");
|
|
15
|
+
const astro_js_1 = require("./plugins/astro.js");
|
|
16
|
+
const html_js_1 = require("./plugins/html.js");
|
|
17
|
+
const index_js_1 = require("./plugins/typescript-addons/index.js");
|
|
18
|
+
const index_js_2 = require("./plugins/typescript/index.js");
|
|
21
19
|
const plugin = (initOptions, modules) => ({
|
|
22
20
|
extraFileExtensions: [
|
|
23
21
|
{ extension: 'astro', isMixedContent: true, scriptKind: 7 },
|
|
@@ -53,19 +51,19 @@ const plugin = (initOptions, modules) => ({
|
|
|
53
51
|
config.languages.svelte = (0, svelte_js_1.getSvelteLanguageModule)();
|
|
54
52
|
}
|
|
55
53
|
config.services ??= {};
|
|
56
|
-
config.services.html ??= (0, html_js_1.
|
|
57
|
-
config.services.css ??= (0, volar_service_css_1.
|
|
58
|
-
config.services.emmet ??= (0, volar_service_emmet_1.
|
|
59
|
-
config.services.typescript ??= (0, index_js_2.
|
|
60
|
-
config.services.typescripttwoslash ??= (0, volar_service_typescript_twoslash_queries_1.
|
|
61
|
-
config.services.typescriptaddons ??= (0, index_js_1.
|
|
62
|
-
config.services.astro ??= (0, astro_js_1.
|
|
54
|
+
config.services.html ??= (0, html_js_1.create)();
|
|
55
|
+
config.services.css ??= (0, volar_service_css_1.create)();
|
|
56
|
+
config.services.emmet ??= (0, volar_service_emmet_1.create)();
|
|
57
|
+
config.services.typescript ??= (0, index_js_2.create)();
|
|
58
|
+
config.services.typescripttwoslash ??= (0, volar_service_typescript_twoslash_queries_1.create)();
|
|
59
|
+
config.services.typescriptaddons ??= (0, index_js_1.create)();
|
|
60
|
+
config.services.astro ??= (0, astro_js_1.create)();
|
|
63
61
|
if (ctx) {
|
|
64
62
|
const rootDir = ctx.env.uriToFileName(ctx.project.rootUri.toString());
|
|
65
63
|
const prettier = (0, importPackage_js_1.importPrettier)(rootDir);
|
|
66
64
|
const prettierPluginPath = (0, importPackage_js_1.getPrettierPluginPath)(rootDir);
|
|
67
65
|
if (prettier && prettierPluginPath) {
|
|
68
|
-
config.services.prettier ??= (0, volar_service_prettier_1.
|
|
66
|
+
config.services.prettier ??= (0, volar_service_prettier_1.create)({
|
|
69
67
|
prettier: prettier,
|
|
70
68
|
languages: ['astro'],
|
|
71
69
|
ignoreIdeOptions: true,
|
package/dist/plugins/astro.d.ts
CHANGED
package/dist/plugins/astro.js
CHANGED
|
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.create = void 0;
|
|
6
7
|
const language_server_1 = require("@volar/language-server");
|
|
7
8
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
8
9
|
const node_path_1 = require("node:path");
|
|
9
10
|
const index_js_1 = require("../core/index.js");
|
|
10
11
|
const utils_js_1 = require("./utils.js");
|
|
11
|
-
|
|
12
|
+
const create = () => (context, modules) => {
|
|
12
13
|
return {
|
|
13
14
|
triggerCharacters: ['-'],
|
|
14
15
|
provideCompletionItems(document, position, completionContext, token) {
|
|
@@ -75,6 +76,7 @@ exports.default = () => (context, modules) => {
|
|
|
75
76
|
},
|
|
76
77
|
};
|
|
77
78
|
};
|
|
79
|
+
exports.create = create;
|
|
78
80
|
function getGlobResultAsCodeLens(globText, dir, position) {
|
|
79
81
|
const globResult = fast_glob_1.default.sync(globText, {
|
|
80
82
|
cwd: dir,
|
package/dist/plugins/html.d.ts
CHANGED
package/dist/plugins/html.js
CHANGED
|
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.create = void 0;
|
|
6
7
|
const language_server_1 = require("@volar/language-server");
|
|
7
8
|
const volar_service_html_1 = __importDefault(require("volar-service-html"));
|
|
8
9
|
const index_js_1 = require("../core/index.js");
|
|
9
10
|
const html_data_js_1 = require("./html-data.js");
|
|
10
11
|
const utils_js_1 = require("./utils.js");
|
|
11
|
-
|
|
12
|
+
const create = () => (context, modules) => {
|
|
12
13
|
const htmlPlugin = (0, volar_service_html_1.default)()(context, modules);
|
|
13
14
|
if (!context) {
|
|
14
15
|
return { triggerCharacters: htmlPlugin.triggerCharacters };
|
|
@@ -45,4 +46,5 @@ exports.default = () => (context, modules) => {
|
|
|
45
46
|
},
|
|
46
47
|
};
|
|
47
48
|
};
|
|
49
|
+
exports.create = create;
|
|
48
50
|
//# sourceMappingURL=html.js.map
|
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.create = void 0;
|
|
6
7
|
const language_server_1 = require("@volar/language-server");
|
|
7
8
|
const volar_service_typescript_1 = __importDefault(require("volar-service-typescript"));
|
|
8
9
|
const index_js_1 = require("../../core/index.js");
|
|
9
10
|
const utils_js_1 = require("../utils.js");
|
|
10
11
|
const completions_js_1 = require("./completions.js");
|
|
11
12
|
const diagnostics_js_1 = require("./diagnostics.js");
|
|
12
|
-
|
|
13
|
+
const create = () => (context, modules) => {
|
|
13
14
|
const typeScriptPlugin = (0, volar_service_typescript_1.default)()(context, modules);
|
|
14
15
|
if (!context) {
|
|
15
16
|
return {
|
|
@@ -124,4 +125,5 @@ exports.default = () => (context, modules) => {
|
|
|
124
125
|
},
|
|
125
126
|
};
|
|
126
127
|
};
|
|
128
|
+
exports.create = create;
|
|
127
129
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Service } from '@volar/language-server';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const create: () => Service;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.create = void 0;
|
|
4
4
|
const index_js_1 = require("../../core/index.js");
|
|
5
5
|
const utils_js_1 = require("../utils.js");
|
|
6
6
|
const snippets_js_1 = require("./snippets.js");
|
|
7
|
-
const
|
|
7
|
+
const create = () => (context) => {
|
|
8
8
|
return {
|
|
9
9
|
isAdditionalCompletion: true,
|
|
10
10
|
// Q: Why the empty transform and resolve functions?
|
|
@@ -37,5 +37,5 @@ const createTypescriptAddonsService = () => (context) => {
|
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
exports.
|
|
40
|
+
exports.create = create;
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/language-server",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"author": "withastro",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"@volar/typescript": "~1.10.0",
|
|
31
31
|
"fast-glob": "^3.2.12",
|
|
32
32
|
"muggle-string": "^0.3.1",
|
|
33
|
-
"volar-service-css": "0.0.
|
|
34
|
-
"volar-service-emmet": "0.0.
|
|
35
|
-
"volar-service-html": "0.0.
|
|
36
|
-
"volar-service-prettier": "0.0.
|
|
37
|
-
"volar-service-typescript": "0.0.
|
|
38
|
-
"volar-service-typescript-twoslash-queries": "0.0.
|
|
33
|
+
"volar-service-css": "0.0.13",
|
|
34
|
+
"volar-service-emmet": "0.0.13",
|
|
35
|
+
"volar-service-html": "0.0.13",
|
|
36
|
+
"volar-service-prettier": "0.0.13",
|
|
37
|
+
"volar-service-typescript": "0.0.13",
|
|
38
|
+
"volar-service-typescript-twoslash-queries": "0.0.13",
|
|
39
39
|
"vscode-html-languageservice": "^5.0.6",
|
|
40
40
|
"vscode-uri": "^3.0.7"
|
|
41
41
|
},
|