Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How use root project tsc version when open vim in sub directory ? #422

Open
apoutchika opened this issue Mar 24, 2023 · 2 comments
Open

Comments

@apoutchika
Copy link

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

@tatethurston
Copy link

tatethurston commented Mar 31, 2023

Related: #409.

I believe setting tsserver.useLocalTsdk will achieve what you want.

@apoutchika
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants