From 6a38f9c8b864eb810d369e3e48ea1f54a48878fb Mon Sep 17 00:00:00 2001 From: Brian Ignacio Date: Fri, 29 Nov 2024 18:41:43 +0800 Subject: [PATCH 01/35] draft eim integration --- l10n/bundle.l10n.es.json | 1 + l10n/bundle.l10n.pt.json | 1 + l10n/bundle.l10n.ru.json | 1 + package.json | 11 + package.nls.es.json | 2 + package.nls.json | 2 + package.nls.pt.json | 4 +- package.nls.ru.json | 2 + package.nls.zh-CN.json | 374 ++++++++++++++++--------------- src/cmdTreeView/cmdStore.ts | 6 + src/config.ts | 4 + src/eim/getExistingSetups.ts | 124 ++++++++++ src/extension.ts | 4 + src/newProject/newProjectInit.ts | 6 +- src/setup/setupInit.ts | 6 +- src/versionSwitcher/index.ts | 6 +- src/views/welcome/App.vue | 4 + 17 files changed, 368 insertions(+), 190 deletions(-) create mode 100644 src/eim/getExistingSetups.ts diff --git a/l10n/bundle.l10n.es.json b/l10n/bundle.l10n.es.json index dae71c7e4..1fcfaa969 100644 --- a/l10n/bundle.l10n.es.json +++ b/l10n/bundle.l10n.es.json @@ -146,6 +146,7 @@ "Discarded changes in SDK Configuration editor": "Cambios descartados en el editor de configuración del SDK", "Error encountered while adding dependency {dependency} to the component \"{component}\"": "Se encontró un error al agregar la dependencia {dependency} al componente \"{component}\"", "Error encountered while creating project from example \"{example}\"": "Se encontró un error al crear un proyecto a partir del ejemplo \"{example}\"", + "Open ESP-IDF installation manager": "Abra el administrador de instalación ESP-IDF", "Create ESP-IDF From Extension Templates": "Cree ESP-IDF a partir de plantillas de extensión", "Install ESP-ADF": "Instalar ESP-ADF", "Install ESP-MDF": "Instalar ESP-MDF", diff --git a/l10n/bundle.l10n.pt.json b/l10n/bundle.l10n.pt.json index 6f760697d..f9e8c7a6e 100644 --- a/l10n/bundle.l10n.pt.json +++ b/l10n/bundle.l10n.pt.json @@ -146,6 +146,7 @@ "Discarded changes in SDK Configuration editor": "Alterações descartadas no editor de configuração do SDK", "Error encountered while adding dependency {dependency} to the component \"{component}\"": "Erro encontrado ao adicionar a dependência {dependency} ao componente \"{component}\"", "Error encountered while creating project from example \"{example}\"": "Erro encontrado ao criar o projeto do exemplo \"{example}\"", + "Open ESP-IDF installation manager": "Abra o gerenciador de instalação ESP-IDF", "Create ESP-IDF From Extension Templates": "Crie ESP-IDF a partir de modelos de extensão", "Install ESP-ADF": "Instale ESP-ADF", "Install ESP-MDF": "Instale ESP-MDF", diff --git a/l10n/bundle.l10n.ru.json b/l10n/bundle.l10n.ru.json index 66908b7ec..45f4e7e61 100644 --- a/l10n/bundle.l10n.ru.json +++ b/l10n/bundle.l10n.ru.json @@ -146,6 +146,7 @@ "Discarded changes in SDK Configuration editor": "Отменены изменения в редакторе конфигурации SDK.", "Error encountered while adding dependency {dependency} to the component \"{component}\"": "Произошла ошибка при добавлении зависимости {dependent} к компоненту \"{comment}\".", "Error encountered while creating project from example \"{example}\"": "Ошибка при создании проекта из примера \"{example}\".", + "Open ESP-IDF installation manager": "Откройте диспетчер установки ESP-IDF.", "Create ESP-IDF From Extension Templates": "Создание ESP-IDF из шаблонов расширений", "Install ESP-ADF": "Установите ESP-ADF", "Install ESP-MDF": "Установить ЭСП-МДФ", diff --git a/package.json b/package.json index 79992eea5..029e60955 100644 --- a/package.json +++ b/package.json @@ -584,6 +584,12 @@ { "title": "%configuration.title%", "properties": { + "idf.espIdeJsonPath": { + "type": "string", + "default": "", + "description": "%param.espIdeJsonPath%", + "scope": "application" + }, "idf.espIdfPath": { "type": "string", "default": "${env:IDF_PATH}", @@ -1246,6 +1252,11 @@ "title": "%espIdf.setup.title%", "category": "ESP-IDF" }, + { + "command": "espIdf.installManager", + "title": "%espIdf.installManager.title%", + "category": "ESP-IDF" + }, { "command": "espIdf.examples.start", "title": "%espIdf.examples.title%", diff --git a/package.nls.es.json b/package.nls.es.json index 49d9940bb..9843b53df 100644 --- a/package.nls.es.json +++ b/package.nls.es.json @@ -53,6 +53,7 @@ "espIdf.idfReconfigureTask.title": "ESP-IDF: Ejecute la tarea de reconfiguración de idf.py", "espIdf.importProject.title": "Importar proyecto ESP-IDF", "espIdf.installEspMatterPyReqs.title": "Instalar paquetes Python de ESP-Matter", + "espIdf.installManager.title": "Abrir el administrador de instalación ESP-IDF", "espIdf.installPyReqs.title": "Instalar paquetes Python de la extensión ESP-IDF", "espIdf.jtag_flash.title": "Flashear (con JTag)", "espIdf.launchQemu.title": "Iniciar servidor QEMU", @@ -167,6 +168,7 @@ "param.usbSerialPortFilters.vendorId": "Número hexadecimal del USB vendorID como texto.", "param.usbSerialPortFilters.productId": "Número hexadecimal del USB productID como texto.", "param.hasWalkthroughBeenShown": "Indica si se ha mostrado el recorrido de bienvenida", + "param.espIdeJsonPath": "Ruta personalizada de esp_ide.json para encontrar instalaciones de ESP-IDF", "trace.poll_period.description": "poll_period se establecerá para el rastreo de la aplicación", "trace.skip_size.description": "skip_size se establecerá para el rastreo de la aplicación", "trace.stop_tmo.description": "stop_tmo se establecerá para el rastreo de la aplicación", diff --git a/package.nls.json b/package.nls.json index 2f36806f4..6681f264f 100644 --- a/package.nls.json +++ b/package.nls.json @@ -53,6 +53,7 @@ "espIdf.idfReconfigureTask.title": "ESP-IDF: Run idf.py reconfigure Task", "espIdf.importProject.title": "Import ESP-IDF Project", "espIdf.installEspMatterPyReqs.title": "Install ESP-Matter Python Packages", + "espIdf.installManager.title": "Open ESP-IDF Install manager", "espIdf.installPyReqs.title": "Install ESP-IDF Extension Python Packages", "espIdf.jtag_flash.title": "Flash (with JTag)", "espIdf.launchQemu.title": "Launch QEMU Server", @@ -167,6 +168,7 @@ "param.usbSerialPortFilters.vendorId": "USB Vendor ID hex number as string, e.g., 0x0403", "param.usbSerialPortFilters.productId": "USB Product ID hex number as string, e.g., 0x6010", "param.hasWalkthroughBeenShown": "Has the walkthrough been shown", + "param.espIdeJsonPath": "Custom path for esp_ide.json to find ESP-IDF installs", "trace.poll_period.description": "poll_period will be set for the apptrace", "trace.skip_size.description": "skip_size will be set for the apptrace", "trace.stop_tmo.description": "stop_tmo will be set for the apptrace", diff --git a/package.nls.pt.json b/package.nls.pt.json index 40ed77072..6852a5a3f 100644 --- a/package.nls.pt.json +++ b/package.nls.pt.json @@ -53,6 +53,7 @@ "espIdf.idfReconfigureTask.title": "ESP-IDF: Execute a tarefa de reconfiguração idf.py", "espIdf.importProject.title": "Importar projeto ESP-IDF", "espIdf.installEspMatterPyReqs.title": "Instale pacotes ESP-Matter Python", + "espIdf.installManager.title": "Abra o gerenciador de instalação ESP-IDF", "espIdf.installPyReqs.title": "Instale pacotes Python de extensão ESP-IDF", "espIdf.jtag_flash.title": "Flash (com JTag)", "espIdf.launchQemu.title": "Inicie o servidor QEMU", @@ -163,8 +164,9 @@ "param.useSerialPortVendorProductFilter.title": "Use USB productID e vendorID para filtrar dispositivos Espressif conhecidos", "param.usbSerialPortFilters.title": "Lista de productID e vendorID da porta serial USB para filtrar", "param.usbSerialPortFilters.vendorId": "Número hexadecimal do USB vendorID como string.", - "param.usbSerialPortFilters.productId": "Número hexadecimal de USB productID como string.", + "param.usbSerialPortFilters.productId": "Número hexadecimal do USB productID como string.", "param.hasWalkthroughBeenShown": "Mostrar o guia de introdução na inicialização da extensão", + "param.espIdeJsonPath": "Caminho personalizado do esp_ide.json para encontrar instalações do ESP-IDF", "trace.poll_period.description": "poll_period será definido para o apptrace", "trace.skip_size.description": "skip_size será definido para o apptrace", "trace.stop_tmo.description": "stop_tmo será definido para o apptrace", diff --git a/package.nls.ru.json b/package.nls.ru.json index 3d493f590..0f87329a4 100644 --- a/package.nls.ru.json +++ b/package.nls.ru.json @@ -53,6 +53,7 @@ "espIdf.idfReconfigureTask.title": "ESP-IDF: запустить задачу перенастройки idf.py", "espIdf.importProject.title": "Импортировать проект ESP-IDF", "espIdf.installEspMatterPyReqs.title": "Установите пакеты Python ESP-Matter", + "espIdf.installManager.title": "Откройте диспетчер установки ESP-IDF.", "espIdf.installPyReqs.title": "Установите пакеты Python расширения ESP-IDF", "espIdf.jtag_flash.title": "Flash (с JTag)", "espIdf.launchQemu.title": "Запустить сервер QEMU", @@ -167,6 +168,7 @@ "param.usbSerialPortFilters.vendorId": "Шестнадцатеричный номер USB VendorID в виде строки. ", "param.usbSerialPortFilters.productId": "Шестнадцатеричный номер USB ProductID в виде строки. ", "param.hasWalkthroughBeenShown": "Показывать ли руководство по настройке ESP-IDF при первом запуске.", + "param.espIdeJsonPath": "Пользовательский путь для esp_ide.json для поиска установок ESP-IDF.", "trace.poll_period.description": "poll_ period будет установлен для apptrace", "trace.skip_size.description": "Skip_size будет установлен для трассировки приложения.", "trace.stop_tmo.description": "stop_tmo будет установлен для apptrace", diff --git a/package.nls.zh-CN.json b/package.nls.zh-CN.json index 8d34cd36c..5b7442c37 100644 --- a/package.nls.zh-CN.json +++ b/package.nls.zh-CN.json @@ -1,188 +1,190 @@ { - "configuration.title": "ESP-IDF", - "debug.initConfig.description": "为启动 ESP-IDF 项目创建新配置", - "debug.initConfig.name": "ESP-IDF 调试:启动", - "esp.component-manager.cli.addDependencyError": "添加依赖到组件时出错", - "esp.component-manager.ui.show.title": "乐鑫组件注册表", - "esp.component-manager.url.description": "乐鑫组件注册表 URL", - "esp.efuse.summary.title": "获取 eFuse 摘要", - "esp.rainmaker.backend.add_node.title": "添加新节点", - "esp.rainmaker.backend.connect.title": "连接 ESP-Rainmaker 云服务器", - "esp.rainmaker.backend.logout.title": "取消与 Rainmaker 帐户的绑定", - "esp.rainmaker.backend.remove_node.title": "移除此节点", - "esp.rainmaker.backend.sync.title": "同步 ESP-Rainmaker 云服务器", - "esp.rainmaker.backend.update_node_param.title": "为设备更新参数", - "esp.webview.open.partition-table.title": "ESP-IDF:打开分区表编辑器 UI", - "espIdf.addArduinoAsComponentToCurFolder.title": "添加 Arduino ESP32 为 ESP-IDF 组件", - "espIdf.apptrace.archive.refresh.title": "刷新跟踪存档列表", - "espIdf.apptrace.archive.showReport.title": "显示跟踪报告", - "espIdf.apptrace.customize.title": "自定义应用程序跟踪参数", - "espIdf.apptrace.title": "应用程序跟踪", - "espIdf.buildDevice.title": "构建项目", - "espIdf.buildFlashMonitor.title": "构建、烧录项目并监视设备", - "espIdf.clearDocsSearchResult.title": "清除 ESP-IDF 搜索结果", - "espIdf.clearSavedIdfSetups.title": "清除已保存的 ESP-IDF 设置", - "espIdf.cmakeListsEditor.start.title": "CMakeLists.txt 编辑器", - "espIdf.createDevContainer.title": "添加 Docker 容器配置", - "espIdf.createFiles.title": "基于模板创建新项目", - "espIdf.createIdfTerminal.title": "打开 ESP-IDF 终端", - "espIdf.createNewComponent.title": "创建新 ESP-IDF 组件", - "espIdf.createSbom.title": "运行 ESP-IDF-SBOM 漏洞检查", - "espIdf.createVsCodeFolder.title": "添加 VS Code 配置文件夹", - "espIdf.customTask.title": "执行自定义任务", - "espIdf.disposeConfserverProcess.title": "清理当前 SDK 配置编辑器服务器进程", - "espIdf.doctorCommand.title": "诊断命令", - "espIdf.troubleshootPanel.title": "ESP-IDF:故障排除表", - "espIdf.efuse.clearResults.title": "清除 eFuse 摘要", - "espIdf.eraseFlash.title": "擦除设备 flash 数据", - "espIdf.examples.title": "展示示例项目", - "espIdf.flashAndEncryptDevice.title": "加密并烧录项目", - "espIdf.flashBinaryToPartition.title": "将二进制文件烧录到分区…", - "espIdf.flashDFU.title": "通过 DFU 接口烧录项目", - "espIdf.flashDevice.title": "烧录项目", - "espIdf.flashUart.title": "通过 UART 接口烧录项目", - "espIdf.fullClean.title": "彻底清理项目", - "espIdf.genCoverage.title": "添加编辑器覆盖率功能", - "espIdf.getCoverageReport.title": "生成 HTML 格式的代码覆盖率报告", - "espIdf.getEspAdf.title": "安装 ESP-ADF", - "espIdf.getEspHomeKitSdk.title": "安装 ESP-HomeKit-SDK", - "espIdf.getEspMatter.title": "安装 ESP-Matter", - "espIdf.getEspMdf.title": "安装 ESP-MDF", - "espIdf.getEspRainmaker.title": "安装 ESP-Rainmaker", - "espIdf.heaptrace.title": "堆跟踪", - "espIdf.idfReconfigureTask.title": "ESP-IDF: 运行 idf.py reconfigure 任务", - "espIdf.importProject.title": "导入 ESP-IDF 项目", - "espIdf.installEspMatterPyReqs.title": "安装 ESP-Matter Python 包", - "espIdf.installPyReqs.title": "安装 ESP-IDF 扩展 Python 包", - "espIdf.jtag_flash.title": "通过 JTAG 接口烧录项目", - "espIdf.launchQemu.title": "启动 QEMU 服务器", - "espIdf.launchWSServerAndMonitor.title": "启动 IDF 监视器以支持核心转储模式/GDB 存根模式", - "espIdf.menuconfig.start.title": "SDK 配置编辑器 (Menuconfig)", - "espIdf.monitorDevice.title": "监视设备", - "espIdf.monitorQemu.title": "监视 QEMU 设备", - "espIdf.newProject.start.title": "新建项目", - "espIdf.ninja.summary.title": "显示 Ninja 构建摘要", - "espIdf.openDocUrl.title": "打开 ESP-IDF 文档…", - "espIdf.openOCDCommand.title": "OpenOCD 管理器", - "espIdf.partition.table.refresh.title": "刷新分区表", - "espIdf.pickAWorkspaceFolder.title": "选择工作区文件夹", - "espIdf.projectConf.title": "选择项目配置", - "espIdf.projectConfigurationEditor.title": "打开项目配置", - "espIdf.qemuDebug.title": "启动 QEMU 调试会话", - "espIdf.removeCoverage.title": "移除编辑器覆盖率", - "espIdf.saveDefSdkconfig.title": "ESP-IDF:保存默认 SDKCONFIG 文件 (save-defconfig)", - "espIdf.searchInEspIdfDocs.title": "在文档中搜索…", - "espIdf.selectConfTarget.title": "选择配置存储位置", - "espIdf.selectCurrentIdfVersion.title": "选择当前使用的 ESP-IDF 版本", - "espIdf.selectFlashMethodAndFlash.title": "选择烧录方式", - "espIdf.selectNotificationMode.title": "选择输出和通知模式", - "espIdf.selectOpenOcdConfigFiles.title": "选择 OpenOCD 开发板配置", - "espIdf.selectPort.title": "选择要使用的端口 (COM、tty、usbserial)", - "espIdf.setGcovConfig.title": "配置 SDKConfig 文件以启用代码覆盖率", - "espIdf.setMatterDevicePath.title": "设置 ESP-MATTER 设备路径 (ESP_MATTER_DEVICE_PATH)", - "espIdf.setTarget.title": "设置乐鑫设备目标", - "espIdf.setup.title": "配置 ESP-IDF 扩展", - "espIdf.size.title": "二进制文件大小分析", - "espIdf.unitTest.buildFlashUnitTestApp.title": "单元测试:构建并烧录单元测试应用程序", - "espIdf.unitTest.installPyTest.title": "单元测试:安装 ESP-IDF PyTest 依赖项", - "espIdf.webview.nvsPartitionEditor.title": "打开 NVS 分区编辑器", - "espIdf.welcome.title": "欢迎使用 ESP-IDF 扩展", - "esp_idf.appOffset.description": "覆盖构建程序的起始地址偏移量 (ESP32_APP_FLASH_OFF)", - "esp_idf.debuggers.text.description": "要执行的命令", - "esp_idf.gdbinitFile.description": "ESP-IDF 调试适配器的 gdbinit 文件路径", - "esp_idf.initGdbCommands.description": "执行一个或多个 GDB 命令来设置底层调试器。例如:\"initGdbCommands\": [ \"target remote /dev/ttyUSB0\"]", - "esp_idf.tmoScaleFactor.description": "GDB 超时的缩放因子 [默认值:1]", - "esp_idf.verifyAppBinBeforeDebug.description": "在调试前验证应用程序二进制文件", - "espIdf.searchError.title": "ESP-IDF: 搜索错误提示", - "idf.flashType.description": "设备烧录方式,UART 或 JTAG", - "idf.wssPort.description": "用于核心转储或 GDB 存根的 WebSocket 服务器端口", - "openocd.tcl.host.description": "用于 OpenOCD TCL 连接的主机", - "openocd.tcl.port.description": "用于 OpenOCD TCL 连接的端口", - "param.adapterTargetName": "为 ESP-IDF 调试适配器指定目标", - "param.buildPath": "CMake 构建目录的名称", - "param.cmakeCompilerArgs": "用于 CMake 编译任务的参数", - "param.coveredDarkTheme": "深色主题下 ESP-IDF 覆盖率报告中覆盖行的背景颜色", - "param.coveredLightTheme": "浅色主题下 ESP-IDF 覆盖率报告中覆盖行的背景颜色", - "param.customAdapterTargetName": "自定义 ESP-IDF 调试适配器目标的名称", - "param.customTask": "自定义任务", - "param.customTerminalExecutable.title": "自定义扩展任务的可执行文件", - "param.customTerminalExecutableArgs.title": "扩展任务的自定义可执行文件的参数列表", - "param.deleteComponentsOnFullClean": "在“彻底清理项目”命令中删除 managed_components", - "param.enableCCache.title": "在构建任务中启用 CCache", - "param.enableIdfComponentManager.title": "在构建任务中启用 IDF 组件管理器", - "param.enableSizeTaskAfterBuildTask.title": "在构建任务完成后执行 IDF 二进制文件大小分析", - "param.enableStatusBar.title": "启用 ESP-IDF 扩展状态栏", - "param.enableUpdateSrcsToCMakeListsFile": "在 CMakeLists.txt 文件中启用更新源文件的功能", - "param.esp.rainmaker.oauth.url": "ESP-Rainmaker OAuth 服务器 URL", - "param.espAdfPath": "指定 ESP-ADF 框架的路径 (ADF_PATH)", - "param.espHomeKitSdkPath": "指定 ESP-HomeKit-SDK 框架的路径 (HOMEKIT_PATH)", - "param.espIdfPath": "指定 ESP-IDF 框架的路径 (IDF_PATH)", - "param.espMatterPath": "指定 ESP-Matter 框架的路径 (ESP_MATTER_PATH)", - "param.espMdfPath": "指定 ESP-MDF 框架的路径 (MDF_PATH)", - "param.espRainmakerPath": "指定 ESP-Rainmaker 框架的路径 (RMAKER_PATH)", - "param.exportVars": "要添加到系统环境变量中的变量", - "param.flashBaudRate": "ESP-IDF 烧录速率", - "param.gitPath.title": "Git 可执行文件的路径", - "param.launchMonitorOnDebugSession.title": "在 ESP-IDF 调试适配器会话中启动 IDF 监视器", - "param.monitorBaudRate": "ESP-IDF 监视器的波特率值", - "param.monitorCustomTimestampFormat": "在 IDF 监视器中自定义时间戳格式", - "param.monitorEnableTimestamps": "启用 IDF 监视器中的时间戳", - "param.monitorNoReset": "启用 IDF 监视器的不重置标志", - "param.monitorStartDelayBeforeDebug": "运行 IDF 监视器后延迟启动调试会话 (ms)", - "param.ninjaArgs": "Ninja 构建任务的参数", - "param.notificationMode": "选择 ESP-IDF 扩展的通知和输出窗口显示", - "param.notificationMode.all": "显示通知,并切换到任务输出窗口", - "param.notificationMode.notification": "显示通知,不显示任务输出", - "param.notificationMode.output": "显示任务输出,不显示通知", - "param.notificationMode.silent": "不显示通知和任务输出", - "param.openOcdConfigFilesList": "OpenOCD 脚本目录中的配置文件列表", - "param.openOcdDebugLevel": "OpenOCD 服务器调试级别", - "param.openOcdLaunchArgs": "从此扩展启动 OpenOCD 的参数", - "param.partialDarkTheme": "深色主题下 ESP-IDF 代码覆盖率报告中部分覆盖行的背景颜色", - "param.partialLightTheme": "浅色主题下 ESP-IDF 代码覆盖率报告中部分覆盖行的背景颜色", - "param.port": "已选设备端口的路径", - "param.postBuildTask": "构建后的自定义任务", - "param.postFlashTask": "烧录后的自定义任务", - "param.preBuildTask": "构建前的自定义任务", - "param.preFlashTask": "烧录前的自定义任务", - "param.pythonBinPath": "用于执行 ESP-IDF Python 脚本的 Python 绝对路径", - "param.qemuTcpPort": "QEMU 用于串行通信的 TCP 端口", - "param.rainmaker.api.server_url": "ESP-Rainmaker 云服务器 URL", - "param.saveBeforeBuildDescription": "在继续构建之前保存工作区中的所有编辑文件(若未能保存文件,构建仍将继续)", - "param.saveScope": "指定 ESP-IDF 命令的配置作用域,Global = 1,Workspace = 2,WorkspaceFolder = 3", - "param.sbomFilePath.title": "ESP-IDF SBOM 文件路径", - "param.sdkconfigDefaults": "初始构建配置的 sdkconfig 默认值列表", - "param.sdkconfigFilePath.title": "sdkconfig 文件的绝对路径", - "param.showOnboardingOnInit": "在激活扩展时显示 ESP-IDF 配置窗口", - "param.svdFile": "用于解析 ESP-IDF 外设视图的 SVD 文件,显示在调试视图中", - "param.telemetry": "将匿名遥测和崩溃报告发送回扩展 (更改设置后需要重新启动以生效)", - "param.toolsPath": "指定 ESP-IDF 工具的路径 (IDF_TOOLS_PATH)", - "param.uncoveredDarkTheme": "深色主题下 ESP-IDF 代码覆盖率报告中未覆盖行的背景颜色", - "param.uncoveredLightTheme": "浅色主题下 ESP-IDF 代码覆盖率报告中未覆盖行的背景颜色", - "param.useIDFKConfigStyle": "启用/禁用 Kconfig 文件的 ESP-IDF 样式验证", - "param.hintsViewer.title": "提示文件的路径", - "param.enableSerialPortChipIdRequest.title": "启用检测芯片 ID 并显示在串口选择列表中", - "param.useSerialPortVendorProductFilter.title": "使用 USB 产品 ID 和厂商 ID 来过滤已知的乐鑫设备", - "param.usbSerialPortFilters.title": "用于筛选 USB 串口的产品 ID 和厂商 ID 列表", - "param.usbSerialPortFilters.vendorId": "USB 厂商 ID 为十六进制格式的字符串,例如 0x0403", - "param.usbSerialPortFilters.productId": "USB 产品 ID 为十六进制格式的的字符串,例如 0x6010", - "param.hasWalkthroughBeenShown": "是否已经展示教程", - "trace.poll_period.description": "设置 apptrace 的 poll_period 参数", - "trace.skip_size.description": "设置 apptrace 的 skip_size 参数", - "trace.stop_tmo.description": "设置 apptrace 的 stop_tmo 参数", - "trace.trace_size.description": "设置 apptrace 的 trace_size 参数", - "trace.wait4halt.description": "设置 apptrace 的 wait4halt 参数", - "view.components.name": "项目组件", - "view.debug.peripheral": "ESP-IDF:外设视图", - "view.idf.espEFuseExplorer": "eFuse 资源管理器", - "view.idf.espRainmaker": "RainMaker", - "view.idf.idfAppTraceArchive": "应用跟踪存档", - "view.idf.idfAppTracer": "应用跟踪器", - "view.idf.idfCommands": "命令", - "view.idf.idfPartitionExplorer": "设备分区资源管理器", - "view.idf.idfSearchResults": "文档搜索结果", - "viewContainer.title": "ESP-IDF:资源管理器", - "viewWelcome.idfPartitionExplorer": "显示设备的分区列表,选择烧录二进制文件 (.bin) 的分区。\n\n选择设备串口,单击“刷新分区表”。", - "viewWelcome.idfSearchResults": "在任一打开的文件编辑器中选定文本,右键单击并选择“ESP-IDF:在文档中搜索”,搜索匹配的结果。\n\n搜索结果基于当前的 VS Code 语言以及 idf.espIdfPath 版本 (若未指定版本,则默认使用最新版 ESP-IDF)。", - "viewWelcome.peripheralView": "在活动调试会话中,显示 ESP-IDF SVD 文件 (路径为 idf.svdFilePath) 中包含的外设寄存器信息。" + "configuration.title": "ESP-IDF", + "debug.initConfig.description": "为启动 ESP-IDF 项目创建新配置", + "debug.initConfig.name": "ESP-IDF 调试:启动", + "esp.component-manager.cli.addDependencyError": "添加依赖到组件时出错", + "esp.component-manager.ui.show.title": "乐鑫组件注册表", + "esp.component-manager.url.description": "乐鑫组件注册表 URL", + "esp.efuse.summary.title": "获取 eFuse 摘要", + "esp.rainmaker.backend.add_node.title": "添加新节点", + "esp.rainmaker.backend.connect.title": "连接 ESP-Rainmaker 云服务器", + "esp.rainmaker.backend.logout.title": "取消与 Rainmaker 帐户的绑定", + "esp.rainmaker.backend.remove_node.title": "移除此节点", + "esp.rainmaker.backend.sync.title": "同步 ESP-Rainmaker 云服务器", + "esp.rainmaker.backend.update_node_param.title": "为设备更新参数", + "esp.webview.open.partition-table.title": "ESP-IDF:打开分区表编辑器 UI", + "espIdf.addArduinoAsComponentToCurFolder.title": "添加 Arduino ESP32 为 ESP-IDF 组件", + "espIdf.apptrace.archive.refresh.title": "刷新跟踪存档列表", + "espIdf.apptrace.archive.showReport.title": "显示跟踪报告", + "espIdf.apptrace.customize.title": "自定义应用程序跟踪参数", + "espIdf.apptrace.title": "应用程序跟踪", + "espIdf.buildDevice.title": "构建项目", + "espIdf.buildFlashMonitor.title": "构建、烧录项目并监视设备", + "espIdf.clearDocsSearchResult.title": "清除 ESP-IDF 搜索结果", + "espIdf.clearSavedIdfSetups.title": "清除已保存的 ESP-IDF 设置", + "espIdf.cmakeListsEditor.start.title": "CMakeLists.txt 编辑器", + "espIdf.createDevContainer.title": "添加 Docker 容器配置", + "espIdf.createFiles.title": "基于模板创建新项目", + "espIdf.createIdfTerminal.title": "打开 ESP-IDF 终端", + "espIdf.createNewComponent.title": "创建新 ESP-IDF 组件", + "espIdf.createSbom.title": "运行 ESP-IDF-SBOM 漏洞检查", + "espIdf.createVsCodeFolder.title": "添加 VS Code 配置文件夹", + "espIdf.customTask.title": "执行自定义任务", + "espIdf.disposeConfserverProcess.title": "清理当前 SDK 配置编辑器服务器进程", + "espIdf.doctorCommand.title": "诊断命令", + "espIdf.troubleshootPanel.title": "ESP-IDF:故障排除表", + "espIdf.efuse.clearResults.title": "清除 eFuse 摘要", + "espIdf.eraseFlash.title": "擦除设备 flash 数据", + "espIdf.examples.title": "展示示例项目", + "espIdf.flashAndEncryptDevice.title": "加密并烧录项目", + "espIdf.flashBinaryToPartition.title": "将二进制文件烧录到分区…", + "espIdf.flashDFU.title": "通过 DFU 接口烧录项目", + "espIdf.flashDevice.title": "烧录项目", + "espIdf.flashUart.title": "通过 UART 接口烧录项目", + "espIdf.fullClean.title": "彻底清理项目", + "espIdf.genCoverage.title": "添加编辑器覆盖率功能", + "espIdf.getCoverageReport.title": "生成 HTML 格式的代码覆盖率报告", + "espIdf.getEspAdf.title": "安装 ESP-ADF", + "espIdf.getEspHomeKitSdk.title": "安装 ESP-HomeKit-SDK", + "espIdf.getEspMatter.title": "安装 ESP-Matter", + "espIdf.getEspMdf.title": "安装 ESP-MDF", + "espIdf.getEspRainmaker.title": "安装 ESP-Rainmaker", + "espIdf.heaptrace.title": "堆跟踪", + "espIdf.idfReconfigureTask.title": "ESP-IDF: 运行 idf.py reconfigure 任务", + "espIdf.importProject.title": "导入 ESP-IDF 项目", + "espIdf.installEspMatterPyReqs.title": "安装 ESP-Matter Python 包", + "espIdf.installManager.title": "打开 ESP-IDF 安装管理器", + "espIdf.installPyReqs.title": "安装 ESP-IDF 扩展 Python 包", + "espIdf.jtag_flash.title": "通过 JTAG 接口烧录项目", + "espIdf.launchQemu.title": "启动 QEMU 服务器", + "espIdf.launchWSServerAndMonitor.title": "启动 IDF 监视器以支持核心转储模式/GDB 存根模式", + "espIdf.menuconfig.start.title": "SDK 配置编辑器 (Menuconfig)", + "espIdf.monitorDevice.title": "监视设备", + "espIdf.monitorQemu.title": "监视 QEMU 设备", + "espIdf.newProject.start.title": "新建项目", + "espIdf.ninja.summary.title": "显示 Ninja 构建摘要", + "espIdf.openDocUrl.title": "打开 ESP-IDF 文档…", + "espIdf.openOCDCommand.title": "OpenOCD 管理器", + "espIdf.partition.table.refresh.title": "刷新分区表", + "espIdf.pickAWorkspaceFolder.title": "选择工作区文件夹", + "espIdf.projectConf.title": "选择项目配置", + "espIdf.projectConfigurationEditor.title": "打开项目配置", + "espIdf.qemuDebug.title": "启动 QEMU 调试会话", + "espIdf.removeCoverage.title": "移除编辑器覆盖率", + "espIdf.saveDefSdkconfig.title": "ESP-IDF:保存默认 SDKCONFIG 文件 (save-defconfig)", + "espIdf.searchInEspIdfDocs.title": "在文档中搜索…", + "espIdf.selectConfTarget.title": "选择配置存储位置", + "espIdf.selectCurrentIdfVersion.title": "选择当前使用的 ESP-IDF 版本", + "espIdf.selectFlashMethodAndFlash.title": "选择烧录方式", + "espIdf.selectNotificationMode.title": "选择输出和通知模式", + "espIdf.selectOpenOcdConfigFiles.title": "选择 OpenOCD 开发板配置", + "espIdf.selectPort.title": "选择要使用的端口 (COM、tty、usbserial)", + "espIdf.setGcovConfig.title": "配置 SDKConfig 文件以启用代码覆盖率", + "espIdf.setMatterDevicePath.title": "设置 ESP-MATTER 设备路径 (ESP_MATTER_DEVICE_PATH)", + "espIdf.setTarget.title": "设置乐鑫设备目标", + "espIdf.setup.title": "配置 ESP-IDF 扩展", + "espIdf.size.title": "二进制文件大小分析", + "espIdf.unitTest.buildFlashUnitTestApp.title": "单元测试:构建并烧录单元测试应用程序", + "espIdf.unitTest.installPyTest.title": "单元测试:安装 ESP-IDF PyTest 依赖项", + "espIdf.webview.nvsPartitionEditor.title": "打开 NVS 分区编辑器", + "espIdf.welcome.title": "欢迎使用 ESP-IDF 扩展", + "esp_idf.appOffset.description": "覆盖构建程序的起始地址偏移量 (ESP32_APP_FLASH_OFF)", + "esp_idf.debuggers.text.description": "要执行的命令", + "esp_idf.gdbinitFile.description": "ESP-IDF 调试适配器的 gdbinit 文件路径", + "esp_idf.initGdbCommands.description": "执行一个或多个 GDB 命令来设置底层调试器。例如:\"initGdbCommands\": [ \"target remote /dev/ttyUSB0\"]", + "esp_idf.tmoScaleFactor.description": "GDB 超时的缩放因子 [默认值:1]", + "esp_idf.verifyAppBinBeforeDebug.description": "在调试前验证应用程序二进制文件", + "espIdf.searchError.title": "ESP-IDF: 搜索错误提示", + "idf.flashType.description": "设备烧录方式,UART 或 JTAG", + "idf.wssPort.description": "用于核心转储或 GDB 存根的 WebSocket 服务器端口", + "openocd.tcl.host.description": "用于 OpenOCD TCL 连接的主机", + "openocd.tcl.port.description": "用于 OpenOCD TCL 连接的端口", + "param.adapterTargetName": "为 ESP-IDF 调试适配器指定目标", + "param.buildPath": "CMake 构建目录的名称", + "param.cmakeCompilerArgs": "用于 CMake 编译任务的参数", + "param.coveredDarkTheme": "深色主题下 ESP-IDF 覆盖率报告中覆盖行的背景颜色", + "param.coveredLightTheme": "浅色主题下 ESP-IDF 覆盖率报告中覆盖行的背景颜色", + "param.customAdapterTargetName": "自定义 ESP-IDF 调试适配器目标的名称", + "param.customTask": "自定义任务", + "param.customTerminalExecutable.title": "自定义扩展任务的可执行文件", + "param.customTerminalExecutableArgs.title": "扩展任务的自定义可执行文件的参数列表", + "param.deleteComponentsOnFullClean": "在“彻底清理项目”命令中删除 managed_components", + "param.enableCCache.title": "在构建任务中启用 CCache", + "param.enableIdfComponentManager.title": "在构建任务中启用 IDF 组件管理器", + "param.enableSizeTaskAfterBuildTask.title": "在构建任务完成后执行 IDF 二进制文件大小分析", + "param.enableStatusBar.title": "启用 ESP-IDF 扩展状态栏", + "param.enableUpdateSrcsToCMakeListsFile": "在 CMakeLists.txt 文件中启用更新源文件的功能", + "param.esp.rainmaker.oauth.url": "ESP-Rainmaker OAuth 服务器 URL", + "param.espAdfPath": "指定 ESP-ADF 框架的路径 (ADF_PATH)", + "param.espHomeKitSdkPath": "指定 ESP-HomeKit-SDK 框架的路径 (HOMEKIT_PATH)", + "param.espIdfPath": "指定 ESP-IDF 框架的路径 (IDF_PATH)", + "param.espMatterPath": "指定 ESP-Matter 框架的路径 (ESP_MATTER_PATH)", + "param.espMdfPath": "指定 ESP-MDF 框架的路径 (MDF_PATH)", + "param.espRainmakerPath": "指定 ESP-Rainmaker 框架的路径 (RMAKER_PATH)", + "param.exportVars": "要添加到系统环境变量中的变量", + "param.flashBaudRate": "ESP-IDF 烧录速率", + "param.gitPath.title": "Git 可执行文件的路径", + "param.launchMonitorOnDebugSession.title": "在 ESP-IDF 调试适配器会话中启动 IDF 监视器", + "param.monitorBaudRate": "ESP-IDF 监视器的波特率值", + "param.monitorCustomTimestampFormat": "在 IDF 监视器中自定义时间戳格式", + "param.monitorEnableTimestamps": "启用 IDF 监视器中的时间戳", + "param.monitorNoReset": "启用 IDF 监视器的不重置标志", + "param.monitorStartDelayBeforeDebug": "运行 IDF 监视器后延迟启动调试会话 (ms)", + "param.ninjaArgs": "Ninja 构建任务的参数", + "param.notificationMode": "选择 ESP-IDF 扩展的通知和输出窗口显示", + "param.notificationMode.all": "显示通知,并切换到任务输出窗口", + "param.notificationMode.notification": "显示通知,不显示任务输出", + "param.notificationMode.output": "显示任务输出,不显示通知", + "param.notificationMode.silent": "不显示通知和任务输出", + "param.openOcdConfigFilesList": "OpenOCD 脚本目录中的配置文件列表", + "param.openOcdDebugLevel": "OpenOCD 服务器调试级别", + "param.openOcdLaunchArgs": "从此扩展启动 OpenOCD 的参数", + "param.partialDarkTheme": "深色主题下 ESP-IDF 代码覆盖率报告中部分覆盖行的背景颜色", + "param.partialLightTheme": "浅色主题下 ESP-IDF 代码覆盖率报告中部分覆盖行的背景颜色", + "param.port": "已选设备端口的路径", + "param.postBuildTask": "构建后的自定义任务", + "param.postFlashTask": "烧录后的自定义任务", + "param.preBuildTask": "构建前的自定义任务", + "param.preFlashTask": "烧录前的自定义任务", + "param.pythonBinPath": "用于执行 ESP-IDF Python 脚本的 Python 绝对路径", + "param.qemuTcpPort": "QEMU 用于串行通信的 TCP 端口", + "param.rainmaker.api.server_url": "ESP-Rainmaker 云服务器 URL", + "param.saveBeforeBuildDescription": "在继续构建之前保存工作区中的所有编辑文件(若未能保存文件,构建仍将继续)", + "param.saveScope": "指定 ESP-IDF 命令的配置作用域,Global = 1,Workspace = 2,WorkspaceFolder = 3", + "param.sbomFilePath.title": "ESP-IDF SBOM 文件路径", + "param.sdkconfigDefaults": "初始构建配置的 sdkconfig 默认值列表", + "param.sdkconfigFilePath.title": "sdkconfig 文件的绝对路径", + "param.showOnboardingOnInit": "在激活扩展时显示 ESP-IDF 配置窗口", + "param.svdFile": "用于解析 ESP-IDF 外设视图的 SVD 文件,显示在调试视图中", + "param.telemetry": "将匿名遥测和崩溃报告发送回扩展 (更改设置后需要重新启动以生效)", + "param.toolsPath": "指定 ESP-IDF 工具的路径 (IDF_TOOLS_PATH)", + "param.uncoveredDarkTheme": "深色主题下 ESP-IDF 代码覆盖率报告中未覆盖行的背景颜色", + "param.uncoveredLightTheme": "浅色主题下 ESP-IDF 代码覆盖率报告中未覆盖行的背景颜色", + "param.useIDFKConfigStyle": "启用/禁用 Kconfig 文件的 ESP-IDF 样式验证", + "param.hintsViewer.title": "提示文件的路径", + "param.enableSerialPortChipIdRequest.title": "启用检测芯片 ID 并显示在串口选择列表中", + "param.useSerialPortVendorProductFilter.title": "使用 USB 产品 ID 和厂商 ID 来过滤已知的乐鑫设备", + "param.usbSerialPortFilters.title": "用于筛选 USB 串口的产品 ID 和厂商 ID 列表", + "param.usbSerialPortFilters.vendorId": "USB 厂商 ID 为十六进制格式的字符串,例如 0x0403", + "param.usbSerialPortFilters.productId": "USB 产品 ID 为十六进制格式的的字符串,例如 0x6010", + "param.hasWalkthroughBeenShown": "是否已经展示教程", + "param.espIdeJsonPath": "用于查找 ESP-IDF 安装的 esp_ide.json 的自定义路径", + "trace.poll_period.description": "设置 apptrace 的 poll_period 参数", + "trace.skip_size.description": "设置 apptrace 的 skip_size 参数", + "trace.stop_tmo.description": "设置 apptrace 的 stop_tmo 参数", + "trace.trace_size.description": "设置 apptrace 的 trace_size 参数", + "trace.wait4halt.description": "设置 apptrace 的 wait4halt 参数", + "view.components.name": "项目组件", + "view.debug.peripheral": "ESP-IDF:外设视图", + "view.idf.espEFuseExplorer": "eFuse 资源管理器", + "view.idf.espRainmaker": "RainMaker", + "view.idf.idfAppTraceArchive": "应用跟踪存档", + "view.idf.idfAppTracer": "应用跟踪器", + "view.idf.idfCommands": "命令", + "view.idf.idfPartitionExplorer": "设备分区资源管理器", + "view.idf.idfSearchResults": "文档搜索结果", + "viewContainer.title": "ESP-IDF:资源管理器", + "viewWelcome.idfPartitionExplorer": "显示设备的分区列表,选择烧录二进制文件 (.bin) 的分区。\n\n选择设备串口,单击“刷新分区表”。", + "viewWelcome.idfSearchResults": "在任一打开的文件编辑器中选定文本,右键单击并选择“ESP-IDF:在文档中搜索”,搜索匹配的结果。\n\n搜索结果基于当前的 VS Code 语言以及 idf.espIdfPath 版本 (若未指定版本,则默认使用最新版 ESP-IDF)。", + "viewWelcome.peripheralView": "在活动调试会话中,显示 ESP-IDF SVD 文件 (路径为 idf.svdFilePath) 中包含的外设寄存器信息。" } diff --git a/src/cmdTreeView/cmdStore.ts b/src/cmdTreeView/cmdStore.ts index ca1b32a00..ef9ceb05f 100644 --- a/src/cmdTreeView/cmdStore.ts +++ b/src/cmdTreeView/cmdStore.ts @@ -52,6 +52,7 @@ export enum CommandKeys { } export enum AdvancedCommandKeys { + InstallManager = "espIdf.installManager", Setup = "espIdf.setup.start", Examples = "espIdf.examples.start", NewProject = "espIdf.newProject.start", @@ -80,6 +81,11 @@ export function createAdvancedCommandDictionary(): Record< IDFCommandDescription > { return { + [AdvancedCommandKeys.InstallManager]: { + checkboxState: undefined, + iconId: "link-external", + tooltip: l10n.t("Open ESP-IDF installation manager"), + }, [AdvancedCommandKeys.Setup]: { checkboxState: undefined, iconId: "extensions", diff --git a/src/config.ts b/src/config.ts index bc2294314..716f48d30 100644 --- a/src/config.ts +++ b/src/config.ts @@ -116,6 +116,10 @@ export namespace ESP { export const README = ESP.URL.GithubRepository + "/blob/master/README.md"; export const FLASH_ENCRYPTION = "/security/flash-encryption.html"; } + + export namespace InstallManager { + export const Releases = "https://github.com/espressif/idf-im-ui/releases"; + } } export namespace Webview { diff --git a/src/eim/getExistingSetups.ts b/src/eim/getExistingSetups.ts new file mode 100644 index 000000000..8460d5f7c --- /dev/null +++ b/src/eim/getExistingSetups.ts @@ -0,0 +1,124 @@ +/* + * Project: ESP-IDF VSCode Extension + * File Created: Friday, 29th November 2024 3:28:00 pm + * Copyright 2024 Espressif Systems (Shanghai) CO LTD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { pathExists, readJson } from "fs-extra"; +import { join } from "path"; +import { readParameter } from "../idfConfiguration"; +import { Logger } from "../logger/logger"; +import { IdfSetup } from "../views/setup/types"; +import { checkIdfSetup } from "../setup/setupValidation/espIdfSetup"; +import { getEspIdfFromCMake } from "../utils"; + +export interface EspIdfJson { + $schema: string; + $id: string; + _comment: string; + _warning: string; + gitPath: string; + idfToolsPath: string; + idfSelectedId: string; + idfInstalled: { [key: string]: IdfInstalled }; +} + +export interface IdfInstalled { + activationScript: string; + id: string; + idfToolsPath: string; + name: string; + path: string; + python: string; +} + +export async function getIdfSetups(logToChannel: boolean = true) { + const setupKeys = await loadIdfSetupsFromEspIdfJson(); + const idfSetups: IdfSetup[] = []; + for (let idfSetup of setupKeys) { + if (idfSetup && idfSetup.idfPath) { + try { + idfSetup.isValid = await checkIdfSetup(idfSetup, logToChannel); + idfSetup.version = await getEspIdfFromCMake(idfSetup.idfPath); + idfSetups.push(idfSetup); + } catch (err) { + const msg = err.message + ? err.message + : "Error checkIdfSetup in loadIdfSetupsFromEspIdfJson"; + Logger.error(msg, err, "getIdfSetups"); + } + } + } + return idfSetups; +} + +export async function loadIdfSetupsFromEspIdfJson() { + const espIdfJson = await getEspIdeJson(); + if ( + espIdfJson && + espIdfJson.idfInstalled && + Object.keys(espIdfJson.idfInstalled).length + ) { + let idfSetups: IdfSetup[] = []; + for (let idfInstalledKey of Object.keys(espIdfJson.idfInstalled)) { + let setupConf: IdfSetup = { + id: idfInstalledKey, + idfPath: espIdfJson.idfInstalled[idfInstalledKey].path, + gitPath: espIdfJson.gitPath, + version: espIdfJson.idfInstalled[idfInstalledKey].name, + toolsPath: espIdfJson.idfInstalled[idfInstalledKey].idfToolsPath, + isValid: false, + } as IdfSetup; + try { + setupConf.isValid = await checkIdfSetup(setupConf, false); + } catch (err) { + const msg = err.message + ? err.message + : "Error checkIdfSetup in loadIdfSetupsFromEspIdfJson"; + Logger.error(msg, err, "loadIdfSetupsFromEspIdfJson"); + setupConf.isValid = false; + } + idfSetups.push(setupConf); + } + return idfSetups; + } +} + +export async function getEspIdeJson() { + const espIdeJsonCustomPath = readParameter("idf.espIdeJsonPath"); + const espIdePathExists = await pathExists(espIdeJsonCustomPath); + let espIdeJsonPath = ""; + if (espIdePathExists) { + espIdeJsonPath = espIdeJsonCustomPath; + } else { + espIdeJsonPath = + process.platform === "win32" + ? join(process.env.SystemDrive, "Espressif", "tools", "esp_ide.json") + : join(process.env.HOME, ".espressif", "esp_ide.json"); + } + const espIdfJsonExists = await pathExists(espIdeJsonPath); + let espIdfJson: EspIdfJson; + try { + if (!espIdfJsonExists) { + throw new Error(`${espIdeJsonPath} doesn't exists.`); + } + espIdfJson = await readJson(espIdeJsonPath); + } catch (error) { + const msg = error && error.message ? error.message : `Error reading ${espIdeJsonPath}.`; + Logger.error(msg, error, "getEspIdfSetupsFromJson"); + return; + } + return espIdfJson; +} diff --git a/src/extension.ts b/src/extension.ts index 99717723a..6b700a7fe 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1944,6 +1944,10 @@ export async function activate(context: vscode.ExtensionContext) { }); }); + registerIDFCommand("espIdf.installManager", () => { + vscode.env.openExternal(vscode.Uri.parse(ESP.URL.InstallManager.Releases)); + }); + registerIDFCommand("espIdf.setup.start", (setupArgs?: ISetupInitArgs) => { PreCheck.perform([webIdeCheck], async () => { try { diff --git a/src/newProject/newProjectInit.ts b/src/newProject/newProjectInit.ts index 3b0de33bf..271d9a0de 100644 --- a/src/newProject/newProjectInit.ts +++ b/src/newProject/newProjectInit.ts @@ -25,6 +25,7 @@ import { } from "../espIdf/openOcd/boardConfiguration"; import { getPreviousIdfSetups } from "../setup/existingIdfSetups"; import { IdfSetup } from "../views/setup/types"; +import { getIdfSetups } from "../eim/getExistingSetups"; export interface INewProjectArgs { espIdfSetup: IdfSetup; @@ -66,7 +67,10 @@ export async function getNewProjectArgs( const openOcdScriptsPath = await getOpenOcdScripts(workspace); let espBoards = await getBoards(openOcdScriptsPath); progress.report({ increment: 10, message: "Loading ESP-IDF setups list..." }); - const idfSetups = await getPreviousIdfSetups(true); + let idfSetups = await getIdfSetups(true); + if (idfSetups.length === 0) { + idfSetups = await getPreviousIdfSetups(true); + } const onlyValidIdfSetups = idfSetups.filter((i) => i.isValid); const pickItems: {description: string, label: string, target: IdfSetup}[] = []; for (const idfSetup of onlyValidIdfSetups) { diff --git a/src/setup/setupInit.ts b/src/setup/setupInit.ts index fe481a102..3b4a30b18 100644 --- a/src/setup/setupInit.ts +++ b/src/setup/setupInit.ts @@ -32,6 +32,7 @@ import { checkPyVenv } from "./setupValidation/pythonEnv"; import { packageJson } from "../utils"; import { getPythonPath, getVirtualEnvPythonPath } from "../pythonManager"; import { CommandKeys, createCommandDictionary } from "../cmdTreeView/cmdStore"; +import { getIdfSetups } from "../eim/getExistingSetups"; export interface ISetupInitArgs { downloadMirror: IdfMirror; @@ -131,7 +132,10 @@ export async function getSetupInitialValues( const espIdfTagsList = await getEspIdfTags(); progress.report({ increment: 10, message: "Getting Python versions..." }); const pythonVersions = await getPythonList(extensionPath); - const idfSetups = await getPreviousIdfSetups(false); + let idfSetups = await getIdfSetups(false); + if (idfSetups.length === 0) { + idfSetups = await getPreviousIdfSetups(false); + } const extensionVersion = packageJson.version as string; const saveScope = idfConf.readParameter("idf.saveScope") as number; const initialDownloadMirror = diff --git a/src/versionSwitcher/index.ts b/src/versionSwitcher/index.ts index e57c94392..3c544f1eb 100644 --- a/src/versionSwitcher/index.ts +++ b/src/versionSwitcher/index.ts @@ -27,12 +27,16 @@ import { getIdfMd5sum } from "../setup/espIdfJson"; import { getEspIdfFromCMake } from "../utils"; import { IdfSetup } from "../views/setup/types"; import { getPythonPath, getVirtualEnvPythonPath } from "../pythonManager"; +import { getIdfSetups } from "../eim/getExistingSetups"; export async function selectIdfSetup( workspaceFolder: Uri, espIdfStatusBar: StatusBarItem ) { - const idfSetups = await getPreviousIdfSetups(true); + let idfSetups = await getIdfSetups(); + if (idfSetups.length === 0) { + idfSetups = await getPreviousIdfSetups(true); + } if (idfSetups.length === 0) { await window.showInformationMessage("No ESP-IDF Setups found"); return; diff --git a/src/views/welcome/App.vue b/src/views/welcome/App.vue index 07fbdf637..3eb464473 100644 --- a/src/views/welcome/App.vue +++ b/src/views/welcome/App.vue @@ -54,6 +54,10 @@ onMounted(() => {