.vim/coc-settings.json file in the root of your project, i.e.
In here you can add settings to override the global ones. Enter this:
This tells CoC to look for a
.thisIsDocRoot file to determine a "workspace" dir.
touch /var/www/example/.thisIsDocRoot to create a file in the doc root.
Now when you edit a file in
/var/www/example/plugins/myplugin CoC will:
- scan up the tree looking for
.vim/coc-settings.json which it will find at the root of your project. It merges that config.
- that causes it to then look for
.thisIsDocRoot, which again it finds in the root of the project.
- Intelephense now uses this to find symbols.
Note: you might also want to tell it to look in files other than .php ones, e.g. Drupal uses .module and .inc files too. To cover this, my
/var/www/example/.vim/coc-settings.json file is:
Red herring: Intelephense defines a config item called
intelephense.environment.documentRoot. I tried putting a value in this in various coc-settings files to no avail.