Skip to content

Commit

Permalink
feat(language-service): better completion for directives (#4640)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX authored Aug 9, 2024
1 parent fd47493 commit a242050
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 7 deletions.
3 changes: 3 additions & 0 deletions packages/language-service/data/template/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nPřeskočit kompilaci tohoto elementu a všech jeho potomků.\n\n- **Nepředpokládá výraz** \n\n- **Podrobnosti**\n\n Uvnitř elementu s `v-pre` budou všechny syntaxe Vue šablony zachovány a&nbsp;vykresleny tak, jak jsou. Nejběžnějším použitím je zobrazení nezpracovaných „mustache“ tagů.\n\n- **Příklad**\n\n ```html\n <span v-pre>{{ toto nebude zkompilováno }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nVykreslit element nebo komponentu pouze jednou a přeskočit budoucí aktualizace.\n\n- **Nepředpokládá výraz** \n\n- **Podrobnosti**\n\n Při dalších překreslováních budou element/komponenta a všichni potomci považováni za statický obsah a přeskočeni. To lze použít k optimalizaci výkonu aktualizace.\n\n ```html\n <!-- jediný prvek -->\n <span v-once>Toto se nikdy nezmění: {{msg}}</span>\n <!-- element s potomky -->\n <div v-once>\n <h1>Komentář</h1>\n <p>{{msg}}</p>\n </div>\n <!-- komponenta -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- direktiva `v-for` -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n Od verze 3.2 si můžete také část šablony „zapamatovat“ (memoize) s podmínkami neplatnosti pomocí [`v-memo`](#v-memo).\n\n- **Viz také:**\n - [Syntaxe šablon - Interpolace textu](https://cs.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nPoužívá se k skrytí nezkompilované šablony, dokud není připravena.\n\n- **Nepředpokládá výraz**\n\n- **Podrobnosti**\n\n **Tato direktiva je potřeba pouze při použití bez build fáze.**\n\n Při použití in-DOM šablon může dojít k „blikání (flashing) nezkompilovaných šablon“: uživatel může vidět nezpracované „mustache“ značky, dokud je připojená (mounted) komponenta nenahradí vykresleným obsahem.\n\n `v-cloak` zůstane na elementu, dokud není připojena příslušná instance komponenty. Spolu s CSS pravidly jako `[v-cloak] { display: none }` lze použít k skrytí nezpracovaných šablon, dokud není komponenta připravena.\n\n- **Příklad**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n `<div>` nebude viditelný, dokud nebude dokončena kompilace.\n"
Expand Down
3 changes: 3 additions & 0 deletions packages/language-service/data/template/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nSkip compilation for this element and all its children.\n\n- **Does not expect expression**\n\n- **Details**\n\n Inside the element with `v-pre`, all Vue template syntax will be preserved and rendered as-is. The most common use case of this is displaying raw mustache tags.\n\n- **Example**\n\n ```html\n <span v-pre>{{ this will not be compiled }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nRender the element and component once only, and skip future updates.\n\n- **Does not expect expression**\n\n- **Details**\n\n On subsequent re-renders, the element/component and all its children will be treated as static content and skipped. This can be used to optimize update performance.\n\n ```html\n <!-- single element -->\n <span v-once>This will never change: {{msg}}</span>\n <!-- the element have children -->\n <div v-once>\n <h1>Comment</h1>\n <p>{{msg}}</p>\n </div>\n <!-- component -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- `v-for` directive -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n Since 3.2, you can also memoize part of the template with invalidation conditions using [`v-memo`](#v-memo).\n\n- **See also**\n - [Data Binding Syntax - interpolations](https://vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nUsed to hide un-compiled template until it is ready.\n\n- **Does not expect expression**\n\n- **Details**\n\n **This directive is only needed in no-build-step setups.**\n\n When using in-DOM templates, there can be a \"flash of un-compiled templates\": the user may see raw mustache tags until the mounted component replaces them with rendered content.\n\n `v-cloak` will remain on the element until the associated component instance is mounted. Combined with CSS rules such as `[v-cloak] { display: none }`, it can be used to hide the raw templates until the component is ready.\n\n- **Example**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n The `<div>` will not be visible until the compilation is done.\n"
Expand Down
3 changes: 3 additions & 0 deletions packages/language-service/data/template/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nIgnore la compilation pour cet élément et tous ses enfants.\n\n- **N'attend pas d'expression**\n\n- **Détails**\n\n À l'intérieur de l'élément contenant `v-pre`, toute la syntaxe du template Vue sera préservée et rendue telle quelle. Le cas d'utilisation le plus courant est l'affichage brut des balises moustaches.\n\n- **Exemple**\n\n ```html\n <span v-pre>{{ this will not be compiled }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nRend l'élément et le composant une seule fois, et ignore les mises à jour futures.\n\n- **N'attend pas d'expression**\n\n- **Détails**\n\n Lors des rendus suivants, l'élément/composant et tous ses enfants seront traités comme du contenu statique et ignorés. Cela peut être utilisé pour optimiser les performances de mise à jour.\n\n ```html\n <!-- élément simple -->\n <span v-once>This will never change: {{msg}}</span>\n <!-- l'élément a des enfants -->\n <div v-once>\n <h1>Comment</h1>\n <p>{{msg}}</p>\n </div>\n <!-- composant -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- directive `v-for` -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n Depuis la version 3.2, vous pouvez également mémoriser une partie du template avec des conditions d'invalidation en utilisant [`v-memo`](#v-memo).\n\n- **Voir aussi**\n - [Syntaxe de la liaison bidirectionnelle - interpolations](https://fr.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nUtilisée pour cacher un template non compilé jusqu'à ce qu'il soit prêt.\n\n- **N'attend pas d'expression**\n\n- **Détails**\n\n **Cette directive n'est nécessaire que dans les configurations sans étape de build.**\n\n Lors de l'utilisation de templates à l'intérieur du DOM, il peut y avoir un \"flash de templates non compilés\" : l'utilisateur peut voir des balises moustaches brutes jusqu'à ce que le composant monté les remplace par du contenu rendu.\n\n `v-cloak` restera sur l'élément jusqu'à ce que l'instance du composant associé soit montée. Combiné à des règles CSS telles que `[v-cloak] { display : none }`, elle peut être utilisée pour masquer les templates bruts jusqu'à ce que le composant soit prêt.\n\n- **Exemple**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n La `<div>` ne sera pas visible tant que la compilation n'est pas terminée.\n"
Expand Down
3 changes: 3 additions & 0 deletions packages/language-service/data/template/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nSkip compilation for this element and all its children.\n\n- **Does not expect expression**\n\n- **Details**\n\n Inside the element with `v-pre`, all Vue template syntax will be preserved and rendered as-is. The most common use case of this is displaying raw mustache tags.\n\n- **Example**\n\n ```html\n <span v-pre>{{ this will not be compiled }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nRender the element and component once only, and skip future updates.\n\n- **Does not expect expression**\n\n- **Details**\n\n On subsequent re-renders, the element/component and all its children will be treated as static content and skipped. This can be used to optimize update performance.\n\n ```html\n <!-- single element -->\n <span v-once>This will never change: {{msg}}</span>\n <!-- the element have children -->\n <div v-once>\n <h1>comment</h1>\n <p>{{msg}}</p>\n </div>\n <!-- component -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- `v-for` directive -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n Since 3.2, you can also memoize part of the template with invalidation conditions using [`v-memo`](#v-memo).\n\n- **See also**\n - [Data Binding Syntax - interpolations](https://it.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nUsed to hide un-compiled template until it is ready.\n\n- **Does not expect expression**\n\n- **Details**\n\n **This directive is only needed in no-build-step setups.**\n\n When using in-DOM templates, there can be a \"flash of un-compiled templates\": the user may see raw mustache tags until the mounted component replaces them with rendered content.\n\n `v-cloak` will remain on the element until the associated component instance is mounted. Combined with CSS rules such as `[v-cloak] { display: none }`, it can be used to hide the raw templates until the component is ready.\n\n- **Example**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n The `<div>` will not be visible until the compilation is done.\n"
Expand Down
3 changes: 3 additions & 0 deletions packages/language-service/data/template/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nこの要素とすべての子要素のコンパイルをスキップします。\n\n- **式を受け取りません**\n\n- **詳細**\n\n `v-pre` を指定した要素の内部では、Vue テンプレートの構文はすべて維持され、そのままレンダリングされます。この最も一般的な使用例は、未加工のマスタッシュタグを表示することです。\n\n- **例**\n\n ```html\n <span v-pre>{{ this will not be compiled }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\n要素やコンポーネントを一度だけレンダリングし、その後の更新はスキップします。\n\n- **式を受け取りません**\n\n- **詳細**\n\n その後の再レンダリングでは、要素/コンポーネントとそのすべての子要素は静的コンテンツとして扱われ、スキップされます。これは、更新のパフォーマンスを最適化するために使用できます。\n\n ```html\n <!-- 単一要素 -->\n <span v-once>This will never change: {{msg}}</span>\n <!-- 子要素を持つ要素 -->\n <div v-once>\n <h1>Comment</h1>\n <p>{{msg}}</p>\n </div>\n <!-- コンポーネント -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- `v-for` ディレクティブ -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n 3.2 以降では、[`v-memo`](#v-memo) を使って、テンプレートの一部を無効化する条件付きでメモ化できます。\n\n- **参照**\n - [データバインディング構文 - 展開](https://ja.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nコンパイルされていないテンプレートを、準備が整うまで非表示にするために使用します。\n\n- **式を受け取りません**\n\n- **詳細**\n\n **このディレクティブは、ビルドステップがないセットアップでのみ必要です。**\n\n DOM 内テンプレートを使用する場合、「コンパイルされていないテンプレートのフラッシュ」が発生することがあります。マウントされたコンポーネントがそれをレンダリングされたコンテンツに置き換えるまで、未加工のマスタッシュタグがユーザーに表示される場合があります。\n\n `v-cloak` は関連するコンポーネントインスタンスがマウントされるまで、その要素に残ります。`[v-cloak] { display: none }` のような CSS ルールと組み合わせることで、コンポーネントの準備が整うまで未加工のテンプレートを非表示にできます。\n\n- **例**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n この `<div>` はコンパイルが完了するまで表示されません。\n"
Expand Down
3 changes: 3 additions & 0 deletions packages/language-service/data/template/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\n이 엘리먼트와 모든 자식 엘리먼트의 컴파일을 생략합니다.\n\n- **표현식을 허용하지 않습니다**.\n\n- **세부 사항**:\n\n `v-pre`가 있는 엘리먼트 내에서 모든 Vue 템플릿 구문은 그대로 유지되고 렌더링됩니다. 가장 일반적인 사용 사례는 이중 중괄호 태그를 표시하는 것입니다.\n\n- **예제**\n\n ```html\n <span v-pre>{{ 이곳은 컴파일되지 않습니다. }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\n엘리먼트와 컴포넌트를 한 번만 렌더링하고, 향후 업데이트를 생략합니다.\n\n- **표현식을 허용하지 않습니다**.\n\n- **세부 사항**:\n\n 이후 다시 렌더링할 때 엘리먼트/컴포넌트 및 모든 자식들은 정적 컨텐츠로 처리되어 생략됩니다. 이것은 업데이트 성능을 최적화하는 데 사용할 수 있습니다.\n\n ```html\n <!-- 단일 엘리먼트 -->\n <span v-once>절대 바뀌지 않음: {{msg}}</span>\n <!-- 자식이 있는 엘리먼트 -->\n <div v-once>\n <h1>댓글</h1>\n <p>{{msg}}</p>\n </div>\n <!-- 컴포넌트 -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- `v-for` 디렉티브 -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n 3.2부터는 [`v-memo`](#v-memo)를 사용하여 무효화 조건으로 템플릿의 일부를 메모화할 수도 있습니다.\n\n- **참고**:\n - [가이드 - 템플릿 문법: 텍스트 보간법](https://ko.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\n준비될 때까지 컴파일되지 않은 템플릿을 숨기는 데 사용됩니다.\n\n- **표현식을 허용하지 않습니다**.\n\n- **세부 사항**:\n\n **이 디렉티브는 빌드 과정이 없는 설정에서만 필요합니다**.\n\n DOM 내 템플릿을 사용할 때, \"컴파일되지 않은 템플릿이 순간 보이는 현상\"이 있을 수 있습니다. 이러면 사용자는 컴포넌트가 렌더링된 컨텐츠로 대체할 때까지 이중 중괄호 태그를 볼 수 있습니다.\n\n `v-cloak`은 연결된 컴포넌트 인스턴스가 마운트될 때까지 엘리먼트에 남아 있습니다. `[v-cloak] { display: none }`과 같은 CSS 규칙과 결합하여, 컴포넌트가 준비될 때까지 템플릿을 숨기는 데 사용할 수 있습니다.\n\n- **예제**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n `<div>`는 컴파일이 완료될 때까지 표시되지 않습니다.\n"
Expand Down
3 changes: 3 additions & 0 deletions packages/language-service/data/template/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@
},
{
"name": "v-pre",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nIgnora a compilação para este elemento e todos os seus filhos.\n\n- **Não espera expressão**\n\n- **Detalhes**\n\n Dentro do elemento com `v-pre`, toda a sintaxe de modelo de marcação da Vue será preservada e desenhada como está. O caso de uso mais comum disto é a exibição de marcadores de bigodes puros.\n\n- **Exemplo**\n\n ```html\n <span v-pre>{{ this will not be compiled }}</span>\n ```\n"
Expand Down Expand Up @@ -1234,6 +1235,7 @@
},
{
"name": "v-once",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nDesenha o elemento e o componente apenas uma vez, e ignora as futuras atualizações.\n\n- **Não espera expressão**\n\n- **Detalhes**\n\n Nos redesenhos subsequentes, o elemento ou componente e todos os seus filhos serão tratados como conteúdo estático e ignorados. Isto pode ser usado para otimizar o desempenho da atualização.\n\n ```html\n <!-- elemento único -->\n <span v-once>This will never change: {{msg}}</span>\n <!-- o elemento tem filhos -->\n <div v-once>\n <h1>comment</h1>\n <p>{{msg}}</p>\n </div>\n <!-- componente -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- diretiva `v-for` -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n Desde a 3.2, também podemos memorizar parte do modelo de marcação com condições de invalidação usando a [`v-memo`](#v-memo).\n\n- **Consultar também**\n - [Sintaxe de Vínculo de Dados - Interpolações](https://pt.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [`v-memo`](#v-memo)\n"
Expand Down Expand Up @@ -1356,6 +1358,7 @@
},
{
"name": "v-cloak",
"valueSet": "v",
"description": {
"kind": "markdown",
"value": "\nUsada para esconder o modelo de marcação que ainda não foi compilado até que estiver pronto.\n\n- **Não espera expressão**\n\n- **Detalhes**\n\n **Esta diretiva apenas é necessária nas configurações sem etapa de construção.**\n\n Quando usamos os modelos de marcação no DOM, pode existir um \"piscar de modelos de marcação não compilados\": o utilizador pode ver os marcadores de bigodes puros até o componente montado substituí-los com componente desenhado.\n\n `v-cloak` permanecerá no elemento até que a instância do componente associado for montada. Combinada com as regras de CSS como `[v-cloak] { display: none }`, pode ser usada para esconder os modelos de marcação puros até o componente estiver pronto.\n\n- **Exemplo**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n O `<div>` não será visível até que a compilação estiver concluída.\n"
Expand Down
Loading

0 comments on commit a242050

Please sign in to comment.