@vue/language-service 3.1.6 → 3.1.8
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/data/template/fr.json +1 -1
- package/lib/plugins/vue-template.js +47 -62
- package/package.json +11 -11
package/data/template/fr.json
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"name": "v-text",
|
|
80
80
|
"description": {
|
|
81
81
|
"kind": "markdown",
|
|
82
|
-
"value": "Met à jour le contenu texte d'un élément.\n\n- **Attendu :** `string`\n\n- **Détails**\n\n `v-text` fonctionne en définissant la propriété [textContent](https://developer.mozilla.org/fr/docs/Web/API/Node/textContent) de l'élément,
|
|
82
|
+
"value": "Met à jour le contenu texte d'un élément.\n\n- **Attendu :** `string`\n\n- **Détails**\n\n `v-text` fonctionne en définissant la propriété [textContent](https://developer.mozilla.org/fr/docs/Web/API/Node/textContent) de l'élément, ce qui écrase tout contenu existant à l'intérieur de l'élément. Si vous devez mettre à jour uniquement une partie du `textContent`, vous devez plutôt utiliser les [interpolations de texte](https://fr.vuejs.org/guide/essentials/template-syntax.html#text-interpolation) (c'est-à-dire <span v-pre>`<span>Conserver ceci mais mettre à jour {{dynamicPortion}}</span>`</span>).\n\n- **Exemple**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- same as -->\n <span>{{msg}}</span>\n ```\n\n- **Voir aussi** [Syntaxe de template - Interpolation de texte](https://fr.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
83
83
|
},
|
|
84
84
|
"references": "api/built-in-directives.html#v-text"
|
|
85
85
|
},
|
|
@@ -7,8 +7,6 @@ const language_core_1 = require("@vue/language-core");
|
|
|
7
7
|
const shared_1 = require("@vue/shared");
|
|
8
8
|
const volar_service_html_1 = require("volar-service-html");
|
|
9
9
|
const volar_service_pug_1 = require("volar-service-pug");
|
|
10
|
-
const getFormatCodeSettings_js_1 = require("volar-service-typescript/lib/configs/getFormatCodeSettings.js");
|
|
11
|
-
const getUserPreferences_js_1 = require("volar-service-typescript/lib/configs/getUserPreferences.js");
|
|
12
10
|
const lspConverters_js_1 = require("volar-service-typescript/lib/utils/lspConverters.js");
|
|
13
11
|
const html = require("vscode-html-languageservice");
|
|
14
12
|
const vscode_uri_1 = require("vscode-uri");
|
|
@@ -51,9 +49,41 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
51
49
|
},
|
|
52
50
|
};
|
|
53
51
|
};
|
|
52
|
+
const getDocumentContext = context => ({
|
|
53
|
+
resolveReference(ref, base) {
|
|
54
|
+
let baseUri = vscode_uri_1.URI.parse(base);
|
|
55
|
+
const decoded = context.decodeEmbeddedDocumentUri(baseUri);
|
|
56
|
+
if (decoded) {
|
|
57
|
+
baseUri = decoded[0];
|
|
58
|
+
}
|
|
59
|
+
if (modulePathCache
|
|
60
|
+
&& baseUri.scheme === 'file'
|
|
61
|
+
&& !ref.startsWith('./')
|
|
62
|
+
&& !ref.startsWith('../')) {
|
|
63
|
+
const map = modulePathCache;
|
|
64
|
+
if (!map.has(ref)) {
|
|
65
|
+
const fileName = baseUri.fsPath.replace(/\\/g, '/');
|
|
66
|
+
const promise = resolveModuleName(fileName, ref);
|
|
67
|
+
map.set(ref, promise);
|
|
68
|
+
if (promise instanceof Promise) {
|
|
69
|
+
promise.then(res => map.set(ref, res));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const cached = modulePathCache.get(ref);
|
|
73
|
+
if (cached instanceof Promise) {
|
|
74
|
+
throw cached;
|
|
75
|
+
}
|
|
76
|
+
if (cached) {
|
|
77
|
+
return cached;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return (0, volar_service_html_1.resolveReference)(ref, baseUri, context.env.workspaceFolders);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
54
83
|
const baseService = languageId === 'jade'
|
|
55
84
|
? (0, volar_service_pug_1.create)({
|
|
56
85
|
useDefaultDataProvider: false,
|
|
86
|
+
getDocumentContext,
|
|
57
87
|
getCustomData() {
|
|
58
88
|
return [
|
|
59
89
|
...customData,
|
|
@@ -65,39 +95,7 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
65
95
|
: (0, volar_service_html_1.create)({
|
|
66
96
|
documentSelector: ['html', 'markdown'],
|
|
67
97
|
useDefaultDataProvider: false,
|
|
68
|
-
getDocumentContext
|
|
69
|
-
return {
|
|
70
|
-
resolveReference(ref, base) {
|
|
71
|
-
let baseUri = vscode_uri_1.URI.parse(base);
|
|
72
|
-
const decoded = context.decodeEmbeddedDocumentUri(baseUri);
|
|
73
|
-
if (decoded) {
|
|
74
|
-
baseUri = decoded[0];
|
|
75
|
-
}
|
|
76
|
-
if (modulePathCache
|
|
77
|
-
&& baseUri.scheme === 'file'
|
|
78
|
-
&& !ref.startsWith('./')
|
|
79
|
-
&& !ref.startsWith('../')) {
|
|
80
|
-
const map = modulePathCache;
|
|
81
|
-
if (!map.has(ref)) {
|
|
82
|
-
const fileName = baseUri.fsPath.replace(/\\/g, '/');
|
|
83
|
-
const promise = resolveModuleName(fileName, ref);
|
|
84
|
-
map.set(ref, promise);
|
|
85
|
-
if (promise instanceof Promise) {
|
|
86
|
-
promise.then(res => map.set(ref, res));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
const cached = modulePathCache.get(ref);
|
|
90
|
-
if (cached instanceof Promise) {
|
|
91
|
-
throw cached;
|
|
92
|
-
}
|
|
93
|
-
if (cached) {
|
|
94
|
-
return cached;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return (0, volar_service_html_1.resolveReference)(ref, baseUri, context.env.workspaceFolders);
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
},
|
|
98
|
+
getDocumentContext,
|
|
101
99
|
getCustomData() {
|
|
102
100
|
return [
|
|
103
101
|
...customData,
|
|
@@ -229,7 +227,6 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
229
227
|
const disposable = context.env.onDidChangeConfiguration?.(() => initializing = undefined);
|
|
230
228
|
const transformedItems = new WeakSet();
|
|
231
229
|
let initializing;
|
|
232
|
-
let formattingOptions;
|
|
233
230
|
let lastCompletionDocument;
|
|
234
231
|
return {
|
|
235
232
|
...baseServiceInstance,
|
|
@@ -237,14 +234,6 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
237
234
|
baseServiceInstance.dispose?.();
|
|
238
235
|
disposable?.dispose();
|
|
239
236
|
},
|
|
240
|
-
provideDocumentFormattingEdits(document, range, options, ...rest) {
|
|
241
|
-
formattingOptions = options;
|
|
242
|
-
return baseServiceInstance.provideDocumentFormattingEdits?.(document, range, options, ...rest);
|
|
243
|
-
},
|
|
244
|
-
provideOnTypeFormattingEdits(document, position, key, options, ...rest) {
|
|
245
|
-
formattingOptions = options;
|
|
246
|
-
return baseServiceInstance.provideOnTypeFormattingEdits?.(document, position, key, options, ...rest);
|
|
247
|
-
},
|
|
248
237
|
async provideCompletionItems(document, position, completionContext, token) {
|
|
249
238
|
if (document.languageId !== languageId) {
|
|
250
239
|
return;
|
|
@@ -263,11 +252,7 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
263
252
|
const map = context.language.maps.get(info.code, info.script);
|
|
264
253
|
let spliced = false;
|
|
265
254
|
for (const [sourceOffset] of map.toSourceLocation(offset)) {
|
|
266
|
-
const
|
|
267
|
-
(0, getFormatCodeSettings_js_1.getFormatCodeSettings)(context, document, formattingOptions),
|
|
268
|
-
(0, getUserPreferences_js_1.getUserPreferences)(context, document),
|
|
269
|
-
]);
|
|
270
|
-
const autoImport = await getAutoImportSuggestions(info.root.fileName, sourceOffset, preferences, formatOptions);
|
|
255
|
+
const autoImport = await getAutoImportSuggestions(info.root.fileName, sourceOffset);
|
|
271
256
|
if (!autoImport) {
|
|
272
257
|
continue;
|
|
273
258
|
}
|
|
@@ -417,11 +402,7 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
417
402
|
if (!sourceScript) {
|
|
418
403
|
return item;
|
|
419
404
|
}
|
|
420
|
-
const
|
|
421
|
-
(0, getFormatCodeSettings_js_1.getFormatCodeSettings)(context, lastCompletionDocument, formattingOptions),
|
|
422
|
-
(0, getUserPreferences_js_1.getUserPreferences)(context, lastCompletionDocument),
|
|
423
|
-
]);
|
|
424
|
-
const details = await resolveAutoImportCompletionEntry(item.data, preferences, formatOptions);
|
|
405
|
+
const details = await resolveAutoImportCompletionEntry(item.data);
|
|
425
406
|
if (details) {
|
|
426
407
|
const virtualCode = sourceScript.generated.embeddedCodes.get(decoded[1]);
|
|
427
408
|
const sourceDocument = context.documents.get(sourceScript.id, sourceScript.languageId, sourceScript.snapshot);
|
|
@@ -544,7 +525,7 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
544
525
|
version++;
|
|
545
526
|
})());
|
|
546
527
|
}
|
|
547
|
-
const
|
|
528
|
+
const codegen = language_core_1.tsCodegen.get(root.sfc);
|
|
548
529
|
const names = new Set();
|
|
549
530
|
const tags = [];
|
|
550
531
|
for (const tag of components) {
|
|
@@ -555,13 +536,17 @@ function create(ts, languageId, { getComponentNames, getComponentProps, getCompo
|
|
|
555
536
|
names.add(tag);
|
|
556
537
|
}
|
|
557
538
|
}
|
|
558
|
-
|
|
559
|
-
const name
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
539
|
+
if (codegen) {
|
|
540
|
+
for (const name of [
|
|
541
|
+
...codegen.getImportComponentNames(),
|
|
542
|
+
...codegen.getSetupExposed(),
|
|
543
|
+
]) {
|
|
544
|
+
if (tagNameCasing === 0 /* TagNameCasing.Kebab */) {
|
|
545
|
+
names.add((0, language_core_1.hyphenateTag)(name));
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
names.add(name);
|
|
549
|
+
}
|
|
565
550
|
}
|
|
566
551
|
}
|
|
567
552
|
for (const name of names) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-service",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"data",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@volar/language-service": "2.4.26",
|
|
21
|
-
"@vue/language-core": "3.1.
|
|
21
|
+
"@vue/language-core": "3.1.8",
|
|
22
22
|
"@vue/shared": "^3.5.0",
|
|
23
23
|
"path-browserify": "^1.0.1",
|
|
24
|
-
"volar-service-css": "0.0.
|
|
25
|
-
"volar-service-emmet": "0.0.
|
|
26
|
-
"volar-service-html": "0.0.
|
|
27
|
-
"volar-service-json": "0.0.
|
|
28
|
-
"volar-service-pug": "0.0.
|
|
29
|
-
"volar-service-pug-beautify": "0.0.
|
|
30
|
-
"volar-service-typescript": "0.0.
|
|
24
|
+
"volar-service-css": "0.0.68",
|
|
25
|
+
"volar-service-emmet": "0.0.68",
|
|
26
|
+
"volar-service-html": "0.0.68",
|
|
27
|
+
"volar-service-json": "0.0.68",
|
|
28
|
+
"volar-service-pug": "0.0.68",
|
|
29
|
+
"volar-service-pug-beautify": "0.0.68",
|
|
30
|
+
"volar-service-typescript": "0.0.68",
|
|
31
31
|
"vscode-html-languageservice": "^5.2.0",
|
|
32
32
|
"vscode-uri": "^3.0.8"
|
|
33
33
|
},
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@volar/kit": "2.4.26",
|
|
38
38
|
"@volar/typescript": "2.4.26",
|
|
39
39
|
"@vue/compiler-dom": "^3.5.0",
|
|
40
|
-
"@vue/typescript-plugin": "3.1.
|
|
40
|
+
"@vue/typescript-plugin": "3.1.8",
|
|
41
41
|
"vscode-css-languageservice": "^6.3.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "0c9b66d0332698a1764fa56b64d47a6a30e81b47"
|
|
44
44
|
}
|