From fcd0bcc010f113ef7f50b2de95ac0e699551d328 Mon Sep 17 00:00:00 2001 From: johnsoncodehk Date: Sat, 16 Jul 2022 20:53:47 +0800 Subject: [PATCH] fix: ts plugin stuck on empty project close #1146 --- packages/typescript-vue-plugin/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/typescript-vue-plugin/src/index.ts b/packages/typescript-vue-plugin/src/index.ts index 1f1c46135..9cbd91f9d 100644 --- a/packages/typescript-vue-plugin/src/index.ts +++ b/packages/typescript-vue-plugin/src/index.ts @@ -10,6 +10,11 @@ const init: ts.server.PluginModuleFactory = (modules) => { const pluginModule: ts.server.PluginModule = { create(info) { + // fix: https://github.com/johnsoncodehk/volar/issues/1146 + if (info.project.projectKind === ts.server.ProjectKind.Inferred) { + return info.languageService; + } + const proxyHost = createProxyHost(ts, info); if (proxyHost.getVueFiles().length === 0) {