Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/language-tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 12eef58d49386dde0becd24e18d5973bfd2ab516
Choose a base ref
..
head repository: vuejs/language-tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 309c31e1917101c77a81e13609394a1468a4b557
Choose a head ref
Showing with 5 additions and 5 deletions.
  1. +3 −3 packages/language-service/lib/plugins/vue-template.ts
  2. +2 −2 packages/typescript-plugin/lib/requests/collectExtractProps.ts
6 changes: 3 additions & 3 deletions packages/language-service/lib/plugins/vue-template.ts
Original file line number Diff line number Diff line change
@@ -449,7 +449,7 @@ export function create(
}

for (const binding of scriptSetupRanges?.bindings ?? []) {
const name = vueCode.sfc.scriptSetup.content.substring(binding.start, binding.end);
const name = vueCode.sfc.scriptSetup!.content.substring(binding.start, binding.end);
if (casing.tag === TagNameCasing.Kebab) {
names.add(hyphenateTag(name));
}
@@ -498,8 +498,8 @@ export function create(
return [];
}
let ctxVars = [
..._tsCodegen.scriptRanges()?.bindings.map(binding => vueCode.sfc.script.content.substring(binding.start, binding.end)) ?? [],
..._tsCodegen.scriptSetupRanges()?.bindings.map(binding => vueCode.sfc.scriptSetup.content.substring(binding.start, binding.end)) ?? [],
..._tsCodegen.scriptRanges()?.bindings.map(binding => vueCode.sfc.script!.content.substring(binding.start, binding.end)) ?? [],
..._tsCodegen.scriptSetupRanges()?.bindings.map(binding => vueCode.sfc.scriptSetup!.content.substring(binding.start, binding.end)) ?? [],
...templateContextProps,
];
ctxVars = [...new Set(ctxVars)];
Original file line number Diff line number Diff line change
@@ -47,8 +47,8 @@ export function collectExtractProps(
const source = map.getSourceOffset(name.getEnd() - (isTsPlugin ? volarFile.snapshot.getLength() : 0));
if (
source
&& source[0] >= sfc.template.startTagEnd + templateCodeRange[0]
&& source[0] <= sfc.template.startTagEnd + templateCodeRange[1]
&& source[0] >= sfc.template!.startTagEnd + templateCodeRange[0]
&& source[0] <= sfc.template!.startTagEnd + templateCodeRange[1]
&& isSemanticTokensEnabled(source[1].data)
) {
if (!result.has(name.text)) {