Skip to content

Commit

Permalink
fix: sync volar usage (vuejs#3357)
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Jul 4, 2023
1 parent 13268dd commit f7dda2a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vue-component-meta/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function createComponentMetaCheckerWorker(
const scriptSnapshots = new Map<string, ts.IScriptSnapshot>();
const _host: vue.TypeScriptLanguageHost = {
getCurrentDirectory: () => rootPath,
getProjectVersion: () => projectVersion,
getProjectVersion: () => projectVersion.toString(),
getCompilationSettings: () => parsedCommandLine.options,
getScriptFileNames: () => fileNames,
getProjectReferences: () => parsedCommandLine.projectReferences,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-language-service/tests/utils/createTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function createTester(root: string) {
parsedCommandLine.fileNames = parsedCommandLine.fileNames.map(fileName => fileName.replace(/\\/g, '/'));
const scriptSnapshots = new Map<string, ts.IScriptSnapshot>();
const host: TypeScriptLanguageHost = {
getProjectVersion: () => 0,
getProjectVersion: () => '0',
getScriptFileNames: () => parsedCommandLine.fileNames,
getCurrentDirectory: () => root.replace(/\\/g, '/'),
getCompilationSettings: () => parsedCommandLine.options,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-tsc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function createProgram(options: ts.CreateProgramOptions) {
},
getScriptSnapshot,
getProjectVersion: () => {
return ctx.projectVersion;
return ctx.projectVersion.toString();
},
getProjectReferences: () => ctx.options.projectReferences,
getCurrentDirectory: () => ctx.options.host!.getCurrentDirectory().replace(/\\/g, '/'),
Expand Down

0 comments on commit f7dda2a

Please sign in to comment.