Skip to content

Commit

Permalink
Added support for updating the forcedInclude paths on SDK change
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed May 8, 2024
1 parent a64fcd1 commit 8a76ebe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils/vscodeConfigUtil.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { dirname } from "path/posix";

interface Configuration {
includePath: string[];
forcedInclude: string[];
compilerPath: string;
}

Expand All @@ -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`

Check warning on line 43 in src/utils/vscodeConfigUtil.mts

View workflow job for this annotation

GitHub Actions / build

This line has a length of 89. Maximum allowed is 80
);

// Update the compilerPath
config.compilerPath =
"${userHome}/.pico-sdk/toolchain" +
Expand Down

0 comments on commit 8a76ebe

Please sign in to comment.