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

  • 1.0.1
  • github.​com
  • github.​com
  • 2 months ago
  • 26 minutes ago
  • 2 months ago

Installs

  • Total 804
  • Win 315
  • Mac 162
  • Linux 327
Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25
Windows 7 6 10 13 8 7 4 8 10 5 3 5 8 7 8 7 6 11 8 5 7 6 6 6 6 6 8 11 7 5 9 9 6 4 5 2 6 2 7 8 6 4 7 5 1 2
Mac 1 5 5 3 4 4 0 2 1 4 3 7 5 5 2 3 3 5 3 0 1 5 4 3 2 5 4 6 5 1 2 1 3 2 2 5 4 5 1 2 1 2 5 2 5 4
Linux 1 5 5 6 14 5 4 7 9 9 1 8 9 12 15 5 6 8 4 4 8 7 6 3 8 4 7 7 9 4 8 10 6 8 4 10 7 6 8 8 6 6 3 5 6 4

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).