diff --git a/packages/language-server/node.ts b/packages/language-server/node.ts index 0b5dc67e89..a1da022180 100644 --- a/packages/language-server/node.ts +++ b/packages/language-server/node.ts @@ -23,11 +23,10 @@ connection.onInitialize(async params => { const options: VueInitializationOptions = params.initializationOptions; const hybridMode = options.vue?.hybridMode ?? true; + const vueFileExtensions: string[] = ['vue']; tsdk = loadTsdkByPath(options.typescript.tsdk, params.locale); - const vueFileExtensions: string[] = ['vue']; - if (options.vue?.additionalExtensions) { for (const additionalExtension of options.vue.additionalExtensions) { vueFileExtensions.push(additionalExtension); @@ -60,7 +59,7 @@ connection.onInitialize(async params => { const commandLine = await parseCommandLine(); const vueOptions = commandLine?.vueOptions ?? resolveVueCompilerOptions({}); for (const ext of vueFileExtensions) { - if (vueOptions.extensions.includes(`.${ext}`)) { + if (!vueOptions.extensions.includes(`.${ext}`)) { vueOptions.extensions.push(`.${ext}`); } }