]> Git Repo - pico-vscode.git/commitdiff
Added support for updating the forcedInclude paths on SDK change
authorpaulober <[email protected]>
Wed, 8 May 2024 14:19:14 +0000 (16:19 +0200)
committerpaulober <[email protected]>
Wed, 8 May 2024 14:19:14 +0000 (16:19 +0200)
Signed-off-by: paulober <[email protected]>
src/utils/vscodeConfigUtil.mts

index d20d84d05a109b2257354f21330768981b96333f..28eff79062df224df6a59e9f934e384aabcacd66 100644 (file)
@@ -7,6 +7,7 @@ import { dirname } from "path/posix";
 
 interface Configuration {
   includePath: string[];
+  forcedInclude: string[];
   compilerPath: string;
 }
 
@@ -32,6 +33,16 @@ async function updateCppPropertiesFile(
       );
       // Add the new pico-sdk includePath
       config.includePath.push(`\${userHome}/.pico-sdk/sdk/${newSDKVersion}/**`);
+
+      // Remove the old pico-sdk forcedInclude values set by this extension
+      config.forcedInclude = config.forcedInclude.filter(
+        item => !item.startsWith("${userHome}/.pico-sdk")
+      );
+      // Add the new pico-sdk forcedInclude
+      config.forcedInclude.push(
+        `\${userHome}/.pico-sdk/sdk/${newSDKVersion}/src/common/pico_base/include/pico.h`
+      );
+
       // Update the compilerPath
       config.compilerPath =
         "${userHome}/.pico-sdk/toolchain" +
This page took 0.032184 seconds and 4 git commands to generate.