Getting started with C++
This tutorial gets you up to speed with C++ development in JetBrains Fleet. It covers the installation, project setup, and working with code.
Install JetBrains Toolbox 1.22.10970 or later: the Download page.
Download and install JetBrains Toolbox.
In JetBrains Toolbox, click Install near the JetBrains Fleet icon.
JetBrains Fleet supports C++ projects with compilation databases.
A compilation database is a JSON file named compile_commands.json, which contains structured data about every compilation unit in the project.
Follow this instruction to generate a compilation database for your project.
tip
Your compile_commands.json can be located anywhere under the project root. Fleet checks all the workspace directories at picks the largest compile_commands.json file.
Press or select File | Open from the menu.
Select your project root folder and click Open:
The opened directory becomes the root of your workspace:
Smart Mode turns on code insight features for your C++ code.
Click the Smart Mode Status icon in the top-right corner. In the popup that appears, click Enable.
The following message indicates that JetBrains Fleet might not have been able to download Clangd due to a firewall restriction.

Follow these steps to manually install Clangd as a workaround:
Download Clangd from the Maven repository.
note
The latest Clangd versions now include an architecture suffix (for example,
-x64
or-aarch64
). Be sure to select the correct version for your system.Copy the downloaded files to the corresponding JetBrains Fleet directory:
For JetBrains Clangd:
/home /user /.cache /JetBrains /Fleet /language_server /jbclangd /* For Upstream Clangd:
/home /user /.cache /JetBrains /Fleet /language_server /clangd /*
Restart JetBrains Fleet.
Here's what you can do in Smart Mode. The below is not an exhaustive list of Smart Mode features, rather a couple of examples that'll help you to get the feel of how it works in Fleet.
All the errors in your code are highlighted red:
Context-aware completion gives a list of suggestions for names, types, and keywords:
Among the completion suggestions, you can find templates for common code constructs. Select one from the list, and then use Tab to move the caret between stubs:
Available code snippets:
typedef [type] [name];
using [name] [type];
namespace [name] = [namespace];
using namespace [identifier];
using [qualifier]::[name];
using typename [qualifier]::[name];
template<class [name]>
template<typename [name]>
switch ([condition]) { [cases] }
case [expression]:
goto [label];
dynamic_cast<[type]>([expression])
static_cast<[type]>([expression])
reinterpret_cast<[type]>([expression])
const_cast<[type]>([expression])
catch ([declaration]) { [statements] }
concept [name] = [constraint];
#define [macro]([args])
To transform an already typed expression into a different one without moving the caret, add a dot at the end. You will see postfix completion options among the list of suggestions:
For example, you can choose if, and the initial expression will get wrapped into an
if
statement:
Press to get the list of parameter names in a function call:
Click Show all to view all the usages.
Hover over a class, function, field, or another element to see where and how it is defined:
Select an item to be renamed, press , and enter the new name:
Navigate to the declaration of a symbol with .
Find usages of a symbol with :
Skim over the errors with and .
Fleet does not provide automation for the process of building a running C/C++ applications.
However, you can use Fleet's language-agnostic run configurations for that. Find below an example for the case of CMake:
{
"configurations": [
{
"type": "command",
"name": "Build",
"program": "cmake",
"args": ["--build", "$PROJECT_DIR$/cmake-build-debug", "--target", "program_name"],
},
{
"type": "command",
"name": "Run",
"program": "$PROJECT_DIR$/cmake-build-debug/program_name",
},
]
}