Skip to content

Commit 75211c2

Browse files
committed
refactor(language-core): do not generate /* PartiallyEnd */ to virtual code
1 parent 39d2682 commit 75211c2

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

packages/language-core/lib/codegen/script/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ export function* generateConstExport(
148148
block: SfcBlock,
149149
): Generator<Code> {
150150
if (options.script) {
151+
// #3632
151152
yield* generatePartiallyEnding(
152153
options.script.name,
153154
options.scriptRanges?.exportDefault?.start ?? options.script.content.length,
154-
'#3632/script.vue',
155155
);
156156
}
157157
yield `const `;

packages/language-core/lib/codegen/script/scriptSetup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ function* generateSetupFunction(
308308
transforms,
309309
(start, end) => generateSfcBlockSection(scriptSetup, start, end, codeFeatures.all),
310310
);
311-
yield* generatePartiallyEnding(scriptSetup.name, scriptSetup.content.length, '#3632/scriptSetup.vue');
311+
// #3632
312+
yield* generatePartiallyEnding(scriptSetup.name, scriptSetup.content.length);
312313
yield* generateMacros(options, ctx);
313314

314315
const hasSlots = !!(

packages/language-core/lib/codegen/utils/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@ export function generateSfcBlockSection(
4848
];
4949
}
5050

51-
export function* generatePartiallyEnding(
52-
source: string,
53-
end: number,
54-
mark: string,
55-
delimiter = 'debugger',
56-
): Generator<Code> {
57-
yield delimiter;
51+
export function* generatePartiallyEnding(source: string, end: number): Generator<Code> {
52+
yield `debugger`;
5853
yield [``, source, end, codeFeatures.verification];
59-
yield `/* PartiallyEnd: ${mark} */${newLine}`;
54+
yield newLine;
6055
}

0 commit comments

Comments
 (0)