@vue/language-core 3.0.0 → 3.0.1

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.
@@ -29,8 +29,7 @@ function* generateVSlot(options, ctx, node, slotDir) {
29
29
  }
30
30
  else {
31
31
  // #932: reference for implicit default slot
32
- const { start, end } = getElementInnerLoc(options, node);
33
- yield* (0, wrapWith_1.wrapWith)(start, end, ctx.codeFeatures.navigation, `default`);
32
+ yield* (0, wrapWith_1.wrapWith)(node.loc.start.offset, node.loc.end.offset, ctx.codeFeatures.navigation, `default`);
34
33
  }
35
34
  yield `: ${slotVar} } = ${ctx.currentComponent.ctxVar}.slots!${utils_1.endOfLine}`;
36
35
  }
@@ -47,9 +46,8 @@ function* generateVSlot(options, ctx, node, slotDir) {
47
46
  ctx.removeLocalVariable(varName);
48
47
  }
49
48
  if (options.vueCompilerOptions.strictSlotChildren && node.children.length) {
50
- const { start, end } = getElementInnerLoc(options, node);
51
49
  yield `(): __VLS_NormalizeSlotReturns<typeof ${slotVar}> => (`;
52
- yield* (0, wrapWith_1.wrapWith)(start, end, ctx.codeFeatures.verification, `{} as [`, ...ctx.currentComponent.childTypes.map(name => `${name}, `), `]`);
50
+ yield* (0, wrapWith_1.wrapWith)(node.loc.start.offset, node.loc.end.offset, ctx.codeFeatures.verification, `{} as [`, ...ctx.currentComponent.childTypes.map(name => `${name}, `), `]`);
53
51
  yield `)${utils_1.endOfLine}`;
54
52
  }
55
53
  if (slotDir) {
@@ -120,26 +118,4 @@ function* generateSlotParameters(options, ctx, ast, exp, slotVar) {
120
118
  ];
121
119
  }
122
120
  }
123
- function getElementInnerLoc(options, node) {
124
- if (node.children.length) {
125
- let start = node.children[0].loc.start.offset;
126
- let end = node.children.at(-1).loc.end.offset;
127
- while (options.template.content[start - 1] !== '>') {
128
- start--;
129
- }
130
- while (options.template.content[end] !== '<' && end < node.loc.end.offset) {
131
- end++;
132
- }
133
- return {
134
- start,
135
- end,
136
- };
137
- }
138
- else {
139
- return {
140
- start: node.loc.start.offset,
141
- end: node.loc.end.offset,
142
- };
143
- }
144
- }
145
121
  //# sourceMappingURL=vSlot.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-core",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -13,7 +13,7 @@
13
13
  "directory": "packages/language-core"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-core": "2.4.16",
16
+ "@volar/language-core": "2.4.17",
17
17
  "@vue/compiler-dom": "^3.5.0",
18
18
  "@vue/compiler-vue2": "^2.7.16",
19
19
  "@vue/shared": "^3.5.0",
@@ -25,7 +25,7 @@
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.10.4",
27
27
  "@types/path-browserify": "^1.0.1",
28
- "@volar/typescript": "2.4.16",
28
+ "@volar/typescript": "2.4.17",
29
29
  "@vue/compiler-sfc": "^3.5.0"
30
30
  },
31
31
  "peerDependencies": {
@@ -36,5 +36,5 @@
36
36
  "optional": true
37
37
  }
38
38
  },
39
- "gitHead": "620f050fd494cccd215781907c950e17dae4fd58"
39
+ "gitHead": "43884409838dfdce44de51f6622926ac6ddd7318"
40
40
  }