From 96b122c018b051a1ab2025d1a35a9e17e9873d4a Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Mon, 2 Dec 2024 16:24:21 +0000 Subject: [PATCH] Create empty compile_commands.json, to prevent intellisense warning This prevents the C/C++ intellisense warning you get with some new projects that compile_commands.json cannot be parsed (eg #118), and will be immediately replaced with the correct file once CMake has been configured --- scripts/pico_project.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/pico_project.py b/scripts/pico_project.py index 8118fa8..89e0f92 100644 --- a/scripts/pico_project.py +++ b/scripts/pico_project.py @@ -1389,6 +1389,11 @@ def DoEverything(params): if os.path.exists(CMAKECACHE_FILENAME): os.remove(CMAKECACHE_FILENAME) + if not os.path.exists("compile_commands.json"): + # Create empty compile_commands.json to prevent intellisense warning + with open("compile_commands.json", "w") as f: + f.write("[]\n") + if params["projects"]: generateProjectFiles( projectPath,