Closed ambasta closed 3 years ago
Use ${workspaceRoot}
at the beggining.
@chemzqm You mean like so?
[coc.nvim] Can not find typescript module, in 'tsserver.tsdk': ${workspaceRoot}/.yarn/sdks/typescript/lib
Yes
Yes
@chemzqm Thanks a lot.. setting appropriate root pattern in vim settings resolves this. I am not sure if coc-tsserver should handle this, but the current contributes.rootPatterns
doesn't work for monorepos. I am not sure how this can be addressed in general, but using npm.lock
or yarn.lock
instead for pnp projects instead of package.json
/tsconfig.json
might be more benefitial.
For future reference, when using a pnp monorepo, following changes to vimrc and .vim/coc-settings.json address the issue:
autocmd FileType typescript let b:coc_root_patterns=["yarn.lock", "npm.lock"]
"tsserver.tsdk": "${workspaceRoot}/.yarn/sdks/typescript/lib"
You may have to use workspace.bottomUpFiletypes
configuration.
Hi,
I have a yarn v2 monorepo with the .vim/coc-settings in the rootdir. However, while launching vim from any subdirectory recognizes the coc-settings.json from parent .vim directory, relative paths in tsserver.tsk are resolved wrt cwdir instead of relative to project root.
This leads to tsserver failing to find modules w/
[coc.nvim] Can not find typescript module, in 'tsserver.tsdk': .yarn/sdks/typescript/lib