yaegassy/coc-php-cs-fixer

Using wrong configuration

Closed this issue · 3 comments

Simply

A/
 .php-cs-fixer.php
  B/
   .php-cs-fixer.php
   src/
     files..

go inside of B directory and run 'nvim'. After open a php file and save file (so format on save). This plugin uses configuration that inside of A directory, not B. Both are git repository.

I have tried but cannot reproduce it in my environment.

It uses the configuration file directly under the workspace folder (project root), but it may be that the workspace folder you expected is not being used.

Resolved workspace folders can be check by run :echo WorkspaceFolders.

Okay there is a mistake. Actually this happen in this file tree.

-A/
--.git
--.php-cs-fixer.php
--B/
---.git
---.php-cs-fixer.php
----C
----files..

go into C directory. run :echo WorkspaceFolders and it says it workspace "A" directory but actually in my opinion must be B directory. B directory is a git repository too.

I see. Your example looks like a rather special project example. The behavior of the workspaceFolders (project root) in the coc.nvim body is as described in this wiki. You can also manually set the workspaceFolders you need.

Alternatively, you may be able to adjust it by setting php-cs-fixer.config at the project level, please try it.