How use root project tsc version when open vim in sub directory ?
apoutchika opened this issue · 2 comments
Hello,
In my project I am using TSC 5.0.2. This version is well used when I open vim in the root of my project.
But, when I open vim in a subdirectory (ex: cd src/ && vim), coc-tsserver uses TSC 4.9.5.
How do I tell coc-tsserver to find the root of the project (first parent package.json ?) and use the correct version of typescript?
Thanks in advance
Related: #409.
I believe setting tsserver.useLocalTsdk
will achieve what you want.
thank you for your reply 👍
useLocalTsdk
is already set to true... This is my :CocConfig :
{
"suggest.noselect": false,
"coc.preferences.formatOnType": true,
"coc.preferences.formatOnSave": true,
"eslint.autoFixOnSave": true,
"javascript.suggestionActions.enabled": true,
"tsserver.useLocalTsdk": true,
"tsserver.locale": "fr",
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"stylelintplus.autoFixOnFormat": true,
"stylelintplus.autoFixOnSave": true,
"stylelintplus.cssInJs": true,
"stylelintplus.validateOnSave": true,
"stylelintplus.enable": true,
"javascript.preferences.importModuleSpecifier": "shortest",
"typescript.preferences.importModuleSpecifier": "shortest"
}
In my package.json, the devDependencies typescript version is 5.0.2
When i open it in the root, next to the package.json file, the version of typescript is 5.0.2, but when i open vim in subdirection, like src, the version is 4.9.5...
Did I forget a configuration somewhere ?
Thank you