@vue/language-service 3.1.2 → 3.1.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/data/template/cs.json +1 -1
- package/data/template/en.json +1 -1
- package/data/template/ja.json +1 -1
- package/lib/plugins/vue-template.js +23 -0
- package/package.json +11 -11
package/data/template/cs.json
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"name": "v-text",
|
|
80
80
|
"description": {
|
|
81
81
|
"kind": "markdown",
|
|
82
|
-
"value": "Aktualizuje textový obsah elementu.\n\n- **Očekává:** `string`\n\n- **Podrobnosti**\n\n `v-text` funguje tak, že elementu nastavuje vlastnost [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent), což přepíše jakýkoli existující obsah uvnitř elementu. Pokud potřebujete aktualizovat část `textContent`, měli byste místo toho použít [„mustache“ interpolaci](https://cs.vuejs.org/guide/essentials/template-syntax.html#text-interpolation).\n\n- **Příklad**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- stejné jako -->\n <span>{{msg}}</span>\n ```\n\n- **Viz také:** [Syntaxe šablon – Interpolace textu](https://cs.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
82
|
+
"value": "Aktualizuje textový obsah elementu.\n\n- **Očekává:** `string`\n\n- **Podrobnosti**\n\n `v-text` funguje tak, že elementu nastavuje vlastnost [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent), což přepíše jakýkoli existující obsah uvnitř elementu. Pokud potřebujete aktualizovat jen část `textContent`, měli byste místo toho použít [„mustache“ interpolaci](https://cs.vuejs.org/guide/essentials/template-syntax.html#text-interpolation) (např. tímto způsobem: <span v-pre>`<span>Toto zachovat a aktualizovat pouze {{dynamickaCast}}</span>`</span>).\n\n- **Příklad**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- stejné jako -->\n <span>{{msg}}</span>\n ```\n\n- **Viz také:** [Syntaxe šablon – Interpolace textu](https://cs.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
83
83
|
},
|
|
84
84
|
"references": "api/built-in-directives.html#v-text"
|
|
85
85
|
},
|
package/data/template/en.json
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"name": "v-text",
|
|
80
80
|
"description": {
|
|
81
81
|
"kind": "markdown",
|
|
82
|
-
"value": "Update the element's text content.\n\n- **Expects:** `string`\n\n- **Details**\n\n `v-text` works by setting the element's [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) property, so it will overwrite any existing content inside the element. If you need to update
|
|
82
|
+
"value": "Update the element's text content.\n\n- **Expects:** `string`\n\n- **Details**\n\n `v-text` works by setting the element's [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) property, so it will overwrite any existing content inside the element. If you need to update only part of the `textContent`, you should use [mustache interpolations](https://vuejs.org/guide/essentials/template-syntax.html#text-interpolation) instead (ie. <span v-pre>`<span>Keep this but update a {{dynamicPortion}}</span>`</span>).\n\n- **Example**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- same as -->\n <span>{{msg}}</span>\n ```\n\n- **See also** [Template Syntax - Text Interpolation](https://vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
83
83
|
},
|
|
84
84
|
"references": "api/built-in-directives.html#v-text"
|
|
85
85
|
},
|
package/data/template/ja.json
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"name": "v-text",
|
|
80
80
|
"description": {
|
|
81
81
|
"kind": "markdown",
|
|
82
|
-
"value": "要素のテキスト内容を更新します。\n\n- **期待する値:** `string`\n\n- **詳細**\n\n `v-text` は要素の [textContent](https://developer.mozilla.org/ja/docs/Web/API/Node/textContent) プロパティをセットする動作なので、要素内の既存のコンテンツはすべて上書きされます。`textContent`
|
|
82
|
+
"value": "要素のテキスト内容を更新します。\n\n- **期待する値:** `string`\n\n- **詳細**\n\n `v-text` は要素の [textContent](https://developer.mozilla.org/ja/docs/Web/API/Node/textContent) プロパティをセットする動作なので、要素内の既存のコンテンツはすべて上書きされます。`textContent` の一部だけを更新する必要がある場合は、代わりに[マスタッシュ展開](https://ja.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)を使用します (例: <span v-pre>`<span>これは保持して {{dynamicPortion}} を更新</span>`</span>)。\n\n- **例**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- same as -->\n <span>{{msg}}</span>\n ```\n\n- **参照** [テンプレート構文 - テキスト展開](https://ja.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
83
83
|
},
|
|
84
84
|
"references": "api/built-in-directives.html#v-text"
|
|
85
85
|
},
|
|
@@ -74,6 +74,29 @@ function create(languageId, { getComponentNames, getElementAttrs, getComponentPr
|
|
|
74
74
|
},
|
|
75
75
|
create(context) {
|
|
76
76
|
const baseServiceInstance = baseService.create(context);
|
|
77
|
+
if (baseServiceInstance.provide['html/languageService']) {
|
|
78
|
+
const htmlService = baseServiceInstance.provide['html/languageService']();
|
|
79
|
+
const parseHTMLDocument = htmlService.parseHTMLDocument.bind(htmlService);
|
|
80
|
+
htmlService.parseHTMLDocument = document => {
|
|
81
|
+
const info = (0, utils_1.resolveEmbeddedCode)(context, document.uri);
|
|
82
|
+
if (info?.code.id === 'template') {
|
|
83
|
+
const templateAst = info.root.sfc.template?.ast;
|
|
84
|
+
if (templateAst) {
|
|
85
|
+
let text = document.getText();
|
|
86
|
+
for (const node of (0, language_core_1.forEachInterpolationNode)(templateAst)) {
|
|
87
|
+
text = text.substring(0, node.loc.start.offset)
|
|
88
|
+
+ ' '.repeat(node.loc.end.offset - node.loc.start.offset)
|
|
89
|
+
+ text.substring(node.loc.end.offset);
|
|
90
|
+
}
|
|
91
|
+
return parseHTMLDocument({
|
|
92
|
+
...document,
|
|
93
|
+
getText: () => text,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return parseHTMLDocument(document);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
77
100
|
builtInData ??= (0, data_1.loadTemplateData)(context.env.locale ?? 'en');
|
|
78
101
|
modelData ??= (0, data_1.loadModelModifiersData)(context.env.locale ?? 'en');
|
|
79
102
|
// https://vuejs.org/api/built-in-directives.html#v-on
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-service",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
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.23",
|
|
21
|
-
"@vue/language-core": "3.1.
|
|
21
|
+
"@vue/language-core": "3.1.4",
|
|
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.67",
|
|
25
|
+
"volar-service-emmet": "0.0.67",
|
|
26
|
+
"volar-service-html": "0.0.67",
|
|
27
|
+
"volar-service-json": "0.0.67",
|
|
28
|
+
"volar-service-pug": "0.0.67",
|
|
29
|
+
"volar-service-pug-beautify": "0.0.67",
|
|
30
|
+
"volar-service-typescript": "0.0.67",
|
|
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.23",
|
|
38
38
|
"@volar/typescript": "2.4.23",
|
|
39
39
|
"@vue/compiler-dom": "^3.5.0",
|
|
40
|
-
"@vue/typescript-plugin": "3.1.
|
|
40
|
+
"@vue/typescript-plugin": "3.1.4",
|
|
41
41
|
"vscode-css-languageservice": "^6.3.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "9670176c727993d16f9224f48406077e20972353"
|
|
44
44
|
}
|