]> Git Repo - pico-vscode.git/commitdiff
c_cpp_properties platform independent + fixed switch SDK issue
authorpaulober <[email protected]>
Wed, 8 May 2024 14:01:45 +0000 (16:01 +0200)
committerpaulober <[email protected]>
Wed, 8 May 2024 14:01:45 +0000 (16:01 +0200)
Signed-off-by: paulober <[email protected]>
scripts/pico_project.py
src/utils/vscodeConfigUtil.mts

index 2ffcc084e7fb6b77ba8b893e91a44aef3397bf92..548967d947444bd3d7a3005519becfbc574b441c 100644 (file)
@@ -830,10 +830,10 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
             "name": "Pico",
             "includePath": [
                 "${{workspaceFolder}}/**",
-                "{propertiesSdkPath(sdkVersion)}/**"
+                "{codeSdkPath(sdkVersion)}/**"
             ],
             "forcedInclude": [
-                "{propertiesSdkPath(sdkVersion)}/src/common/pico_base/include/pico.h",
+                "{codeSdkPath(sdkVersion)}/src/common/pico_base/include/pico.h",
                 "${{workspaceFolder}}/build/generated/pico_base/pico/config_autogen.h"
             ],
             "defines": [],
@@ -1138,7 +1138,7 @@ if args.name == None and not args.gui and not args.list and not args.configs and
 if args.cpath:
     compilerPath = Path(args.cpath)
 elif args.toolchainVersion:
-    compilerPath = Path(propertiesToolchainPath(args.toolchainVersion)+"/bin/"+COMPILER_NAME)
+    compilerPath = Path(codeToolchainPath(args.toolchainVersion)+"/bin/"+COMPILER_NAME)
 else:
     compilerPath = Path(c)
 
index f81688d8a41b9a688d2eef92281329c891845a56..d20d84d05a109b2257354f21330768981b96333f 100644 (file)
@@ -28,13 +28,13 @@ async function updateCppPropertiesFile(
     cppProperties.configurations.forEach(config => {
       // Remove the old pico-sdk includePath values set by this extension
       config.includePath = config.includePath.filter(
-        item => !item.startsWith("${env:HOME}/.pico-sdk")
+        item => !item.startsWith("${userHome}/.pico-sdk")
       );
       // Add the new pico-sdk includePath
-      config.includePath.push(`\${env:HOME}/.pico-sdk/sdk/${newSDKVersion}/**`);
+      config.includePath.push(`\${userHome}/.pico-sdk/sdk/${newSDKVersion}/**`);
       // Update the compilerPath
       config.compilerPath =
-        "${env:HOME}/.pico-sdk/toolchain" +
+        "${userHome}/.pico-sdk/toolchain" +
         `/${newToolchainVersion}/bin/${
           // "arm-none-eabi-gcc" should work on all platforms no need for extension on Windows
           /*process.platform === "win32"
@@ -94,10 +94,7 @@ function relativeToolchainPath(toolchainVersion: string): string {
  * @returns The path to the toolchain.
  */
 function buildPropertiesToolchainPathBin(toolchainVersion: string): string {
-  // TODO: may home is also available in newer versions of windows
-  return `${
-    process.platform === "win32" ? "${env:USERPROFILE}" : "${env:HOME}"
-  }${relativeToolchainPath(toolchainVersion)}/bin`;
+  return `\${userHome}${relativeToolchainPath(toolchainVersion)}/bin`;
 }
 
 function buildCMakePath(cmakeVersion: string): string {
This page took 0.042391 seconds and 4 git commands to generate.