... | ... | @@ -20,7 +20,7 @@ VS Code has an extension that allows you to run language servers inside of conta |
|
|
2. Create a `.devcontainer` folder within the subsystem folder (e.g. `mkdir ./liu-home-wreckers/src/lhw_qi/.devcontainer`).
|
|
|
3. Within the newly created folder, add these two files:
|
|
|
|
|
|
./liu-home-wreckers/src/lhw_qi/.devcontainer/devcontainer.json
|
|
|
**./liu-home-wreckers/src/lhw_qi/.devcontainer/devcontainer.json**
|
|
|
```json
|
|
|
{
|
|
|
"dockerComposeFile": "./docker-compose.yml",
|
... | ... | @@ -41,7 +41,7 @@ VS Code has an extension that allows you to run language servers inside of conta |
|
|
|
|
|
This file tells the extension what service to start, which folder to run vscode inside and what vscode extensions it should install unto that dev container. I'm adding both Python and C++ extensions here for simplicity.
|
|
|
|
|
|
./liu-home-wreckers/src/lhw_qi/.devcontainer/docker-compose.yml
|
|
|
**./liu-home-wreckers/src/lhw_qi/.devcontainer/docker-compose.yml**
|
|
|
```yml
|
|
|
version: '3.8'
|
|
|
|
... | ... | @@ -66,7 +66,7 @@ Just another docker-compose file. You should be able to use the one in project r |
|
|
|
|
|
5. Easiest way to get (almost) all the right includes so that auto-completion actually works is with a [compile_commands.json](https://clang.llvm.org/docs/JSONCompilationDatabase.html) file. Add the following line into the subsystems `CMakeLists.txt` file: `set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)`. This tells cmake to export the file when you run `colcon build`, so now run that. When the compilation is done you should have the file `/workspace/liu-home-wreckers/build/compile_commands.json`. Run the following command: `C/C++: Edit configurations (JSON)` and add this line under configurations: `"compileCommands": "/workspace/liu-home-wreckers/build/compile_commands.json"`. The file should look like below:
|
|
|
|
|
|
.vscode/c_cpp_properties.json
|
|
|
**.vscode/c_cpp_properties.json**
|
|
|
```
|
|
|
{
|
|
|
"configurations": [
|
... | ... | |