MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.72k stars 255 forks source link

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

Open zylthinking opened 1 year ago

zylthinking commented 1 year ago

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

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

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

myrgy commented 1 year ago

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

zylthinking commented 1 year ago

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