Last active
September 13, 2025 09:43
-
-
Save ironlungx/a2b620de74f875c49c1d06999a8c41f8 to your computer and use it in GitHub Desktop.
Revisions
-
ironlungx revised this gist
May 10, 2025 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ > [!Caution] > **I've moved this gist over to a template repository [here](https://github.com/ironlungx/nvim-pio/). Everything here is unmaintained...** # Extensions Following are the extensions required for neovim: -
ironlungx revised this gist
May 5, 2025 . 1 changed file with 3 additions and 42 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,43 +1,4 @@ #!/bin/sh echo "This script is no longer maintained" echo "Use this repo instead: https://github.com/ironlungx/nvim-pio" -
ironlungx revised this gist
May 4, 2025 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ > [!Caution] > I've moved this gist over to a template repository [here](https://github.com/ironlungx/nvim-pio/). > Everything here is unmaintained... # Extensions Following are the extensions required for neovim: * [mason](https://github.com/williamboman/mason.nvim) -
ironlungx revised this gist
Apr 4, 2025 . 2 changed files with 5 additions and 47 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,15 +42,6 @@ lspconfig.clangd.setup({ "clangd", "--background-index", "-j=12", }, }) ``` @@ -98,25 +89,8 @@ $ pio run -t compiledb - `.clang-tidy`: (thanks @omani for adding more flags!) ```yaml Checks: '-*, -misc-definitions-in-headers' # Fixes some issue with header reinclusion IndentWidth: 2 # Only if you like 2, replace with 3/4/.. if you'd like ``` - `gen_compile_commands.py`: This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,25 +29,9 @@ CompileFlags: Diagnostics: Suppress: \"pp_including_mainfile_in_preamble\"" create_file ".clang-tidy" "Checks: '-*, -misc-definitions-in-headers' # Fixes some issue with header reinclusion IndentWidth: 2 # Only if you like 2, replace with 3/4/.. if you'd like " create_file "gen_compile_commands.py" "import os Import(\"env\") # platformio specific stuff -
ironlungx revised this gist
Feb 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ return { config = function() local lspconfig = require("lspconfig") lspconfig.lua_ls.setup({}) lspconfig.clangd.setup({}) -- Minimal setup end, }, } -
ironlungx revised this gist
Feb 26, 2025 . No changes.There are no files selected for viewing
-
ironlungx revised this gist
Feb 26, 2025 . 2 changed files with 8 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -73,16 +73,14 @@ $ pio run -t compiledb ```yaml # clangd controls options for the LSP *server* CompileFlags: Add: [ -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, -Wno-unknown-warning-option ] Remove: [ -mlong-calls, -fno-tree-switch-conversion, -mtext-section-literals, @@ -92,7 +90,7 @@ $ pio run -t compiledb -fipa-pta, -march=*, -mabi=*, -mcpu=* ] Diagnostics: Suppress: "pp_including_mainfile_in_preamble" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,16 +7,14 @@ create_file() { create_file ".clangd" "# clangd controls options for the LSP *server* CompileFlags: Add: [ -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, -Wno-unknown-warning-option ] Remove: [ -mlong-calls, -fno-tree-switch-conversion, -mtext-section-literals, @@ -26,7 +24,7 @@ CompileFlags: -fipa-pta, -march=*, -mabi=*, -mcpu=* ] Diagnostics: Suppress: \"pp_including_mainfile_in_preamble\"" -
ironlungx revised this gist
Feb 26, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,7 +60,7 @@ lspconfig.clangd.setup({ **I've made a script to do all this for you**: ```bash $ cd path/to/the/project $ curl -sSL https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c41f8/raw/script.sh | sh $ rm compile_commands.json $ pio run -t compiledb ``` -
ironlungx revised this gist
Feb 26, 2025 . 2 changed files with 113 additions and 35 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,52 +26,101 @@ return { config = function() local lspconfig = require("lspconfig") lspconfig.lua_ls.setup({}) lspconfig.clangd.setup({}) -- Minimal setup end, }, } ``` For the LSP server setup (as recommended by @omani) this is what I use, it improves auto complete functionality ```lua lspconfig.clangd.setup({ on_attach = on_attach, capabilities = capabilities, cmd = { "clangd", "--background-index", "-j=12", "--query-driver=**", "--clang-tidy", "--all-scopes-completion", "--cross-file-rename", "--completion-style=detailed", "--header-insertion-decorators", "--header-insertion=iwyu", "--pch-storage=memory", "--suggest-missing-includes", }, }) ``` # Setting up the project **I've made a script to do all this for you**: ```bash $ cd path/to/the/project $ curl https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c41f8/raw/script.sh | sh $ rm compile_commands.json $ pio run -t compiledb ``` **__BUT I DONT LIKE `curl|sh`__**: 1. Initialize a project with `pio init` 2. In the project root create the following files - `.clangd`: (thanks @omani for fixing and adding flags to the file) ```yaml # clangd controls options for the LSP *server* CompileFlags: Add: [ -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, -Wno-unknown-warning-option, ] Remove: [ -mlong-calls, -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, -march=*, -mabi=*, -mcpu=*, ] Diagnostics: Suppress: "pp_including_mainfile_in_preamble" ``` - `.clang-tidy`: (thanks @omani for adding more flags!) ```yaml # Formatter options Checks: "*, -abseil-*, -altera-*, -android-*, -fuchsia-*, -google-*, -llvm*, -modernize-use-trailing-return-type, -zircon-*, -readability-else-after-return, -readability-static-accessed-through-instance, -readability-avoid-const-params-in-decls, -cppcoreguidelines-non-private-member-variables-in-classes, -misc-non-private-member-variables-in-classes, " WarningsAsErrors: '' HeaderFilterRegex: '' FormatStyle: none ``` - `gen_compile_commands.py`: ```python import os This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,32 +1,61 @@ #!/bin/bash create_file() { echo "$2" > "$1" echo "Created $1" } create_file ".clangd" "# clangd controls options for the LSP *server* CompileFlags: Add: [ -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, -Wno-unknown-warning-option, ] Remove: [ -mlong-calls, -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, -march=*, -mabi=*, -mcpu=*, ] Diagnostics: Suppress: \"pp_including_mainfile_in_preamble\"" create_file ".clang-tidy" "# Formatter options Checks: \"*, -abseil-*, -altera-*, -android-*, -fuchsia-*, -google-*, -llvm*, -modernize-use-trailing-return-type, -zircon-*, -readability-else-after-return, -readability-static-accessed-through-instance, -readability-avoid-const-params-in-decls, -cppcoreguidelines-non-private-member-variables-in-classes, -misc-non-private-member-variables-in-classes, \" WarningsAsErrors: '' HeaderFilterRegex: '' FormatStyle: none" create_file "gen_compile_commands.py" "import os Import(\"env\") # platformio specific stuff # include toolchain paths (i.e. to have stuff like the Arduino framework headers present in the compile commands) env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) # override compilation DB path env.Replace(COMPILATIONDB_PATH=\"compile_commands.json\")" -
ironlungx revised this gist
Feb 17, 2025 . No changes.There are no files selected for viewing
-
ironlungx revised this gist
Feb 17, 2025 . No changes.There are no files selected for viewing
-
ironlungx revised this gist
Feb 17, 2025 . No changes.There are no files selected for viewing
-
ironlungx revised this gist
Feb 17, 2025 . 2 changed files with 41 additions and 40 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,36 +46,38 @@ $ pio run -t compiledb 1. Initialize a project with `pio init` 2. In the project root create the following files - `.clangd`: ```yaml # clangd controls options for the LSP *server* CompileFlags: Add: [ -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, ] Remove: [ -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, ] ``` - `.clang-tidy`: ```yaml # Formatter options Checks: '-*, -misc-definitions-in-headers' # Fixes some issue with header reinclusion IndentWidth: 2 # Only if you like 2, replace with 3/4/.. if you'd like ``` - `gen_compile_commands.py`: ```python import os Import("env") # platformio specific stuff # include toolchain paths (i.e. to have stuff like the Arduino framework headers present in the compile commands) env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) # override compilation DB path @@ -89,4 +91,4 @@ $ pio run -t compiledb 4. Now in your terminal run: `pio run -t compiledb` (Just delete the old `compile_commands.json` before executing this) Hopefully this helped, I spent a lot of time figuring it out This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,22 @@ #! /usr/bin/env bash echo 'CompileFlags: Add: [ -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, ] Remove: [ -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, ]' > .clangd echo "Checks: '-*, -misc-definitions-in-headers' " > .clangd-tidy -
ironlungx revised this gist
Aug 23, 2024 . No changes.There are no files selected for viewing
-
ironlungx revised this gist
Aug 23, 2024 . 2 changed files with 20 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,26 +47,24 @@ $ pio run -t compiledb 2. In the project root create the following files - `.clangd`: ```yml CompileFlags: Add: [ # -mlong-calls, -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, ] Remove: [ -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, ] ``` - `.clang-tidy`: ```yaml @@ -88,7 +86,7 @@ $ pio run -t compiledb ```ini extra_scripts = pre:gen_compile_commands.py ``` 4. Now in your terminal run: `pio run -t compiledb` (Just delete the old `compile_commands.json` before executing this) Hopefully this helped, I spent a lot of time figuring it out This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,9 +17,7 @@ echo 'CompileFlags: -fstrict-volatile-bitfields, -free, -fipa-pta, ]' > .clangd echo "Checks: '-*, -misc-definitions-in-headers' " > .clangd-tidy -
ironlungx revised this gist
Jul 27, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ return { **I've made a script to do all this for you**: ```bash $ cd path/to/the/project $ curl https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c41f8/raw/3f0d5d46c0d6369fc7e51e32487772ac194c27b1/script.sh | sh $ pio run -t compiledb ``` -
ironlungx revised this gist
Jul 27, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,4 @@ env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) # override compilation DB path env.Replace(COMPILATIONDB_PATH="compile_commands.json")' > gen_compile_commands.py echo 'extra_scripts = pre:gen_compile_commands.py' >> platformio.ini -
ironlungx revised this gist
Jul 27, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,4 +32,4 @@ env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) # override compilation DB path env.Replace(COMPILATIONDB_PATH="compile_commands.json")' > gen_compile_commands.py echo 'extra_scripts = pre:gen_compile_commands.py' >> platform.ini -
ironlungx revised this gist
Jul 26, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ $ curl https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c $ pio run -t compiledb ``` **__BUT I DONT LIKE `curl|sh`__**: 1. Initialize a project with `pio init` 2. In the project root create the following files -
ironlungx revised this gist
Jul 26, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,6 +41,8 @@ $ curl https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c $ pio run -t compiledb ``` **__ BUT I DONT LIKE `curl|sh`__**: 1. Initialize a project with `pio init` 2. In the project root create the following files - `.clangd`: -
ironlungx revised this gist
Jul 26, 2024 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,12 @@ return { # Setting up the project **I've made a script to do all this for you**: ```bash $ cd path/to/the/project $ curl https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c41f8/raw/003652be7dc8864ce269a605bf84a0fe76f612ad/script.sh | sh $ pio run -t compiledb ``` 1. Initialize a project with `pio init` 2. In the project root create the following files -
ironlungx revised this gist
Jul 26, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,6 +34,8 @@ return { # Setting up the project **I've made a script to do all this for you**: `curl https://gist.github.com/ironlungx/a2b620de74f875c49c1d06999a8c41f8/raw/003652be7dc8864ce269a605bf84a0fe76f612ad/script.sh | sh` 1. Initialize a project with `pio init` 2. In the project root create the following files - `.clangd`: -
ironlungx revised this gist
Jul 26, 2024 . 1 changed file with 35 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #! /usr/bin/env bash echo 'CompileFlags: Add: [ # -mlong-calls, -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, ] Remove: [ -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, ] Diagnostics: Suppress: "pp_including_mainfile_in_preamble' > .clangd echo "Checks: '-*, -misc-definitions-in-headers' " > .clangd-tidy echo 'import os Import("env") # include toolchain paths env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) # override compilation DB path env.Replace(COMPILATIONDB_PATH="compile_commands.json")' > gen_compile_commands.py echo 'extra_scripts = pre:gen_compile_commands.py' >> .platformio -
ironlungx revised this gist
Jul 26, 2024 . 1 changed file with 21 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,28 +38,27 @@ return { 2. In the project root create the following files - `.clangd`: ```yml CompileFlags: Add: [ # -mlong-calls, -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, ] Remove: [ -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, ] Diagnostics: Suppress: "pp_including_mainfile_in_preamble" ``` - `.clang-tidy`: ```yaml Checks: '-*, -misc-definitions-in-headers' -
ironlungx revised this gist
Apr 4, 2024 . 2 changed files with 86 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,86 @@ # Extensions Following are the extensions required for neovim: * [mason](https://github.com/williamboman/mason.nvim) * [mason-lspconfig](https://github.com/williamboman/mason-lspconfig.nvim) * [lspconfig](https://github.com/neovim/nvim-lspconfig) I use `lazy.nvim` so, just add the following to your plugins table, or create a new file in `lua/plugins/lsp.lua` ```lua return { { "williamboman/mason.nvim", config = function() require("mason").setup({}) end, }, { "williamboman/mason-lspconfig.nvim", config = function() require("mason-lspconfig").setup({ ensure_installed = { "lua_ls", "clangd" }, }) end, }, { "neovim/nvim-lspconfig", config = function() local lspconfig = require("lspconfig") lspconfig.lua_ls.setup({}) lspconfig.clangd.setup({}) end, }, } ``` # Setting up the project 1. Initialize a project with `pio init` 2. In the project root create the following files - `.clangd`: ```yml CompileFlags: Add: [ # -mlong-calls, -DSSIZE_MAX, -DLWIP_NO_UNISTD_H=1, -Dssize_t=long, -D_SSIZE_T_DECLARED, ] Remove: [ -fno-tree-switch-conversion, -mtext-section-literals, -mlongcalls, -fstrict-volatile-bitfields, -free, -fipa-pta, ] Diagnostics: Suppress: "pp_including_mainfile_in_preamble" ``` - `.clang-tidy`: ```yaml Checks: '-*, -misc-definitions-in-headers' ``` - `gen_compile_commands.py`: ```python import os Import("env") # include toolchain paths env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) # override compilation DB path env.Replace(COMPILATIONDB_PATH="compile_commands.json") ``` 3. Now add the following to your platformio.ini ```ini extra_scripts = pre:gen_compile_commands.py ``` 4. Now in your terminal run: `pio run -t compiledb` Hopefully this helped, I spent a lot of time figuring it out -
ironlungx created this gist
Apr 4, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ test