language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Add back `reverseConfigFilePriority`

Open segevfiner opened this issue 1 year ago • 10 comments

With this now removed, I'm getting the wrong tsconfig.json selected in my Vue projects. By having tsconfig.app.json last and enabling this setting, both the TypeScript server and Volar in Vue files picked tsconfig.app.json, now Volar picks up tsconfig.vitest.json instead (Based on the create-vue template). Please restore this setting or make it the default to match TypeScript server behavior.

segevfiner avatar Mar 03 '24 12:03 segevfiner

The Vue language server no longer controls tsconfig selection, because in 2.0 typescript support is implemented through tsserver + @vue/typescript-plugin, which means that now it is all the behavior of tsserver itself.

johnsoncodehk avatar Mar 03 '24 15:03 johnsoncodehk

Then how can it be that for a vue file I'm getting tsconfig.vitest.json and for a ts file I'm getting tsconfig.app.json? Something must still cause the behavior to be different for this case?

See also https://github.com/vuejs/language-tools/issues/1815

segevfiner avatar Mar 03 '24 15:03 segevfiner

Maybe tsserver behaves differently with external files (the file type of Vue files in tsserver projects), I can't give an exact explanation until I dig deeper. Anyway this is now beyond the control of this codebase.

johnsoncodehk avatar Mar 03 '24 15:03 johnsoncodehk

Please track for https://github.com/microsoft/TypeScript/issues/57632

johnsoncodehk avatar Mar 04 '24 13:03 johnsoncodehk

@sheetalkamat indicated that this is configurable, I will look into this.

johnsoncodehk avatar Mar 05 '24 03:03 johnsoncodehk

VSCode's TS client does not provide a configuration method for extraFileExtensions, so this is currently not configurable in VSCode for Vue.

https://github.com/microsoft/vscode/blob/8aca9a53311890fa54f0459c6ef2e8994d4d8ae4/extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts#L128-L129

johnsoncodehk avatar Mar 05 '24 12:03 johnsoncodehk

Hi - very same issue here 🙋 Here is my example https://github.com/andrewbrennanfr/vue-tsconfig main.ts uses tsconfig.main.json and App.vue uses tsconfig.app.json - completely based on the reverse order. Downgrading & disabling the built in TS features (as was recommended before) solves the issue.

andrewbrennanfr avatar Mar 19 '24 09:03 andrewbrennanfr

This problem cannot be solved on our side, but 2.0.7 has re-introduced the v1 language server, you can upgrade and make sure not to enable Hybird Mode to get consistent behavior with v1.

johnsoncodehk avatar Mar 20 '24 23:03 johnsoncodehk

@johnsoncodehk This is still an issue... Can we request the needed API in VS Code so this can be properly solved?

segevfiner avatar Jul 14 '24 22:07 segevfiner

I am currently unable to find time to investigate it, but let's keep this issue open in case it sinks.

johnsoncodehk avatar Jul 18 '24 09:07 johnsoncodehk

Closed because this issue cannot be handled in this project, instead we should have an issue in VSCode.

johnsoncodehk avatar Nov 26 '25 05:11 johnsoncodehk