Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Aug 22, 2024
1 parent be0e5b8 commit 88bff5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/language-core/lib/languagePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export function createVueLanguagePlugin2<T>(
asFileName: (scriptId: T) => string,
isRootFile: (fileName: string) => boolean,
compilerOptions: ts.CompilerOptions,
vueCompilerOptions: VueCompilerOptions
vueCompilerOptions: VueCompilerOptions,
test?: boolean
): LanguagePlugin<T, VueVirtualCode> {
const pluginContext: Parameters<VueLanguagePlugin>[0] = {
modules: {
Expand All @@ -107,6 +108,7 @@ export function createVueLanguagePlugin2<T>(
compilerOptions,
vueCompilerOptions,
globalTypesHolder: undefined,
test,
};
const plugins = createPlugins(pluginContext);

Expand Down
4 changes: 2 additions & 2 deletions packages/language-core/lib/plugins/vue-tsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function createTsx(
compilerOptions: ctx.compilerOptions,
vueCompilerOptions: ctx.vueCompilerOptions,
template: _sfc.template,
edited: (fileEditTimes.get(fileName) ?? 0) >= 2,
edited: ctx.test || (fileEditTimes.get(fileName) ?? 0) >= 2,
scriptSetupBindingNames: scriptSetupBindingNames(),
scriptSetupImportComponentNames: scriptSetupImportComponentNames(),
hasDefineSlots: hasDefineSlots(),
Expand Down Expand Up @@ -154,7 +154,7 @@ function createTsx(
templateCodegen: _template,
compilerOptions: ctx.compilerOptions,
vueCompilerOptions: ctx.vueCompilerOptions,
edited: (fileEditTimes.get(fileName) ?? 0) >= 2,
edited: ctx.test || (fileEditTimes.get(fileName) ?? 0) >= 2,
getGeneratedLength: () => generatedLength,
linkedCodeMappings,
});
Expand Down
1 change: 1 addition & 0 deletions packages/language-core/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export type VueLanguagePlugin = (ctx: {
compilerOptions: ts.CompilerOptions;
vueCompilerOptions: VueCompilerOptions;
globalTypesHolder: string | undefined;
test?: boolean;
}) => VueLanguagePluginReturn | VueLanguagePluginReturn[];

export interface SfcBlock {
Expand Down

0 comments on commit 88bff5a

Please sign in to comment.