serve-d icon indicating copy to clipboard operation
serve-d copied to clipboard

dfmt does not use .editorconfig when used with serve-d

Open qwertzui11 opened this issue 4 years ago • 2 comments

I'm using serve-d with coc.vim like described in https://github.com/Pure-D/serve-d/issues/104

on the project root I got a .editorconfig with the following content:

[*.d]
indent_style = space
indent_size = 2

When I format my D file like:

dub run dfmt -- -i source/app.d

It WORKS like charm, the indent style is spaces and only two characters.

So here's what I did then:

  • When used by coc-vim serve-d it always formats using tabs.
  • Then however it WORKED using VsCode.
  • suddenly it ALSO worked using coc-vim
  • Then I changed the .editorconfig again by adding dfmt_brace_style = otbs OR changing the indent_size to 4
  • both coc-vim AND VsCode ignore the change in brace style and indent_size. BUT dub run dfmt -- -i source/app.d still works like a charm.

It seems VERY unreliable to me. Like as if the .editorconfig is getting copied (SOMETIMES) and used somewhere else.

Is there serve-d way to formatting files? Am I doing something wrong?

Can you reproduce this error, shall I append a (quite verbose) log?

Thanks for your time!

qwertzui11 avatar Dec 01 '20 09:12 qwertzui11

I should also mention that restarted the editors multiple times, after I changed the .editorconfig.

qwertzui11 avatar Dec 01 '20 09:12 qwertzui11

can you enable the verbose log and just send the request coc-vim does when formatting?

In vscode it works as expected, using the editor settings (see right side of bottom status line), which you want an editorconfig plugin for if you want it applied to every file.

WebFreak001 avatar Dec 01 '20 12:12 WebFreak001

merging into #213

WebFreak001 avatar Jan 16 '23 04:01 WebFreak001