@vue/language-core 3.3.5 → 3.3.7

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.
Files changed (72) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +1 -0
  3. package/lib/codegen/codeFeatures.d.ts +24 -84
  4. package/lib/codegen/codeFeatures.js +46 -4
  5. package/lib/codegen/names.d.ts +3 -4
  6. package/lib/codegen/names.js +3 -4
  7. package/lib/codegen/script/index.js +5 -5
  8. package/lib/codegen/script/scriptSetup.js +4 -4
  9. package/lib/codegen/style/common.js +7 -11
  10. package/lib/codegen/style/index.d.ts +55 -27
  11. package/lib/codegen/style/index.js +4 -4
  12. package/lib/codegen/style/modules.d.ts +1 -1
  13. package/lib/codegen/style/modules.js +1 -1
  14. package/lib/codegen/style/scopedClasses.d.ts +2 -1
  15. package/lib/codegen/style/scopedClasses.js +5 -4
  16. package/lib/codegen/template/context.d.ts +55 -124
  17. package/lib/codegen/template/context.js +187 -269
  18. package/lib/codegen/template/element.js +18 -103
  19. package/lib/codegen/template/elementDirectives.js +11 -11
  20. package/lib/codegen/template/elementEvents.js +50 -45
  21. package/lib/codegen/template/elementProps.js +12 -12
  22. package/lib/codegen/template/index.d.ts +55 -27
  23. package/lib/codegen/template/index.js +7 -7
  24. package/lib/codegen/template/interpolation.js +28 -28
  25. package/lib/codegen/template/objectProperty.js +5 -5
  26. package/lib/codegen/template/propertyAccess.js +1 -1
  27. package/lib/codegen/template/slotOutlet.js +8 -10
  28. package/lib/codegen/template/styleScopedClasses.d.ts +3 -0
  29. package/lib/codegen/template/styleScopedClasses.js +126 -4
  30. package/lib/codegen/template/vFor.js +3 -3
  31. package/lib/codegen/template/vIf.js +4 -4
  32. package/lib/codegen/template/vSlot.js +9 -9
  33. package/lib/codegen/utils/boundary.d.ts +7 -2
  34. package/lib/codegen/utils/boundary.js +15 -9
  35. package/lib/codegen/utils/camelized.js +5 -13
  36. package/lib/codegen/utils/escaped.js +4 -9
  37. package/lib/codegen/utils/index.d.ts +1 -1
  38. package/lib/codegen/utils/index.js +3 -3
  39. package/lib/codegen/utils/stringLiteralKey.js +3 -3
  40. package/lib/codegen/utils/unicode.d.ts +1 -1
  41. package/lib/codegen/utils/unicode.js +4 -4
  42. package/lib/languagePlugin.js +2 -1
  43. package/lib/parsers/scriptRanges.d.ts +2 -2
  44. package/lib/parsers/scriptRanges.js +3 -10
  45. package/lib/parsers/scriptSetupRanges.d.ts +2 -2
  46. package/lib/parsers/scriptSetupRanges.js +3 -10
  47. package/lib/parsers/utils.d.ts +1 -0
  48. package/lib/parsers/utils.js +10 -0
  49. package/lib/parsers/vueCompilerOptions.js +2 -2
  50. package/lib/plugins/file-html.js +4 -4
  51. package/lib/plugins/file-md.js +15 -15
  52. package/lib/plugins/file-vue.js +2 -2
  53. package/lib/plugins/vue-root-tags.js +3 -3
  54. package/lib/plugins/vue-sfc-customblocks.js +2 -2
  55. package/lib/plugins/vue-sfc-scripts.js +2 -4
  56. package/lib/plugins/vue-sfc-styles.js +3 -3
  57. package/lib/plugins/vue-sfc-template.js +2 -2
  58. package/lib/plugins/vue-style-css.js +86 -33
  59. package/lib/plugins/vue-template-html.js +3 -3
  60. package/lib/plugins/vue-template-inline-css.js +2 -7
  61. package/lib/plugins/vue-template-inline-ts.js +4 -5
  62. package/lib/plugins/vue-tsx.d.ts +61 -31
  63. package/lib/plugins/vue-tsx.js +26 -23
  64. package/lib/plugins.d.ts +0 -1
  65. package/lib/plugins.js +0 -15
  66. package/lib/types.d.ts +1 -1
  67. package/lib/utils/forEachTemplateNode.js +36 -43
  68. package/lib/virtualCode/index.js +2 -2
  69. package/package.json +4 -4
  70. package/types/template-helpers.d.ts +14 -24
  71. package/lib/plugins/shared.d.ts +0 -2
  72. package/lib/plugins/shared.js +0 -12
@@ -34,13 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const CompilerDOM = __importStar(require("@vue/compiler-dom"));
37
+ const codeFeatures_1 = require("../codegen/codeFeatures");
37
38
  const elementEvents_1 = require("../codegen/template/elementEvents");
38
39
  const templateChild_1 = require("../codegen/template/templateChild");
39
40
  const vFor_1 = require("../codegen/template/vFor");
40
41
  const utils_1 = require("../codegen/utils");
41
- const codeFeatures = {
42
- format: true,
43
- };
44
42
  const formatBrackets = {
45
43
  normal: ['`${', '}`;'],
46
44
  if: ['if (', ') { }'],
@@ -53,6 +51,7 @@ const formatBrackets = {
53
51
  event: ['() => ', ';'],
54
52
  generic: ['<', '>() => {};'],
55
53
  };
54
+ const genericCommentRE = /^<!--\s*@vue-generic\s*\{(?<content>[\s\S]*)\}\s*-->$/;
56
55
  const plugin = ({ modules: { typescript: ts } }) => {
57
56
  const parseds = new WeakMap();
58
57
  return {
@@ -96,7 +95,7 @@ const plugin = ({ modules: { typescript: ts } }) => {
96
95
  return result;
97
96
  function visit(node) {
98
97
  if (node.type === CompilerDOM.NodeTypes.COMMENT) {
99
- const match = node.loc.source.match(/^<!--\s*@vue-generic\s*\{(?<content>[\s\S]*)\}\s*-->$/);
98
+ const match = node.loc.source.match(genericCommentRE);
100
99
  if (match) {
101
100
  const { content } = match.groups;
102
101
  addFormatCodes(content, node.loc.start.offset + node.loc.source.indexOf('{') + 1, formatBrackets.generic);
@@ -221,7 +220,7 @@ const plugin = ({ modules: { typescript: ts } }) => {
221
220
  code,
222
221
  'template',
223
222
  offset,
224
- codeFeatures,
223
+ codeFeatures_1.codeFeatures.format,
225
224
  ],
226
225
  wrapper[1],
227
226
  ]);
@@ -1,6 +1,9 @@
1
1
  import type { IR, VueLanguagePlugin } from '../types';
2
+ export declare const serviceScriptRE: RegExp;
2
3
  export declare const tsCodegen: WeakMap<IR, {
3
4
  getScriptRanges: () => {
5
+ bindings: import("../types").TextRange<import("typescript").Node>[];
6
+ components: import("../types").TextRange<import("typescript").Node>[];
4
7
  exportDefault: (import("../types").TextRange<import("typescript").Node> & {
5
8
  expression: import("../types").TextRange<import("typescript").Expression>;
6
9
  isObjectLiteral: boolean;
@@ -14,14 +17,12 @@ export declare const tsCodegen: WeakMap<IR, {
14
17
  inheritAttrs: string | undefined;
15
18
  };
16
19
  }) | undefined;
17
- bindings: import("../types").TextRange<import("typescript").Node>[];
18
- components: import("../types").TextRange<import("typescript").Node>[];
19
20
  } | undefined;
20
21
  getScriptSetupRanges: () => {
21
- leadingCommentEndOffset: number;
22
- importSectionEndOffset: number;
23
22
  bindings: import("../types").TextRange<import("typescript").Node>[];
24
23
  components: import("../types").TextRange<import("typescript").Node>[];
24
+ leadingCommentEndOffset: number;
25
+ importSectionEndOffset: number;
25
26
  defineModel: import("../parsers/scriptSetupRanges").DefineModel[];
26
27
  defineProps: import("../parsers/scriptSetupRanges").DefineProps | undefined;
27
28
  withDefaults: import("../parsers/scriptSetupRanges").CallExpressionRange | undefined;
@@ -49,8 +50,7 @@ export declare const tsCodegen: WeakMap<IR, {
49
50
  codes: import("../types").Code[];
50
51
  };
51
52
  getGeneratedTemplate: () => {
52
- generatedTypes: Set<string>;
53
- currentInfo: {
53
+ getCommentInfo: () => {
54
54
  ignoreError?: boolean;
55
55
  expectError?: {
56
56
  token: number;
@@ -61,45 +61,75 @@ export declare const tsCodegen: WeakMap<IR, {
61
61
  offset: number;
62
62
  };
63
63
  };
64
+ enter: (node: import("@vue/compiler-dom").RootNode | import("@vue/compiler-dom").TemplateChildNode | import("@vue/compiler-dom").SimpleExpressionNode) => boolean;
65
+ exit: () => Generator<import("../types").Code>;
64
66
  resolveCodeFeatures: (features: import("../types").VueCodeInformation) => import("../types").VueCodeInformation;
65
- inVFor: boolean;
67
+ getInternalVariable: () => string;
68
+ scopes: {
69
+ add(value: string): /*elided*/ any;
70
+ declare(...variables: string[]): void;
71
+ end(): Generator<import("../types").Code, any, any>;
72
+ clear(): void;
73
+ delete(value: string): boolean;
74
+ forEach(callbackfn: (value: string, value2: string, set: Set<string>) => void, thisArg?: any): void;
75
+ has(value: string): boolean;
76
+ readonly size: number;
77
+ [Symbol.iterator](): SetIterator<string>;
78
+ entries(): SetIterator<[string, string]>;
79
+ keys(): SetIterator<string>;
80
+ values(): SetIterator<string>;
81
+ readonly [Symbol.toStringTag]: string;
82
+ }[];
83
+ scope: () => {
84
+ add(value: string): any;
85
+ declare(...variables: string[]): void;
86
+ end(): Generator<import("../types").Code, any, any>;
87
+ clear(): void;
88
+ delete(value: string): boolean;
89
+ forEach(callbackfn: (value: string, value2: string, set: Set<string>) => void, thisArg?: any): void;
90
+ has(value: string): boolean;
91
+ readonly size: number;
92
+ [Symbol.iterator](): SetIterator<string>;
93
+ entries(): SetIterator<[string, string]>;
94
+ keys(): SetIterator<string>;
95
+ values(): SetIterator<string>;
96
+ readonly [Symbol.toStringTag]: string;
97
+ };
98
+ contextAccesses: Map<string, Map<string, Set<number>>>;
99
+ accessVariable: (source: string, name: string, offset?: number) => void;
100
+ generateAutoImport: () => Generator<import("../types").Code>;
101
+ conditions: string[];
102
+ generateConditionGuards: () => Generator<string, void, unknown>;
103
+ hoistVars: Map<string, string>;
104
+ getHoistVariable: (originalVar: string) => string;
105
+ generateHoistVariables: () => Generator<string, void, unknown>;
106
+ templateRefs: Map<string, {
107
+ typeExp: string;
108
+ offset: number;
109
+ }[]>;
110
+ addTemplateRef: (name: string, typeExp: string, offset: number) => void;
111
+ components: (() => string)[];
112
+ dollarVars: Set<string>;
113
+ inlayHints: import("../codegen/inlayHints").InlayHintInfo[];
114
+ generatedTypes: Set<string>;
115
+ inheritedAttrVars: Set<string>;
116
+ singleRootElTypes: Set<string>;
117
+ singleRootNodes: Set<import("@vue/compiler-dom").ElementNode | null>;
66
118
  slots: {
67
119
  name: string;
68
120
  offset?: number;
69
121
  tagRange: [number, number];
70
- nodeLoc: any;
71
122
  propsVar: string;
72
123
  }[];
73
124
  dynamicSlots: {
74
125
  expVar: string;
75
126
  propsVar: string;
76
127
  }[];
77
- dollarVars: Set<string>;
78
- componentAccessMap: Map<string, Map<string, Set<number>>>;
79
- blockConditions: string[];
80
- inlayHints: import("../codegen/inlayHints").InlayHintInfo[];
81
- inheritedAttrVars: Set<string>;
82
- templateRefs: Map<string, {
83
- typeExp: string;
84
- offset: number;
85
- }[]>;
86
- singleRootElTypes: Set<string>;
87
- singleRootNodes: Set<import("@vue/compiler-dom").ElementNode | null>;
88
- addTemplateRef(name: string, typeExp: string, offset: number): void;
89
- recordComponentAccess(source: string, name: string, offset?: number): void;
90
- scopes: Set<string>[];
91
- components: (() => string)[];
92
- declare(...varNames: string[]): void;
93
- startScope(): () => Generator<import("../types").Code, any, any>;
94
- getInternalVariable(): string;
95
- getHoistVariable(originalVar: string): string;
96
- generateHoistVariables(): Generator<string, void, unknown>;
97
- generateConditionGuards(): Generator<string, void, unknown>;
98
- enter(node: import("@vue/compiler-dom").RootNode | import("@vue/compiler-dom").TemplateChildNode | import("@vue/compiler-dom").SimpleExpressionNode): boolean;
99
- exit(): Generator<import("../types").Code>;
128
+ inVFor: boolean;
100
129
  codes: import("../types").Code[];
101
130
  } | undefined;
102
131
  getImportedComponents: () => Set<string>;
132
+ getSetupBindings: () => Set<string>;
103
133
  getSetupExposed: () => Set<string>;
104
134
  }>;
105
135
  declare const plugin: VueLanguagePlugin;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.tsCodegen = void 0;
36
+ exports.tsCodegen = exports.serviceScriptRE = void 0;
37
37
  const shared_1 = require("@vue/shared");
38
38
  const alien_signals_1 = require("alien-signals");
39
39
  const path = __importStar(require("path-browserify"));
@@ -45,6 +45,7 @@ const scriptRanges_1 = require("../parsers/scriptRanges");
45
45
  const scriptSetupRanges_1 = require("../parsers/scriptSetupRanges");
46
46
  const vueCompilerOptions_1 = require("../parsers/vueCompilerOptions");
47
47
  const signals_1 = require("../utils/signals");
48
+ exports.serviceScriptRE = /^script_(?:js|jsx|ts|tsx)$/;
48
49
  exports.tsCodegen = new WeakMap();
49
50
  const validLangs = new Set(['js', 'jsx', 'ts', 'tsx']);
50
51
  const plugin = ({ modules: { typescript: ts }, vueCompilerOptions, }) => {
@@ -55,7 +56,7 @@ const plugin = ({ modules: { typescript: ts }, vueCompilerOptions, }) => {
55
56
  return [{ lang, id: 'script_' + lang }];
56
57
  },
57
58
  resolveEmbeddedCode(fileName, ir, embeddedFile) {
58
- if (/script_(js|jsx|ts|tsx)/.test(embeddedFile.id)) {
59
+ if (exports.serviceScriptRE.test(embeddedFile.id)) {
59
60
  let codegen = exports.tsCodegen.get(ir);
60
61
  if (!codegen) {
61
62
  exports.tsCodegen.set(ir, codegen = useCodegen(ts, vueCompilerOptions, fileName, ir));
@@ -114,6 +115,22 @@ function useCodegen(ts, vueCompilerOptions, fileName, ir) {
114
115
  }
115
116
  return names;
116
117
  });
118
+ const getSetupBindings = (0, signals_1.computedSet)(() => {
119
+ const names = new Set();
120
+ const scriptSetupRanges = getScriptSetupRanges();
121
+ if (ir.scriptSetup && scriptSetupRanges) {
122
+ for (const range of scriptSetupRanges.bindings) {
123
+ names.add(ir.scriptSetup.content.slice(range.start, range.end));
124
+ }
125
+ const scriptRanges = getScriptRanges();
126
+ if (ir.script && scriptRanges) {
127
+ for (const range of scriptRanges.bindings) {
128
+ names.add(ir.script.content.slice(range.start, range.end));
129
+ }
130
+ }
131
+ }
132
+ return names;
133
+ });
117
134
  const getSetupConsts = (0, signals_1.computedSet)(() => {
118
135
  const scriptSetupRanges = getScriptSetupRanges();
119
136
  const names = new Set([
@@ -187,30 +204,15 @@ function useCodegen(ts, vueCompilerOptions, fileName, ir) {
187
204
  });
188
205
  });
189
206
  const getSetupExposed = (0, signals_1.computedSet)(() => {
190
- const allVars = new Set();
191
- const scriptSetupRanges = getScriptSetupRanges();
192
- if (!ir.scriptSetup || !scriptSetupRanges) {
193
- return allVars;
194
- }
195
- for (const range of scriptSetupRanges.bindings) {
196
- const name = ir.scriptSetup.content.slice(range.start, range.end);
197
- allVars.add(name);
198
- }
199
- const scriptRanges = getScriptRanges();
200
- if (ir.script && scriptRanges) {
201
- for (const range of scriptRanges.bindings) {
202
- const name = ir.script.content.slice(range.start, range.end);
203
- allVars.add(name);
204
- }
205
- }
206
- if (!allVars.size) {
207
- return allVars;
207
+ const bindings = getSetupBindings();
208
+ if (!bindings.size) {
209
+ return bindings;
208
210
  }
209
211
  return new Set([
210
- ...getGeneratedTemplate()?.componentAccessMap.keys() ?? [],
211
- ...getGeneratedStyle()?.componentAccessMap.keys() ?? [],
212
+ ...getGeneratedTemplate()?.contextAccesses.keys() ?? [],
213
+ ...getGeneratedStyle()?.contextAccesses.keys() ?? [],
212
214
  ...ir.template?.ast?.components.flatMap(name => [(0, shared_1.camelize)(name), (0, shared_1.capitalize)((0, shared_1.camelize)(name))]) ?? [],
213
- ].filter(name => allVars.has(name)));
215
+ ].filter(name => bindings.has(name)));
214
216
  });
215
217
  const getGeneratedScript = (0, alien_signals_1.computed)(() => {
216
218
  return (0, script_1.generateScript)({
@@ -237,6 +239,7 @@ function useCodegen(ts, vueCompilerOptions, fileName, ir) {
237
239
  getGeneratedScript,
238
240
  getGeneratedTemplate,
239
241
  getImportedComponents,
242
+ getSetupBindings,
240
243
  getSetupExposed,
241
244
  };
242
245
  }
package/lib/plugins.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  import { type VueLanguagePlugin } from './types';
2
- export * from './plugins/shared';
3
2
  export declare function createPlugins(pluginContext: Parameters<VueLanguagePlugin>[0]): import("./types").VueLanguagePluginReturn[];
package/lib/plugins.js CHANGED
@@ -1,18 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
17
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
4
  };
@@ -33,7 +19,6 @@ const vue_template_inline_css_1 = __importDefault(require("./plugins/vue-templat
33
19
  const vue_template_inline_ts_1 = __importDefault(require("./plugins/vue-template-inline-ts"));
34
20
  const vue_tsx_1 = __importDefault(require("./plugins/vue-tsx"));
35
21
  const types_1 = require("./types");
36
- __exportStar(require("./plugins/shared"), exports);
37
22
  function createPlugins(pluginContext) {
38
23
  const plugins = [
39
24
  file_vue_1.default,
package/lib/types.d.ts CHANGED
@@ -71,7 +71,7 @@ export interface VueCompilerOptions {
71
71
  }
72
72
  export declare const validVersions: readonly [2, 2.1, 2.2];
73
73
  export interface VueLanguagePluginReturn {
74
- version: (typeof validVersions)[number];
74
+ version: typeof validVersions[number];
75
75
  name?: string;
76
76
  order?: number;
77
77
  requiredCompilerOptions?: string[];
@@ -37,61 +37,54 @@ exports.forEachElementNode = forEachElementNode;
37
37
  exports.forEachInterpolationNode = forEachInterpolationNode;
38
38
  const CompilerDOM = __importStar(require("@vue/compiler-dom"));
39
39
  function* forEachElementNode(node) {
40
- if (node.type === CompilerDOM.NodeTypes.ROOT) {
41
- for (const child of node.children) {
42
- yield* forEachElementNode(child);
40
+ switch (node.type) {
41
+ case CompilerDOM.NodeTypes.ELEMENT: {
42
+ yield node;
43
43
  }
44
- }
45
- else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
46
- yield node;
47
- for (const child of node.children) {
48
- yield* forEachElementNode(child);
49
- }
50
- }
51
- else if (node.type === CompilerDOM.NodeTypes.IF) {
52
- for (const branch of node.branches) {
53
- for (const childNode of branch.children) {
54
- yield* forEachElementNode(childNode);
44
+ case CompilerDOM.NodeTypes.IF_BRANCH:
45
+ case CompilerDOM.NodeTypes.FOR:
46
+ case CompilerDOM.NodeTypes.ROOT: {
47
+ for (const child of node.children) {
48
+ yield* forEachElementNode(child);
55
49
  }
50
+ break;
56
51
  }
57
- }
58
- else if (node.type === CompilerDOM.NodeTypes.FOR) {
59
- for (const child of node.children) {
60
- yield* forEachElementNode(child);
52
+ case CompilerDOM.NodeTypes.IF: {
53
+ for (const branch of node.branches) {
54
+ yield* forEachElementNode(branch);
55
+ }
56
+ break;
61
57
  }
62
58
  }
63
59
  }
64
60
  function* forEachInterpolationNode(node) {
65
- if (node.type === CompilerDOM.NodeTypes.ROOT) {
66
- for (const child of node.children) {
67
- yield* forEachInterpolationNode(child);
68
- }
69
- }
70
- else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
71
- for (const child of node.children) {
72
- yield* forEachInterpolationNode(child);
73
- }
74
- }
75
- else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) {
76
- for (const child of node.children) {
77
- if (typeof child === 'object') {
61
+ switch (node.type) {
62
+ case CompilerDOM.NodeTypes.ELEMENT:
63
+ case CompilerDOM.NodeTypes.IF_BRANCH:
64
+ case CompilerDOM.NodeTypes.FOR:
65
+ case CompilerDOM.NodeTypes.ROOT: {
66
+ for (const child of node.children) {
78
67
  yield* forEachInterpolationNode(child);
79
68
  }
69
+ break;
80
70
  }
81
- }
82
- else if (node.type === CompilerDOM.NodeTypes.INTERPOLATION) {
83
- yield node;
84
- }
85
- else if (node.type === CompilerDOM.NodeTypes.IF) {
86
- for (const branch of node.branches) {
87
- for (const childNode of branch.children) {
88
- yield* forEachInterpolationNode(childNode);
71
+ case CompilerDOM.NodeTypes.IF: {
72
+ for (const branch of node.branches) {
73
+ yield* forEachInterpolationNode(branch);
89
74
  }
75
+ break;
90
76
  }
91
- }
92
- else if (node.type === CompilerDOM.NodeTypes.FOR) {
93
- for (const child of node.children) {
94
- yield* forEachInterpolationNode(child);
77
+ case CompilerDOM.NodeTypes.COMPOUND_EXPRESSION: {
78
+ for (const child of node.children) {
79
+ if (typeof child === 'object') {
80
+ yield* forEachInterpolationNode(child);
81
+ }
82
+ }
83
+ break;
84
+ }
85
+ case CompilerDOM.NodeTypes.INTERPOLATION: {
86
+ yield node;
87
+ break;
95
88
  }
96
89
  }
97
90
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VueVirtualCode = void 0;
4
4
  const alien_signals_1 = require("alien-signals");
5
- const plugins_1 = require("../plugins");
5
+ const codeFeatures_1 = require("../codegen/codeFeatures");
6
6
  const embeddedCodes_1 = require("./embeddedCodes");
7
7
  const ir_1 = require("./ir");
8
8
  class VueVirtualCode {
@@ -40,7 +40,7 @@ class VueVirtualCode {
40
40
  sourceOffsets: [0],
41
41
  generatedOffsets: [0],
42
42
  lengths: [this._snapshot().getLength()],
43
- data: plugins_1.allCodeFeatures,
43
+ data: codeFeatures_1.codeFeatures.full,
44
44
  }];
45
45
  });
46
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-core",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "index.d.ts",
@@ -22,17 +22,17 @@
22
22
  "@volar/language-core": "2.4.28",
23
23
  "@vue/compiler-dom": "^3.5.0",
24
24
  "@vue/shared": "^3.5.0",
25
- "alien-signals": "^3.2.0",
25
+ "alien-signals": "^3.2.1",
26
26
  "muggle-string": "^0.4.1",
27
27
  "path-browserify": "^1.0.1",
28
28
  "picomatch": "^4.0.4"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/node": "^24.1.0",
31
+ "@types/node": "^26.0.1",
32
32
  "@types/path-browserify": "^1.0.3",
33
33
  "@types/picomatch": "^4.0.3",
34
34
  "@volar/typescript": "2.4.28",
35
35
  "@vue/compiler-sfc": "^3.5.0"
36
36
  },
37
- "gitHead": "2fe255ca6d5809c93b71ec8185ec14562cff5945"
37
+ "gitHead": "f6cc297eb9b2fddb3bed535b099b9697c909764d"
38
38
  }
@@ -21,25 +21,16 @@ declare global {
21
21
  : N2 extends keyof GlobalComponents ? { [K in N0]: GlobalComponents[N2] }
22
22
  : N3 extends keyof GlobalComponents ? { [K in N0]: GlobalComponents[N3] }
23
23
  : {};
24
- type __VLS_FunctionalComponentCtx<T, K> = __VLS_PickNotAny<
24
+ type __VLS_ExtractComponentContext<T, K> = __VLS_PickNotAny<
25
25
  '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? NonNullable<Ctx> : never : any,
26
26
  T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
27
27
  >;
28
- type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
28
+ type __VLS_ExtractComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
29
29
  ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
30
30
  : T extends (props: infer P, ...args: any) => any ? P
31
31
  : {};
32
- type __VLS_FunctionalComponent0<T> = (props: T extends { $props: infer Props } ? Props : {}, ctx?: any) => {
33
- __ctx?: {
34
- attrs?: any;
35
- slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>;
36
- emit?: T extends { $emit: infer Emit } ? Emit : {};
37
- props?: typeof props;
38
- expose?: (exposed: T) => void;
39
- };
40
- };
41
- type __VLS_FunctionalComponent1<T> = (
42
- props: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>,
32
+ type __VLS_FunctionalComponent<T, P = {}> = (
33
+ props: (T extends { $props: infer Props } ? Props : {}) & P,
43
34
  ctx?: any,
44
35
  ) => {
45
36
  __ctx?: {
@@ -50,9 +41,8 @@ declare global {
50
41
  expose?: (exposed: T) => void;
51
42
  };
52
43
  };
53
- type __VLS_IsFunction<T, K> = K extends keyof T ? __VLS_IsAny<T[K]> extends false ? unknown extends T[K] ? false
54
- : true
55
- : false
44
+ type __VLS_IsFunction<T, K> = K extends keyof T ? unknown extends T[K] ? false
45
+ : true
56
46
  : false;
57
47
  type __VLS_ResolveEvent<
58
48
  Props,
@@ -123,20 +113,20 @@ declare global {
123
113
  >
124
114
  : T extends (...args: any) => any ? T
125
115
  : (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
126
- function __VLS_asFunctionalComponent0<T, K = T extends new(...args: any) => any ? InstanceType<T> : unknown>(
116
+ function __VLS_asFunctionalComponent0<T, K>(
127
117
  t: T,
128
- instance?: K,
129
- ): T extends new(...args: any) => any ? __VLS_FunctionalComponent0<K>
118
+ instance: K,
119
+ ): T extends new(...args: any) => any ? __VLS_FunctionalComponent<K>
130
120
  : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
131
121
  : T extends (...args: any) => any ? T
132
- : __VLS_FunctionalComponent0<{}>;
133
- function __VLS_asFunctionalComponent1<T, K = T extends new(...args: any) => any ? InstanceType<T> : unknown>(
122
+ : __VLS_FunctionalComponent<{}>;
123
+ function __VLS_asFunctionalComponent1<T, K>(
134
124
  t: T,
135
- instance?: K,
136
- ): T extends new(...args: any) => any ? __VLS_FunctionalComponent1<K>
125
+ instance: K,
126
+ ): T extends new(...args: any) => any ? __VLS_FunctionalComponent<K, Record<string, unknown>>
137
127
  : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
138
128
  : T extends (...args: any) => any ? T
139
- : __VLS_FunctionalComponent1<{}>;
129
+ : __VLS_FunctionalComponent<{}, Record<string, unknown>>;
140
130
  function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(
141
131
  t: T,
142
132
  ): 2 extends Parameters<T>['length'] ? [any] : [];
@@ -1,2 +0,0 @@
1
- import type { CodeInformation } from '@volar/language-core';
2
- export declare const allCodeFeatures: CodeInformation;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allCodeFeatures = void 0;
4
- exports.allCodeFeatures = {
5
- verification: true,
6
- completion: true,
7
- semantic: true,
8
- navigation: true,
9
- structure: true,
10
- format: true,
11
- };
12
- //# sourceMappingURL=shared.js.map