ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-clangd

by sublimelsp ST4

C/C++ support for Sublime's LSP plugin provided through clangd.

Details

Installs

  • Total 2K
  • Win 608
  • Mac 297
  • Linux 598
Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15
Windows 1 4 6 6 5 8 3 9 4 12 9 4 10 9 2 9 9 20 18 12 13 8 7 10 7 5 6 9 7 5 6 7 9 2 3 5 7 6 1 10 9 7 7 7 4 4
Mac 1 4 0 4 1 1 2 1 2 5 6 2 12 5 4 4 1 4 6 3 3 3 3 2 5 3 5 3 2 2 7 3 4 2 3 2 2 2 7 0 6 3 2 6 5 1
Linux 0 5 7 10 4 1 4 6 5 7 5 6 6 10 8 5 3 6 7 5 3 5 4 8 8 4 11 9 4 7 9 4 10 7 5 6 9 13 5 9 7 0 2 4 10 3

Readme

Source
raw.​githubusercontent.​com

LSP-clangd

C/C++ and Objective-C/C++ support for Sublime's LSP plugin provided through clangd.

Installation

  • Install LSP and LSP-clangd from Package Control
  • (Optional) Install clangd using your package manager or let this package install clangd for you

Usage

By default, clangd will assume your code is built as clang some_file.cc, and you’ll probably get errors about missing #included files, etc.

For complex projects, clangd needs to know your build flags. This can be done using a compile_commands.json or compile_flags.txt file.

For CMake-based projects a compile_commands.json file can be generated using the -DCMAKE_EXPORT_COMPILE_COMMANDS=1 flag.

cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
# compile_commands.json will be written to your build directory.

If your build directory is equivalent to the root of the project or <project_root>/build then clangd will find it. Otherwise, symlink or copy it to the root of your project.

See clangd Project Setup for more information on using compile_commands.json, compile_flags.txt and other build systems.

Sublime Commands

Sublime Command Description
lsp_clangd_switch_source_header Switch between the main source file (.cpp) and header (.h).