Nathan Ridge

Results 1499 comments of Nathan Ridge

Does adding `--completion-style=detailed` to `"clangd.arguments"` help?

Please share [clangd logs](https://clangd.llvm.org/troubleshooting.html#gathering-logs) taken with `--log=verbose` from a session where this happens.

Could you try the following: in the affected file, right click, and select "Format Document". (Or, if clangd is not your default formatter, "Format Document With..." followed by selecting "clangd"...

Ok, so this suggests your clang-format settings are not consistent with the actual formatting of the code in the project. When a code action is executed, clangd formats the modified...

> Reformatting entire scope after action on single line is clearly odd behavior The clang-format API that clangd calls to apply formatting to the modified code is [`cleanupAroundReplacements()`](https://clang.llvm.org/doxygen/namespaceclang_1_1format.html#aa8f58bd0d9d2eaca3ffae4d9e458bfe8). I can't...

> if it's possible to detect whether `.clang-format` was loaded, apply formatting automatically only if this is the case. I'm not sure how reliable a signal that would be. A...

> Both this and `.clang-format` presence workarounds make it impossible to use formatter occasionally and to not break custom formatting of code, affected by actions. So option whether to do...

> [@HighCommander4](https://github.com/HighCommander4) What might be useful is that this feature would be lifted out of clang-format into the library part of it: https://github.com/llvm/llvm-project/blob/a7c963ab763c98188010cd654902cee4734249ee/clang/tools/clang-format/ClangFormat.cpp#L595 That way all old files can be...

See https://github.com/clangd/clangd/issues/1043 for some discussion of how this feature currently works. I think the "file index" approach discussed in [this comment](https://github.com/clangd/clangd/issues/1043#issuecomment-1062946988) is a promising one and should address the case...

I can reproduce this. I don't have a theory offhand for why it's not working; needs further investigation / debugging.