Takes into account the clang-format file of the project, if any.
Reverts to LLVM if nothing is found. Replies with an error if any error occured.
For instance, a parse error in the clang-format YAML file.
Details
Details
- Reviewers
ilya-biryukov sammccall Nebiroth malaperle krasimir - Commits
- rG212bcf8370d4: [clangd] (Attempt to) read clang-format file for document formatting
rCTE320524: [clangd] (Attempt to) read clang-format file for document formatting
rL320524: [clangd] (Attempt to) read clang-format file for document formatting
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I'm not actually sure we're doing the user a service with this error handling.
LSP errors aren't surfaced to the user with a decent UI in practice.
Plus it adds a bunch of internal complexity.
I'd strongly consider just falling back to LLVM style on any error, inside ClangdServer::formatCode. I think the UX will be better, and the code will be simpler. But up to you.