diff --git a/package.json b/package.json index 1c8408b..fd26dd1 100644 --- a/package.json +++ b/package.json @@ -750,6 +750,38 @@ "default": null, "description": "Custom PATH for the `platformio` command, if you prefer to use a custom version of PlatformIO Core. Fill in the result of the system terminal command `echo $PATH` (Unix) / `echo %PATH%` (Windows)." }, + "platformio-ide.platformsPATH": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Custom PATH for the platforms directory, it will be the value of the enviroment variable PLATFORMIO_PLATFORMS_DIR." + }, + "platformio-ide.packagesPATH": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Custom PATH for the packages directory, it will be the value of the enviroment variable PLATFORMIO_PACKAGES_DIR." + }, + "platformio-ide.cachePATH": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Custom PATH for the cache directory, it will be the value of the enviroment variable PLATFORMIO_CACHE_DIR." + }, + "platformio-ide.projectsDirectoryPATH": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "Custom PATH for the projects directory, it will be the value of the enviroment variable PLATFORMIO_SETTING_PROJECTS_DIR." + }, "platformio-ide.reopenSerialMonitorDelay": { "type": "integer", "default": 0, @@ -793,6 +825,11 @@ "default": null, "description": "Custom base URL of the Python Package Index (default `https://pypi.org/simple`)" }, + "platformio-ide.enableTelemetry": { + "type": "boolean", + "default": true, + "description": "Share minimal diagnostics and usage information to help us make PlatformIO better, more information: https://docs.platformio.org/en/latest/core/userguide/cmd_settings.html#setting-enable-telemetry." + }, "platformio-ide.toolbar": { "description": "PlatformIO Toolbar", "type": "array", diff --git a/src/main.js b/src/main.js index b3bac80..236477b 100644 --- a/src/main.js +++ b/src/main.js @@ -149,6 +149,24 @@ class PlatformIOVSCodeExtension { if (this.getConfiguration('customPyPiIndexUrl')) { extraVars['PIP_INDEX_URL'] = this.getConfiguration('customPyPiIndexUrl'); } + + // configure telemetry + extraVars['PLATFORMIO_SETTING_ENABLE_TELEMETRY'] = this.getConfiguration('enableTelemetry') ? 'yes' : 'no'; + + // configure custom paths + if (this.getConfiguration('platformsPATH')) { + extraVars['PLATFORMIO_PLATFORMS_DIR'] = this.getConfiguration('platformsPATH'); + } + if (this.getConfiguration('packagesPATH')) { + extraVars['PLATFORMIO_PACKAGES_DIR'] = this.getConfiguration('packagesPATH'); + } + if (this.getConfiguration('cachePATH')) { + extraVars['PLATFORMIO_CACHE_DIR'] = this.getConfiguration('cachePATH'); + } + if (this.getConfiguration('projectsDirectoryPATH')) { + extraVars['PLATFORMIO_SETTING_PROJECTS_DIR'] = this.getConfiguration('projectsDirectoryPATH'); + } + pioNodeHelpers.proc.patchOSEnviron({ caller: 'vscode', extraPath: this.getConfiguration('customPATH'),