pulsar-ide-clangd Made for Pulsar!

C/C++ language support for Pulsar (forked from the original)

Joshua Breeden <jbreeden@me.com> / Andrew Dupont <github@andrewdupont.net>

200

0

0.6.1

MIT

GitHub

This package consumes the following services:

pulsar-ide-clangd

Provides C and C++ language support for Pulsar using Clangd language server

About

This plugin only provides some of the functionality designated by the language server protocol. This plugin currently enables many of the features supported by Clangd:

All contributions and feedback are appreciated.

Requirements

Autocompletion support via autocomplete-plus is built-in. If you’re running Pulsar 1.113 or later, so is symbol search via symbols-view — symbols within the document and the project, plus go-to-declaration functionality.

Other services can be consumed with various packages. You can install [atom-ide-base] for the maximal experience, but I’d encourage you to pick and choose a bit more carefully!

Compilation Database

In order to make this plugin work effectively, clangd requires information about how your code should be compiled. There are two options: compile_commands.json, or compile_flags.txt.

compile_commands.json

CMake is currently your best bet for generating a compile_commands.json file. The command to generate compile_commands.json along with your project looks something like this: cmake (SOURCE_DIR) -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

CMake doesn't include header information in the compile_commands.json file. To rectify this, I use a tool called compdb.

Clangd won't see your compile_commands.json file if it's placed in your build directory, so you should either symlink it to your project directory, or have compdb generate its output there.

compile_flags.txt

Another supported solution is to make a compile_flags.txt file and place it in your project directory. Clangd will treat all project files with the same options. A simple compile_flags.txt might look something like this:

-std=c++11
-Iinclude
-DMY_DEBUG_FLAG

Areas of interest