@vue/language-service 3.0.3 → 3.0.4
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/index.d.ts +1 -12
- package/index.js +14 -15
- package/lib/plugins/css.js +9 -17
- package/lib/plugins/typescript-semantic-tokens.d.ts +2 -2
- package/lib/plugins/typescript-semantic-tokens.js +6 -14
- package/lib/plugins/utils.d.ts +8 -2
- package/lib/plugins/utils.js +39 -6
- package/lib/plugins/vue-autoinsert-dotvalue.d copy.d.ts +2 -0
- package/lib/plugins/vue-autoinsert-dotvalue.d copy.js +3 -0
- package/lib/plugins/vue-autoinsert-dotvalue.d.ts +2 -2
- package/lib/plugins/vue-autoinsert-dotvalue.js +15 -32
- package/lib/plugins/vue-compiler-dom-errors.js +17 -35
- package/lib/plugins/vue-component-semantic-tokens.d.ts +2 -2
- package/lib/plugins/vue-component-semantic-tokens.js +35 -49
- package/lib/plugins/vue-destructured-props-hints.d.ts +7 -0
- package/lib/plugins/vue-destructured-props-hints.js +220 -0
- package/lib/plugins/vue-document-drop.d.ts +2 -2
- package/lib/plugins/vue-document-drop.js +12 -26
- package/lib/plugins/vue-document-highlights.d.ts +1 -2
- package/lib/plugins/vue-document-highlights.js +6 -13
- package/lib/plugins/vue-extract-file.d.ts +2 -2
- package/lib/plugins/vue-extract-file.js +10 -25
- package/lib/plugins/vue-global-types-error.js +16 -16
- package/lib/plugins/vue-inlayhints.js +14 -15
- package/lib/plugins/vue-missing-props-hints.d.ts +2 -2
- package/lib/plugins/vue-missing-props-hints.js +7 -23
- package/lib/plugins/vue-scoped-class-links.d.ts +2 -0
- package/lib/plugins/vue-scoped-class-links.js +62 -0
- package/lib/plugins/vue-sfc.js +140 -143
- package/lib/plugins/vue-suggest-define-assignment.js +3 -13
- package/lib/plugins/vue-template-ref-links.d.ts +2 -0
- package/lib/plugins/vue-template-ref-links.js +57 -0
- package/lib/plugins/vue-template.d.ts +2 -2
- package/lib/plugins/vue-template.js +320 -353
- package/lib/plugins/vue-twoslash-queries.d.ts +2 -2
- package/lib/plugins/vue-twoslash-queries.js +6 -15
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function create(
|
|
1
|
+
import type { LanguageServicePlugin } from '@volar/language-service';
|
|
2
|
+
export declare function create(tsPluginClient: import('@vue/typescript-plugin/lib/requests').Requests | undefined): LanguageServicePlugin;
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.create = create;
|
|
4
|
-
const
|
|
5
|
-
const vscode_uri_1 = require("vscode-uri");
|
|
4
|
+
const utils_1 = require("./utils");
|
|
6
5
|
const twoslashTemplateReg = /<!--\s*\^\?\s*-->/g;
|
|
7
6
|
const twoslashScriptReg = /(?<=^|\n)\s*\/\/\s*\^\?/g;
|
|
8
|
-
function create(
|
|
7
|
+
function create(tsPluginClient) {
|
|
9
8
|
return {
|
|
10
9
|
name: 'vue-twoslash-queries',
|
|
11
10
|
capabilities: {
|
|
12
11
|
inlayHintProvider: {},
|
|
13
12
|
},
|
|
14
13
|
create(context) {
|
|
15
|
-
const tsPluginClient = getTsPluginClient?.(context);
|
|
16
14
|
return {
|
|
17
15
|
async provideInlayHints(document, range) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const sourceScript = decoded && context.language.scripts.get(decoded[0]);
|
|
21
|
-
const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
|
|
22
|
-
if (!sourceScript?.generated
|
|
23
|
-
|| (virtualCode?.id !== 'template' && !virtualCode?.id.startsWith('script_'))) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const root = sourceScript.generated.root;
|
|
27
|
-
if (!(root instanceof language_core_1.VueVirtualCode)) {
|
|
16
|
+
const info = (0, utils_1.getEmbeddedInfo)(context, document, id => id === 'template' || id.startsWith('script_'));
|
|
17
|
+
if (!info) {
|
|
28
18
|
return;
|
|
29
19
|
}
|
|
20
|
+
const { sourceScript, virtualCode, root } = info;
|
|
30
21
|
const hoverOffsets = [];
|
|
31
22
|
const inlayHints = [];
|
|
32
23
|
const twoslashReg = virtualCode.id === 'template' ? twoslashTemplateReg : twoslashScriptReg;
|
|
@@ -41,7 +32,7 @@ function create(getTsPluginClient) {
|
|
|
41
32
|
}),
|
|
42
33
|
]);
|
|
43
34
|
}
|
|
44
|
-
const sourceDocument = context.documents.get(
|
|
35
|
+
const sourceDocument = context.documents.get(sourceScript.id, sourceScript.languageId, sourceScript.snapshot);
|
|
45
36
|
for (const [pointerPosition, hoverOffset] of hoverOffsets) {
|
|
46
37
|
const map = context.language.maps.get(virtualCode, sourceScript);
|
|
47
38
|
for (const [sourceOffset] of map.toSourceLocation(hoverOffset)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-service",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"data",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@volar/language-service": "2.4.20",
|
|
21
|
-
"@vue/language-core": "3.0.
|
|
21
|
+
"@vue/language-core": "3.0.4",
|
|
22
22
|
"@vue/shared": "^3.5.0",
|
|
23
23
|
"path-browserify": "^1.0.1",
|
|
24
24
|
"volar-service-css": "0.0.65",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@volar/kit": "2.4.20",
|
|
38
38
|
"@volar/typescript": "2.4.20",
|
|
39
39
|
"@vue/compiler-dom": "^3.5.0",
|
|
40
|
-
"@vue/typescript-plugin": "3.0.
|
|
40
|
+
"@vue/typescript-plugin": "3.0.4",
|
|
41
41
|
"vscode-css-languageservice": "^6.3.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "148d386f9779c2de64cdcbd35310e03b36943b05"
|
|
44
44
|
}
|