Coc.nvim: Allow to config multiple workspace folders rootPattern lookup ordering

Created on 20 Nov 2019  ยท  1Comment  ยท  Source: neoclide/coc.nvim

Is your feature request related to a problem? Please describe.
Having a subfolder of client side code inside project, plugin like coc-prettier would need to resolve a correct workspace.

โ”œโ”€โ”€ .git
โ”œโ”€โ”€ server
โ”‚   โ”œโ”€โ”€ ...
โ”œโ”€โ”€ client
โ”‚   โ”œโ”€โ”€ .pretteric.js
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ node_modules
โ”‚   โ”‚   โ”œโ”€โ”€ prettier

We can adopt the multiple workspace setting like,

    "coc.preferences.rootPatterns": ["package.json", ".vim", ".git", ".hg"]

But it seems that current lookup method would fail on nesting folder, i.e.
open vim at project (cwd), and then open file client/src/someFile.js, it will try:

  • project/package.json --> not found
  • project/.vim --> not found
  • project/.git --> found! set as workspace folder

So plugin like coc-prettier won't get the correct config.

Describe the solution you'd like
A setting like coc.preferences.rootPatternLookupFolderFirst: true so that the look up order is

  • project/package.json --> not found
  • project/client/package.json --> found! set as workspace folder

>All comments

No, you can start vim in client folder.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lanox picture lanox  ยท  3Comments

iago-lito picture iago-lito  ยท  3Comments

npearson72 picture npearson72  ยท  3Comments

tom-james-watson picture tom-james-watson  ยท  3Comments

cvlmtg picture cvlmtg  ยท  3Comments