Open MarcelRobitaille opened 1 year ago
BTW do you accept donations?
ccls complie with libclang in your computer, it may be not in /usr/lib/llvm-14/bin/clang-format
. it depend on where ccls complie
https://github.com/MaskRay/ccls/blob/master/src/messages/textDocument_formatting.cc here is source code abort how ccls work with clang-format. if you get ccls from apt source, it depend on apt source
The option SpacesInLineCommentPrefix
works only for single line comments and does not work if comments span multiple lines regardless if //
style or /**/
style is used.
In addition the option ReflowComments
must be set to true
Expected behavior is for this option to work on any amount of lines of comments.
Observed behavior
I want to use the setting
SpacesInLineCommentPrefix
in my.clang-format
file. I can see that it's only available as of clang 13. This setting works flawlessly if I runclang-format
from the command line. However, when I press ff, which I have bound in vim tolua vim.lsp.buf.format()
, nothing happens when this setting is enabled. Not just this setting for comments isn't applied, but the formatting isn't working at all, even for things that used to work like indentation. If I take this setting out of.clang-format
and press ff, everything else is working.It's like
clang-format
is erroring out, but nothing is printed in Vim. I checked:messages
and I don't see anything in the LSP log file even with my log level set to debug (vim.lsp.set_log_level("debug")
).I saw in #910 that ccls uses the LLVM
clang-format
. However, I don't have/usr/lib/llvm-14/bin/clang-format
on my computer. I don't know how to figure out whichclang-format
it's trying to use. When I dowhich clang-format
, I get/usr/bin/clang-format
. Is there any way to get it to use thatclang-format
? I don't have any ofCMAKE_PREFIX_PATH
,LLVM_INCLUDE_DIR
,LLVM_BUILD_INCLUDE_DIR
why I try toecho
them in my terminal.Expected behavior
The setting
SpacesInLineCommentPrefix
in.clang-format
should not break formatting. There should be some way to setting ccls to use a differentclang-format
binary. There should be some error message when formatting fails.Steps to reproduce
.clang-format
:System information
git describe --tags --long
):0.20210330-1
from apt