@vue/language-core 1.8.1 → 1.8.2

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.
@@ -113,7 +113,7 @@ function generate(ts, fileName, _sfc, lang, scriptRanges, scriptSetupRanges, htm
113
113
  }
114
114
  codes.push(`type __VLS_NormalizeEmits<T> = __VLS_ConstructorOverloads<T> & {
115
115
  [K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never
116
- }`);
116
+ }\n`);
117
117
  ;
118
118
  }
119
119
  if (usedHelperTypes.WithTemplateSlots) {
@@ -648,7 +648,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
648
648
  const templateStart = (0, source_map_1.getLength)(codes);
649
649
  codes.push(varName);
650
650
  const templateEnd = (0, source_map_1.getLength)(codes);
651
- codes.push(`: `);
651
+ codes.push(`: {} as typeof `);
652
652
  const scriptStart = (0, source_map_1.getLength)(codes);
653
653
  codes.push(varName);
654
654
  const scriptEnd = (0, source_map_1.getLength)(codes);
@@ -490,7 +490,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
490
490
  codes.push(`const ${var_originalComponent} = `, ...createInterpolationCode(tag, node.loc, startTagOffset, capabilitiesPresets.all, '', ''), ';\n');
491
491
  }
492
492
  else if (dynamicTagExp) {
493
- codes.push(`const ${var_originalComponent} = `, ...createInterpolationCode(dynamicTagExp.loc.source, dynamicTagExp.loc, dynamicTagExp.loc.start.offset, capabilitiesPresets.all, '', ''), ';\n');
493
+ codes.push(`const ${var_originalComponent} = `, ...createInterpolationCode(dynamicTagExp.loc.source, dynamicTagExp.loc, dynamicTagExp.loc.start.offset, capabilitiesPresets.all, '(', ')'), ';\n');
494
494
  }
495
495
  else if (componentVars[tag]) {
496
496
  codes.push(`const ${var_originalComponent} = __VLS_templateComponents['${componentVars[tag]}'];\n`);
@@ -1210,7 +1210,7 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
1210
1210
  function createFormatCode(mapCode, sourceOffset, formatWrapper) {
1211
1211
  return [
1212
1212
  formatWrapper[0],
1213
- [mapCode, 'template', sourceOffset, {}],
1213
+ [mapCode, 'template', sourceOffset, { completion: true /* fix vue-autoinsert-parentheses not working */ }],
1214
1214
  formatWrapper[1],
1215
1215
  '\n',
1216
1216
  ];
@@ -1229,17 +1229,18 @@ function generate(ts, compilerOptions, vueCompilerOptions, sourceTemplate, sourc
1229
1229
  return createStringLiteralKeyCode(a);
1230
1230
  }
1231
1231
  }
1232
- function createInterpolationCode(code, astHolder, start, data, prefix, suffix) {
1233
- const ast = createTsAst(astHolder, prefix + code + suffix);
1232
+ function createInterpolationCode(_code, astHolder, start, data, prefix, suffix) {
1233
+ const code = prefix + _code + suffix;
1234
+ const ast = createTsAst(astHolder, code);
1234
1235
  const codes = [];
1235
- const vars = (0, transform_1.walkInterpolationFragment)(ts, prefix + code + suffix, ast, (frag, fragOffset, isJustForErrorMapping) => {
1236
+ const vars = (0, transform_1.walkInterpolationFragment)(ts, code, ast, (frag, fragOffset, isJustForErrorMapping) => {
1236
1237
  if (fragOffset === undefined) {
1237
1238
  codes.push(frag);
1238
1239
  }
1239
1240
  else {
1240
1241
  fragOffset -= prefix.length;
1241
1242
  let addSuffix = '';
1242
- const overLength = fragOffset + frag.length - code.length;
1243
+ const overLength = fragOffset + frag.length - _code.length;
1243
1244
  if (overLength > 0) {
1244
1245
  addSuffix = frag.substring(frag.length - overLength);
1245
1246
  frag = frag.substring(0, frag.length - overLength);
package/out/sourceFile.js CHANGED
@@ -358,9 +358,7 @@ class VueFile {
358
358
  block.content,
359
359
  undefined,
360
360
  block.startTagEnd,
361
- block.name === 'template'
362
- ? { completion: true } // fix vue-autoinsert-parentheses not working
363
- : {},
361
+ {},
364
362
  ]);
365
363
  }
366
364
  }
@@ -101,7 +101,7 @@ declare function __VLS_pickEvent<Emit, K, E>(emit: Emit, emitKey: K, event: E):
101
101
  __VLS_AsFunctionOrAny<E>,
102
102
  __VLS_AsFunctionOrAny<__VLS_EmitEvent<Emit, K>>
103
103
  >
104
- >;
104
+ > | undefined;
105
105
  declare function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): __VLS_PickNotAny<
106
106
  K extends { __ctx?: infer Ctx } ? Ctx : any,
107
107
  T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-core",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -13,8 +13,8 @@
13
13
  "directory": "packages/vue-language-core"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-core": "1.7.8",
17
- "@volar/source-map": "1.7.8",
16
+ "@volar/language-core": "1.7.9",
17
+ "@volar/source-map": "1.7.9",
18
18
  "@vue/compiler-dom": "^3.3.0",
19
19
  "@vue/reactivity": "^3.3.0",
20
20
  "@vue/shared": "^3.3.0",
@@ -34,5 +34,5 @@
34
34
  "optional": true
35
35
  }
36
36
  },
37
- "gitHead": "3e31c6eb412a9e8145188190472f59c8b43aa9e6"
37
+ "gitHead": "de0fb3f1be30b495d17e2999aee24fb9ea3e7e0e"
38
38
  }