ccls icon indicating copy to clipboard operation
ccls copied to clipboard

ccls 能关闭自动格式化代码吗

Open zylthinking opened this issue 3 years ago • 2 comments

编辑器是 emacs, 通过 lsp 加载 ccls 现在发现只要一保存, 就会自动格式化代码。

但这代码是开源基础上进行修改, 这个项目自己有 clang-format, 但自己并不完全遵守。 这导致一旦修改文件, 哪怕只修改一点, 整个文件格式都变了

然后在和上游代码库做 diff 的时候就尴尬了....

zylthinking avatar Oct 24 '22 10:10 zylthinking

formatting is controlled by lsp-enable-on-type-formatting, maybe you have something else

myrgy avatar Oct 24 '22 10:10 myrgy

I have disable lsp-enable-on-type-formatting, and (setq lsp_format_on_save nil) too But can't take effect;

only

// clang-format off
...

can turns this off. So, I think it maybe controlled by ccls

zylthinking avatar Oct 24 '22 11:10 zylthinking