Skip to content

Commit

Permalink
chore: compilerOptions -> vueCompilerOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Mar 15, 2022
1 parent 3a0a45f commit ab4ef20
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/typescript-vue-plugin/src/index.ts
Expand Up @@ -25,8 +25,8 @@ const init: ts.server.PluginModuleFactory = (modules) => {

const proxyHost = createProxyHost(ts, info);
const services = createBasicRuntime();
const compilerOptions = proxyHost.host.getVueCompilationSettings?.() ?? {};
const tsRuntime = vue.createTypeScriptRuntime({ typescript: ts, ...services, compilerOptions }, proxyHost.host, true);
const vueCompilerOptions = proxyHost.host.getVueCompilationSettings?.() ?? {};
const tsRuntime = vue.createTypeScriptRuntime({ typescript: ts, ...services, vueCompilerOptions }, proxyHost.host, true);
const _tsPluginApis = apis.register(tsRuntime.context);
const tsPluginProxy: Partial<ts.LanguageService> = {
getSemanticDiagnostics: tsRuntime.apiHook(tsRuntime.context.scriptTsLsRaw.getSemanticDiagnostics, false),
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-tsc/src/proxy.ts
Expand Up @@ -38,7 +38,7 @@ export function createProgramProxy(
getProjectReferences: () => options.projectReferences,
};
const services = createBasicRuntime();
const tsRuntime = createTypeScriptRuntime({ typescript: ts, ...services, compilerOptions: vueCompilerOptions }, vueLsHost, false);
const tsRuntime = createTypeScriptRuntime({ typescript: ts, ...services, vueCompilerOptions }, vueLsHost, false);
const tsProgram = tsRuntime.context.scriptTsLsRaw.getProgram(); // TODO: handle template ls?
if (!tsProgram) throw '!tsProgram';

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-typescript/src/types.ts
Expand Up @@ -31,7 +31,7 @@ export interface VueCompilerOptions {

export type BasicRuntimeContext = {
typescript: typeof import('typescript/lib/tsserverlibrary'),
compilerOptions: VueCompilerOptions,
vueCompilerOptions: VueCompilerOptions,
compileTemplate(templateTextDocument: TextDocument): {
htmlTextDocument: TextDocument;
htmlToTemplate: (start: number, end: number) => { start: number, end: number } | undefined;
Expand Down
6 changes: 3 additions & 3 deletions packages/vue-typescript/src/typescriptRuntime.ts
Expand Up @@ -15,7 +15,7 @@ export function createTypeScriptRuntime(
typescript: typeof import('typescript/lib/tsserverlibrary'),
htmlLs: html.LanguageService,
compileTemplate: BasicRuntimeContext['compileTemplate'],
compilerOptions: BasicRuntimeContext['compilerOptions'],
vueCompilerOptions: BasicRuntimeContext['vueCompilerOptions'],
getCssVBindRanges: BasicRuntimeContext['getCssVBindRanges'],
getCssClasses: BasicRuntimeContext['getCssClasses'],
},
Expand All @@ -38,7 +38,7 @@ export function createTypeScriptRuntime(
const templateScriptUpdateUris = new Set<string>();
const initProgressCallback: ((p: number) => void)[] = [];

const templateTsHost = options.compilerOptions.experimentalDisableTemplateSupport ? undefined : createTsLsHost('template');
const templateTsHost = options.vueCompilerOptions.experimentalDisableTemplateSupport ? undefined : createTsLsHost('template');
const scriptTsHost = createTsLsHost('script');
const templateTsLsRaw = templateTsHost ? ts.createLanguageService(templateTsHost) : undefined;
const scriptTsLsRaw = ts.createLanguageService(scriptTsHost);
Expand Down Expand Up @@ -391,7 +391,7 @@ export function createTypeScriptRuntime(
doc.version.toString(),
options.htmlLs,
options.compileTemplate,
options.compilerOptions,
options.vueCompilerOptions,
options.typescript,
options.getCssVBindRanges,
options.getCssClasses,
Expand Down

0 comments on commit ab4ef20

Please sign in to comment.