@vue/language-service 1.8.4 → 1.8.5

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.
@@ -5,7 +5,7 @@
5
5
  "name": "Transition",
6
6
  "description": {
7
7
  "kind": "markdown",
8
- "value": "\n**単一の**要素またはコンポーネントにアニメーションのトランジションを提供します。\n\n- **props**\n\n ```ts\n interface TransitionProps {\n /**\n * トランジションの CSS クラス名を自動生成するために使用します。\n * 例: `name: 'fade'` は `.fade-enter` や `.fade-enter-active`\n * などに自動展開されます。\n */\n name?: string\n /**\n * CSS のトランジションクラスを適用するかどうか。\n * デフォルト: true\n */\n css?: boolean\n /**\n * トランジション終了タイミングを決定するために待機する、\n * トランジションイベントの種類を指定します。\n * デフォルトの動作は、持続時間がより長い方のタイプを\n * 自動検出します。\n */\n type?: 'transition' | 'animation'\n /**\n * トランジションの持続時間を明示的に指定します。\n * デフォルトの動作は、ルートトランジション要素の最初の\n * `transitionend` または `animationend` イベントを待ちます。\n */\n duration?: number | { enter: number; leave: number }\n /**\n * leaving/entering トランジションのタイミングシーケンスを制御。\n * デフォルトの動作は同時です。\n */\n mode?: 'in-out' | 'out-in' | 'default'\n /**\n * 初回レンダリング時にトランジションを適用するかどうか。\n * デフォルト: false\n */\n appear?: boolean\n\n /**\n * トランジションクラスをカスタマイズするための props。\n * テンプレートでは kebab-case を使用(例: enter-from-class=\"xxx\")\n */\n enterFromClass?: string\n enterActiveClass?: string\n enterToClass?: string\n appearFromClass?: string\n appearActiveClass?: string\n appearToClass?: string\n leaveFromClass?: string\n leaveActiveClass?: string\n leaveToClass?: string\n }\n ```\n\n- **イベント**\n\n - `@before-enter`\n - `@before-leave`\n - `@enter`\n - `@leave`\n - `@appear`\n - `@after-enter`\n - `@after-leave`\n - `@after-appear`\n - `@enter-cancelled`\n - `@leave-cancelled`(`v-show` のみ)\n - `@appear-cancelled`\n\n- **例**\n\n シンプルな要素:\n\n ```html\n <Transition>\n <div v-if=\"ok\">toggled content</div>\n </Transition>\n ```\n\n `key` 属性を変更することで強制的にトランジションさせる:\n\n ```html\n <Transition>\n <div :key=\"text\">{{ text }}</div>\n </Transition>\n ```\n\n トランジションモードと出現時のアニメーションを備えている動的コンポーネント:\n\n ```html\n <Transition name=\"fade\" mode=\"out-in\" appear>\n <component :is=\"view\"></component>\n </Transition>\n ```\n\n トランジションイベントを購読する:\n\n ```html\n <Transition @after-enter=\"onTransitionComplete\">\n <div v-show=\"ok\">toggled content</div>\n </Transition>\n ```\n\n- **参照** [`<Transition>` ガイド](https://ja.vuejs.org/guide/built-ins/transition.html)\n"
8
+ "value": "\n**単一の**要素またはコンポーネントにアニメーションのトランジション効果を提供します。\n\n- **props**\n\n ```ts\n interface TransitionProps {\n /**\n * トランジションの CSS クラス名を自動生成するために使用します。\n * 例: `name: 'fade'` は `.fade-enter` や `.fade-enter-active`\n * などに自動展開されます。\n */\n name?: string\n /**\n * CSS のトランジションクラスを適用するかどうか。\n * デフォルト: true\n */\n css?: boolean\n /**\n * トランジション終了タイミングを決定するために待機する、\n * トランジションイベントの種類を指定します。\n * デフォルトの動作は、持続時間がより長い方のタイプを\n * 自動検出します。\n */\n type?: 'transition' | 'animation'\n /**\n * トランジションの持続時間を明示的に指定します。\n * デフォルトの動作は、ルートトランジション要素の最初の\n * `transitionend` または `animationend` イベントを待ちます。\n */\n duration?: number | { enter: number; leave: number }\n /**\n * leaving/entering トランジションのタイミングシーケンスを制御。\n * デフォルトの動作は同時です。\n */\n mode?: 'in-out' | 'out-in' | 'default'\n /**\n * 初回レンダリング時にトランジションを適用するかどうか。\n * デフォルト: false\n */\n appear?: boolean\n\n /**\n * トランジションクラスをカスタマイズするための props。\n * テンプレートでは kebab-case を使用(例: enter-from-class=\"xxx\")\n */\n enterFromClass?: string\n enterActiveClass?: string\n enterToClass?: string\n appearFromClass?: string\n appearActiveClass?: string\n appearToClass?: string\n leaveFromClass?: string\n leaveActiveClass?: string\n leaveToClass?: string\n }\n ```\n\n- **イベント**\n\n - `@before-enter`\n - `@before-leave`\n - `@enter`\n - `@leave`\n - `@appear`\n - `@after-enter`\n - `@after-leave`\n - `@after-appear`\n - `@enter-cancelled`\n - `@leave-cancelled`(`v-show` のみ)\n - `@appear-cancelled`\n\n- **例**\n\n シンプルな要素:\n\n ```html\n <Transition>\n <div v-if=\"ok\">toggled content</div>\n </Transition>\n ```\n\n `key` 属性を変更することで強制的にトランジションさせる:\n\n ```html\n <Transition>\n <div :key=\"text\">{{ text }}</div>\n </Transition>\n ```\n\n トランジションモードと出現時のアニメーションを備えている動的コンポーネント:\n\n ```html\n <Transition name=\"fade\" mode=\"out-in\" appear>\n <component :is=\"view\"></component>\n </Transition>\n ```\n\n トランジションイベントを購読する:\n\n ```html\n <Transition @after-enter=\"onTransitionComplete\">\n <div v-show=\"ok\">toggled content</div>\n </Transition>\n ```\n\n- **参照** [`<Transition>` ガイド](https://ja.vuejs.org/guide/built-ins/transition.html)\n"
9
9
  },
10
10
  "attributes": [],
11
11
  "references": [
@@ -39,7 +39,7 @@
39
39
  "name": "TransitionGroup",
40
40
  "description": {
41
41
  "kind": "markdown",
42
- "value": "\nリスト内の**複数**の要素またはコンポーネントにトランジション効果を提供する。\n\n- **props**\n\n `<TransitionGroup>` は `<Transition>` と同じ props(`mode` 以外)と追加の 2 つの props を受け取ります:\n\n ```ts\n interface TransitionGroupProps extends Omit<TransitionProps, 'mode'> {\n /**\n * 未定義の場合はフラグメントとしてレンダリングされます。\n */\n tag?: string\n /**\n * 移動のトランジション中に適用される CSS クラスのカスタマイズ。\n * テンプレートでは kebab-case を使用(例: move-class=\"xxx\")\n */\n moveClass?: string\n }\n ```\n\n- **イベント**\n\n `<TransitionGroup>` は `<Transition>` と同じイベントを発行します。\n\n- **詳細**\n\n デフォルトでは、`<TransitionGroup>` はラッパー DOM 要素をレンダリングしませんが、 `tag` props によって定義できます。\n\n アニメーションが正しく動作するためには、`<transition-group>` 内のすべての子に[**一意なキーを指定**](https://ja.vuejs.org/guide/essentials/list.html#maintaining-state-with-key)する必要があることに注意してください。\n\n `<TransitionGroup>` は CSS の transform による移動トランジションに対応しています。更新後に画面上の子の位置が変化した場合、移動用の CSS クラス(`name` 属性から自動生成されるか、`move-class` props で設定)が適用されます。移動用のクラスが適用されたときに、CSS の `transform` プロパティが「トランジション可能」であれば、その要素は [FLIP テクニック](https://aerotwist.com/blog/flip-your-animations/)を使って移動先までスムーズにアニメーションします。\n\n- **例**\n\n ```html\n <TransitionGroup tag=\"ul\" name=\"slide\">\n <li v-for=\"item in items\" :key=\"item.id\">\n {{ item.text }}\n </li>\n </TransitionGroup>\n ```\n\n- **参照** [ガイド - TransitionGroup](https://ja.vuejs.org/guide/built-ins/transition-group.html)\n"
42
+ "value": "\nリスト内の**複数**の要素またはコンポーネントにトランジション効果を提供します。\n\n- **props**\n\n `<TransitionGroup>` は `<Transition>` と同じ props(`mode` 以外)と追加の 2 つの props を受け取ります:\n\n ```ts\n interface TransitionGroupProps extends Omit<TransitionProps, 'mode'> {\n /**\n * 未定義の場合はフラグメントとしてレンダリングされます。\n */\n tag?: string\n /**\n * 移動のトランジション中に適用される CSS クラスのカスタマイズ。\n * テンプレートでは kebab-case を使用(例: move-class=\"xxx\")\n */\n moveClass?: string\n }\n ```\n\n- **イベント**\n\n `<TransitionGroup>` は `<Transition>` と同じイベントを発行します。\n\n- **詳細**\n\n デフォルトでは、`<TransitionGroup>` はラッパー DOM 要素をレンダリングしませんが、 `tag` props によって定義できます。\n\n アニメーションが正しく動作するためには、`<transition-group>` 内のすべての子に[**一意なキーを指定**](https://ja.vuejs.org/guide/essentials/list.html#maintaining-state-with-key)する必要があることに注意してください。\n\n `<TransitionGroup>` は CSS の transform による移動トランジションに対応しています。更新後に画面上の子の位置が変化した場合、移動用の CSS クラス(`name` 属性から自動生成されるか、`move-class` props で設定)が適用されます。移動用のクラスが適用されたときに、CSS の `transform` プロパティが「トランジション可能」であれば、その要素は [FLIP テクニック](https://aerotwist.com/blog/flip-your-animations/)を使って移動先までスムーズにアニメーションします。\n\n- **例**\n\n ```html\n <TransitionGroup tag=\"ul\" name=\"slide\">\n <li v-for=\"item in items\" :key=\"item.id\">\n {{ item.text }}\n </li>\n </TransitionGroup>\n ```\n\n- **参照** [ガイド - TransitionGroup](https://ja.vuejs.org/guide/built-ins/transition-group.html)\n"
43
43
  },
44
44
  "attributes": [],
45
45
  "references": [
@@ -5,4 +5,4 @@ import createJsonService from 'volar-service-json';
5
5
  export interface Settings {
6
6
  json?: Parameters<typeof createJsonService>[0];
7
7
  }
8
- export declare function resolveConfig(config: Config, compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: Partial<vue.VueCompilerOptions>, ts?: typeof import('typescript/lib/tsserverlibrary'), settings?: Settings, codegenStack?: boolean): Config;
8
+ export declare function resolveConfig(config: Config, compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: Partial<vue.VueCompilerOptions>, ts?: typeof import('typescript/lib/tsserverlibrary'), codegenStack?: boolean): Config;
@@ -22,15 +22,16 @@ const vue_twoslash_queries_1 = require("./plugins/vue-twoslash-queries");
22
22
  const vue_visualize_hidden_callback_param_1 = require("./plugins/vue-visualize-hidden-callback-param");
23
23
  const vue_directive_comments_1 = require("./plugins/vue-directive-comments");
24
24
  const types_1 = require("./types");
25
- function resolveConfig(config, compilerOptions = {}, vueCompilerOptions = {}, ts = require('typescript'), settings, codegenStack = false) {
25
+ function resolveConfig(config, compilerOptions = {}, vueCompilerOptions = {}, ts = require('typescript'), codegenStack = false) {
26
26
  const resolvedVueCompilerOptions = vue.resolveVueCompilerOptions(vueCompilerOptions);
27
27
  const vueLanguageModules = vue.createLanguages(compilerOptions, resolvedVueCompilerOptions, ts, codegenStack);
28
28
  config.languages = Object.assign({}, vueLanguageModules, config.languages);
29
- config.services = resolvePlugins(config.services, resolvedVueCompilerOptions, settings);
29
+ config.services = resolvePlugins(config.services, resolvedVueCompilerOptions);
30
30
  return config;
31
31
  }
32
32
  exports.resolveConfig = resolveConfig;
33
- function resolvePlugins(services, vueCompilerOptions, settings) {
33
+ const unicodeReg = /\\u/g;
34
+ function resolvePlugins(services, vueCompilerOptions) {
34
35
  const originalTsPlugin = services?.typescript ?? (0, volar_service_typescript_1.default)();
35
36
  services ??= {};
36
37
  services.typescript = (_context, modules) => {
@@ -149,7 +150,7 @@ function resolvePlugins(services, vueCompilerOptions, settings) {
149
150
  transformed = true;
150
151
  item.additionalTextEdits.push({
151
152
  range: editRange,
152
- newText: unescape(printText.replace(/\\u/g, '%u')),
153
+ newText: unescape(printText.replace(unicodeReg, '%u')),
153
154
  });
154
155
  }
155
156
  else if (exportDefault.args && exportDefault.argsNode) {
@@ -168,7 +169,7 @@ function resolvePlugins(services, vueCompilerOptions, settings) {
168
169
  transformed = true;
169
170
  item.additionalTextEdits.push({
170
171
  range: editRange,
171
- newText: unescape(printText.replace(/\\u/g, '%u')),
172
+ newText: unescape(printText.replace(unicodeReg, '%u')),
172
173
  });
173
174
  }
174
175
  }
@@ -234,7 +235,7 @@ function resolvePlugins(services, vueCompilerOptions, settings) {
234
235
  services.vue ??= (0, vue_1.default)();
235
236
  services.css ??= (0, volar_service_css_1.default)();
236
237
  services['pug-beautify'] ??= (0, volar_service_pug_beautify_1.default)();
237
- services.json ??= (0, volar_service_json_1.default)(settings?.json);
238
+ services.json ??= (0, volar_service_json_1.default)();
238
239
  services['typescript/twoslash-queries'] ??= (0, volar_service_typescript_twoslash_queries_1.default)();
239
240
  services['vue/referencesCodeLens'] ??= (0, vue_codelens_references_1.default)();
240
241
  services['vue/autoInsertDotValue'] ??= (0, vue_autoinsert_dotvalue_1.default)();
@@ -63,6 +63,7 @@ function isTsDocument(document) {
63
63
  document.languageId === 'javascriptreact' ||
64
64
  document.languageId === 'typescriptreact';
65
65
  }
66
+ const charReg = /\w/;
66
67
  function isCharacterTyping(document, options) {
67
68
  const lastCharacter = options.lastChange.text[options.lastChange.text.length - 1];
68
69
  const rangeStart = options.lastChange.range.start;
@@ -80,7 +81,7 @@ function isCharacterTyping(document, options) {
80
81
  if (options.lastChange.text.indexOf('\n') >= 0) { // multi-line change
81
82
  return false;
82
83
  }
83
- return /\w/.test(lastCharacter) && !/\w/.test(nextCharacter);
84
+ return charReg.test(lastCharacter) && !charReg.test(nextCharacter);
84
85
  }
85
86
  exports.isCharacterTyping = isCharacterTyping;
86
87
  function isBlacklistNode(ts, node, pos, allowAccessDotValue) {
@@ -5,6 +5,7 @@ const cmds = [
5
5
  'vue-skip',
6
6
  'vue-expect-error',
7
7
  ];
8
+ const directiveCommentReg = /<!--\s+@/;
8
9
  const plugin = () => {
9
10
  return {
10
11
  triggerCharacters: ['@'],
@@ -12,7 +13,7 @@ const plugin = () => {
12
13
  if (document.languageId !== 'html')
13
14
  return;
14
15
  const line = document.getText({ start: { line: position.line, character: 0 }, end: position });
15
- const cmdStart = line.match(/<!--\s+@/);
16
+ const cmdStart = line.match(directiveCommentReg);
16
17
  if (!cmdStart)
17
18
  return;
18
19
  const startIndex = cmdStart.index + cmdStart[0].length;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const language_service_1 = require("@volar/language-service");
4
4
  const vue = require("@vue/language-core");
5
+ const twoslashReg = /<!--\s*\^\?\s*-->/g;
5
6
  const plugin = (context, modules) => {
6
7
  if (!context || !modules?.typescript)
7
8
  return {};
@@ -12,7 +13,7 @@ const plugin = (context, modules) => {
12
13
  const hoverOffsets = [];
13
14
  const inlayHints = [];
14
15
  const languageService = context.inject('typescript/languageService');
15
- for (const pointer of document.getText(range).matchAll(/<!--\s*\^\?\s*-->/g)) {
16
+ for (const pointer of document.getText(range).matchAll(twoslashReg)) {
16
17
  const offset = pointer.index + pointer[0].indexOf('^?') + document.offsetAt(range.start);
17
18
  const position = document.positionAt(offset);
18
19
  hoverOffsets.push([position, document.offsetAt({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-service",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -17,28 +17,28 @@
17
17
  "update-html-data": "node ./scripts/update-html-data.js"
18
18
  },
19
19
  "dependencies": {
20
- "@volar/language-core": "~1.8.0",
21
- "@volar/language-service": "~1.8.0",
22
- "@volar/typescript": "~1.8.0",
20
+ "@volar/language-core": "~1.9.0",
21
+ "@volar/language-service": "~1.9.0",
22
+ "@volar/typescript": "~1.9.0",
23
23
  "@vue/compiler-dom": "^3.3.0",
24
- "@vue/language-core": "1.8.4",
24
+ "@vue/language-core": "1.8.5",
25
25
  "@vue/reactivity": "^3.3.0",
26
26
  "@vue/shared": "^3.3.0",
27
- "volar-service-css": "0.0.9",
28
- "volar-service-emmet": "0.0.9",
29
- "volar-service-html": "0.0.9",
30
- "volar-service-json": "0.0.9",
31
- "volar-service-pug": "0.0.9",
32
- "volar-service-pug-beautify": "0.0.9",
33
- "volar-service-typescript": "0.0.9",
34
- "volar-service-typescript-twoslash-queries": "0.0.9",
27
+ "volar-service-css": "0.0.10",
28
+ "volar-service-emmet": "0.0.10",
29
+ "volar-service-html": "0.0.10",
30
+ "volar-service-json": "0.0.10",
31
+ "volar-service-pug": "0.0.10",
32
+ "volar-service-pug-beautify": "0.0.10",
33
+ "volar-service-typescript": "0.0.10",
34
+ "volar-service-typescript-twoslash-queries": "0.0.10",
35
35
  "vscode-html-languageservice": "^5.0.4",
36
36
  "vscode-languageserver-textdocument": "^1.0.8"
37
37
  },
38
38
  "devDependencies": {
39
- "@volar/kit": "~1.8.0",
39
+ "@volar/kit": "~1.9.0",
40
40
  "vscode-languageserver-protocol": "^3.17.3",
41
41
  "vscode-uri": "^3.0.7"
42
42
  },
43
- "gitHead": "a62aa882911de149ae65f4c28eddfd93e1dee99d"
43
+ "gitHead": "971820b55ea42cb7e8c8ba7c35c8998d5572b420"
44
44
  }