Version 4 (modified by 3 years ago) ( diff ) | ,
---|
Clangd
clangd is language server designed to provide features like autocomplete, go to definition, and refactoring to a wide range of editors.
Getting clangd
macOS
clangd will be installed by default with Xcode.
Linux and Windows
Instructions to obtain clangd can be found at https://clangd.llvm.org/installation
Setting up clangd
Generate compile_command.json
macOS
clangd relies on compile_commands.json file to work, which can be generated on macOS by running
make r EXPORT_COMPILE_COMMANDS=YES generate-compile-commands WebKitBuild/Release
I would recommend running this command each time you pull the latest code.
If you add or remove files during development, recompile with make r EXPORT_COMPILE_COMMANDS=YES
and rerun generate-compile-commands WebKitBuild/Release
.
Linux and Windows
For other platforms using cmake, generating compile_commands.json can be accomplished by running
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1
Configure your editor
Every editor will have slightly different method to setup clangd.
The clangd website provides an excellent setup guide for most popular editors.
Attachments (1)
-
clangd_screenshot.png
(251.2 KB
) - added by 3 years ago.
clangd autocomplete
Download all attachments as: .zip