Open ghost opened 3 years ago
Thanks for reporting issue!
I want to know the result of M-x describe-editorconfig-properties
and the content of your .editorconifg
file.
Cloud you paste them?
Hi,
I think I have similar issue. Pressing Enter and TAB give me correct result. But running editorconfig-format-buffer, it went back to default setting
System:
[*.cs]
indent_style = space
indent_size = 3
end_of_line = lf
insert_final_newline = true
Steps to reproduce:
Expected behavior:
Actual result:
@serezlan Umm... I cannot reproduce your problem.
I forgot to mention I'm using lsp-mode. When I disable lsp, formatting buffer worked as expected and when it is turned on, it will override everything and use value from language server. I can get around this by setting lsp-enable-indentation to nil.
Thanks! I checked the lsp-mode code roughly.
It seems that when lsp-mode is enabled (and lsp-enable-indentation is set to t) lsp-mode configures buffers to use langauage servers' textDocument/rangeFormatting
request to format buffers. So Emacs buffers' indent configurations are ignored.
IMO each language server (not lsp-mode) needs to support .editorconfig
to fully solve your problem...
I'll document this to README.
My .editorconfig file:
root = true
[*]
indent_style = space
indent_size = 2
OS: Archlinux latest. Emacs version: 29 latest. (27 does not work too) Plugin version: latest.
When I insert Tab, I get tab indent and wrong indent size, But, an editorconfig file in the root of my project.
Please give me an answer! Thanks!