Skip to content

Commit

Permalink
fix: withDefaults syntax break in lang="tsx"
Browse files Browse the repository at this point in the history
close #1458
  • Loading branch information
johnsoncodehk committed Jun 16, 2022
1 parent 66083fc commit d3fcc7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/vue-code-gen/src/generators/script.ts
Expand Up @@ -328,7 +328,7 @@ export function generate(

if (scriptSetupRanges.propsTypeArg && scriptSetupRanges?.withDefaultsArg) {
// fix https://github.com/johnsoncodehk/volar/issues/1187
codeGen.addText(`const __VLS_withDefaultsArg = (<T>(t: T) => t)(`);
codeGen.addText(`const __VLS_withDefaultsArg = (function <T>(t: T) { return t })(`);
addExtraReferenceVirtualCode('scriptSetup', scriptSetupRanges.withDefaultsArg.start, scriptSetupRanges.withDefaultsArg.end);
codeGen.addText(`);\n`);
}
Expand Down
4 changes: 1 addition & 3 deletions packages/vue-language-server/src/project.ts
Expand Up @@ -256,9 +256,7 @@ export async function createProject(
readFile: projectSys.readFile,
};
if (typeof tsConfig === 'string') {
const r = tsShared.createParsedCommandLine(ts, parseConfigHost, tsConfig);
console.log(r.fileNames);
return r;
return tsShared.createParsedCommandLine(ts, parseConfigHost, tsConfig);
}
else {
const content = ts.parseJsonConfigFileContent({}, parseConfigHost, rootPath, tsConfig, 'tsconfig.json');
Expand Down

0 comments on commit d3fcc7f

Please sign in to comment.