clangd understands your C++ code and adds smart features to your editor
open sourceApache-2.0 WITH LLVM-exceptionfree
clangd is a language server for C and C++ that gives editors code completion, compile errors and warnings as you type, go-to-definition, find references, hover documentation, renaming, formatting and semantic highlighting through the Language Server Protocol. It is based on the Clang compiler and is part of the LLVM project: it runs Clang on your code to show diagnostics in place, suggests fixes and missing includes, and embeds clang-tidy so your project's .clang-tidy checks show up in the editor too. It works with any LSP editor (VS Code through its official extension, Vim and Neovim, Emacs, Sublime Text and others), reading a project's compile_commands.json to understand its build.
Problems it solves
- code completion and go-to-definition for C++ in my editor
- see C and C++ compile errors inline as I type instead of after a build
- run clang-tidy checks live in my editor
- C++ IDE features in Vim, Neovim or Emacs
- a faster, more accurate C/C++ IntelliSense than the default VS Code extension
- rename a symbol across a large C++ codebase safely
- automatically insert missing #include lines in C++
Features
- code completion with include insertion
- errors and warnings as you type from Clang
- automatic fixes
- embedded clang-tidy checks
- go-to-definition and find references
- hover documentation
- rename refactoring
- formatting
- semantic highlighting
- experimental C++20 modules support
Limitations
Alternatives
The same job
These do what clangd does.
- CLion The IDE for professional C and C++ development
- gopls The language server for Go
- rust-analyzer Bringing a great IDE experience to the Rust programming language
- Metals Scala language server with rich IDE features