From a8bde5d32fd540f8ba931ac26a29f9ac65246638 Mon Sep 17 00:00:00 2001 From: Fernando Alberto Miranda Bonomi <83925496+fmirandabonomi@users.noreply.github.com> Date: Fri, 12 Jun 2026 13:27:18 -0300 Subject: [PATCH] Visual Studio Code configuration incorporates ceedling includes Now `make vscode` looks for `$(BUILD_DIR)/artifacts/compile_commands.json` and, if present, adds a compileCommands entry to c_cpp_properties.json for that file. To make use of this, you should add compile_commands_json_db under :plugins::enabled:, ensure that ceedling's build path matches muju's and run `ceedling` *before* running `make vscode` (or re-run the later if needed) Now Visual Studio Code will find unity.h --- module/base/makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/base/makefile b/module/base/makefile index f16d164..879c12c 100644 --- a/module/base/makefile +++ b/module/base/makefile @@ -366,6 +366,14 @@ endef VSCODE_INCLUDES = $(strip $(foreach p,$(PROJECT_INC),$(subst $(abspath $(PROJECT_DIR)),$(PROJECT_DIR),$(call full_path,$(p))))) + +define vscode_c_config_ceedling_compat +, + "compileCommands": [ + "$${workspaceFolder}/$(BUILD_DIR)/artifacts/compile_commands.json" + ] +endef + define vscode_c_config { "configurations": [ @@ -375,7 +383,7 @@ define vscode_c_config "defines": [$(call json_list,$(DEFINES))], "cStandard": "c99", "intelliSenseMode": "$${default}", - "compilerPath":"$(subst \,\\,$(shell $(CC) -v 2>&1 | awk '/COLLECT_GCC=/ {sub(/[^=]+=/,"");print}'))" + "compilerPath":"$(subst \,\\,$(shell $(CC) -v 2>&1 | awk '/COLLECT_GCC=/ {sub(/[^=]+=/,"");print}'))"$(if $(wildcard $(BUILD_DIR)/artifacts/compile_commands.json),$(vscode_c_config_ceedling_compat)) } ], "version": 4