Closed javier-garcia-meteologica closed 2 years ago
Could coc-tserver start a separate instance of tsserver for each workspace?
No need for that since tsserver can support multiple folders.
Seems we should prefer workspace folder of current buffer to avoid this issue.
I work in a main project that uses typescript 4.3. After ocasionally browsing through other projects, coc-nvim accumulates workspaces, as described here. Then if I call
:CocRestart
, coc-tsserver loads instead the tsserver from another project, which uses typescript 4.0.coc-tsserver doesn't care which tsserver gets loaded, but in this case it's important. The main project uses typescript 4.3 because it uses
rxjs
which exports type definitions usingpackage.json#typesVersions
and this feature is only supported in typescript 4.2+.https://github.com/neoclide/coc-tsserver/blob/66ae279b1a3441ad5ca77d47934f99f039cd1e0b/src/server/utils/versionProvider.ts#L109-L121
I've tried to close all buffers from other workspaces and then delete the workspaces in
CocList folders
, but they still re-appear after:CocRestart
. I even triedlet g:WorkspaceFolders = []
.:pwd
or to a workspace that matches the path of the file of the current window?