Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
208 stars 49 forks source link

Formatting does not respect .editorconfig #213

Open jaens opened 4 years ago

jaens commented 4 years ago

I have the following in the project folder's .editorconfig:

[*.d]
dfmt_brace_style = otbs

Yet, when activating "Format Document" in code-d, it formats it using the default brace style...

(this can be worked around by setting "dfmt.braceStyle": "otbs" in VSCode, but it would be better if this respected project configs)

nawordar commented 4 years ago

This is because dfmt only looks for .editorconfig if path to the file has been passed as as an argument. If it is used with stdin, -c <project_root> argument needs to be passed. Does workspace-d have some variable with project root?

WebFreak001 commented 4 years ago

no it's because dfmt is used as a library, this is not the application dfmt and I never load any .editorconfig, which is why it's not loaded.

It needs to be added as feature, so this is a feature request.

nawordar commented 4 years ago

Sorry, I misunderstood what happens there in the code.