[Feature] Root strategies, workspaces, and monorepos
npearson72 opened this issue · 4 comments
This is probably more of a question than a feature request.
I'm currently developing in a large monorepo, and because of all the linting and tsserver work that's happening in the background, things get pretty slow.
I saw this plugin for VSCode: https://marketplace.visualstudio.com/items?itemName=folke.vscode-monorepo-workspace
I'm wondering if coc-explorer can do something like this?
What this plugin does (as far as I understand it), is it allows you to select only the directories (i.e. workspaces) that you want to load, while hiding the rest. I imagine the hidden ones are also ignore from typescript analysis and other processes that can slow things down.
If this is already possible, would you mind explaining how to do it?
Thank you!
I'm currently developing in a large monorepo, and because of all the linting and tsserver work that's happening in the background, things get pretty slow.
This depends on whether your coc.nvim has a lot of workspaceFolders
opened, in this case, the more workspaces open, the more lsp and lint process. you can use CocList folders
to close the workspaces. https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders#manage-workspace-folders
@weirongxu thanks for this. This really gets me going in the right direction.
I'm not completely familiar with vim/neovim workspaces. Do you know if using them is the typical solution to reducing slowness due to large amounts of files while working in monorepos?
This depends on the implementation of the language server and lint program. If the language server or lint is slow to work in a large directory, you can make the workspace resolved in a small directory by modifying root patterns
or workspace.bottomUpFiletypes
. https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders#resolve-workspace-folder
The coc-explorer can't intervene in the process of resolving the workspace root. coc.nvim is currently designed to allow the user to open a file anywhere and automatically resolve a workspace root. then let the language server and extension work on it
Thanks again