From 2b23ac3d958103752ae1b356a2934f4f6fbfb549 Mon Sep 17 00:00:00 2001 From: "Brian A. Ignacio" Date: Fri, 28 Jun 2024 08:34:36 +0800 Subject: [PATCH] v1.8.0 release (#1207) * add changelog * fix workspace folder esp matter bootstrap * fix openOCD settings not updated * add dl espressif pypi pip install * update changelog with whitespaces pr * update readme fix rom elf validation * add esp-idf project validation for menuconfig * clean devcontainer commas add return to isIdfProject * fix gcov html report error handling * select Espressif mirror in locale is chinese * add commands description * ad rainmaker gitee link * add websocket client validation install * fix editor coverage errors * rm setDefaultConfig cmd * fix lint * add troubleshoot form ui * fix l10n lint * removes the ouput of esptool.py to the console inside vscode when using it for device identification (VSC-1378) (#1218) Co-authored-by: Petr Gadorek * fix new project create project empty openocd files * add code coverage link in esp-idf output * fix warning treated as error in py install setup step * add docs in coverage at end of output * fix lint * try catch init check extension settings activation * add rainmaker to new project wizard examples * add dev rimraf for windows clean script * rm device configuration command * rm Configure Paths cmd * update build path in c cpp properties json template * send troubleshoot form as telemetry event * add matter prerequisites to docs * add web extension to codespace settings in devcontainer json * add progress for component install * add flash cmd after build is complete * add hints viewer to changelog * rm esptool from PATH * fix gitee submodules fix esp rainmaker * add debug to status bar items and cmd tree view --------- Co-authored-by: Hahihula Co-authored-by: Petr Gadorek --- CHANGELOG.md | 25 + README.md | 631 ++++++++++++++---- docs/FEATURES.md | 407 ++++++++++- docs/HARDWARE_SUPPORT.md | 2 +- docs/ONBOARDING.md | 1 + docs/SETTINGS.md | 12 +- docs/SETUP.md | 2 +- docs/tutorial/additional_frameworks.md | 2 +- docs/tutorial/debugging.md | 2 +- docs/tutorial/toc.md | 1 + l10n/bundle.l10n.es.json | 29 +- l10n/bundle.l10n.pt.json | 25 +- l10n/bundle.l10n.ru.json | 25 +- l10n/bundle.l10n.zh-CN.json | 23 +- package.json | 25 +- package.nls.es.json | 6 +- package.nls.json | 4 +- package.nls.pt.json | 6 +- package.nls.ru.json | 6 +- package.nls.zh-CN.json | 6 +- src/build/buildCmd.ts | 57 +- src/build/buildTask.ts | 20 +- src/checkExtensionSettings.ts | 15 +- src/cmdTreeView/cmdTreeDataProvider.ts | 10 +- src/common/abstractCloning.ts | 21 +- src/component-manager/panel.ts | 37 +- src/component-manager/utils.ts | 7 +- src/coverage/coverageService.ts | 31 +- src/coverage/gcdaPaths.ts | 6 +- src/coverage/renderer.ts | 8 +- src/espBom/index.ts | 9 +- src/espIdf/monitor/checkWebsocketClient.ts | 56 ++ src/espIdf/openOcd/boardConfiguration.ts | 4 +- src/espIdf/openOcd/openOcdManager.ts | 52 +- src/espIdf/serial/serialPort.ts | 17 +- src/espIdf/setTarget/getTargets.ts | 10 +- src/espIdf/setTarget/index.ts | 10 +- src/espMatter/espMatterDownload.ts | 8 +- src/extension.ts | 298 +++------ src/idfToolsManager.ts | 2 +- src/installManager.ts | 3 - src/newProject/newProjectInit.ts | 27 +- src/newProject/newProjectPanel.ts | 13 +- src/newProject/utils.ts | 12 +- src/pythonManager.ts | 62 +- .../download/espRainmakerDownload.ts | 3 +- src/setup/SetupPanel.ts | 29 +- src/setup/installPyReqs.ts | 1 - src/setup/setupInit.ts | 11 +- src/support/troubleshootPanel.ts | 206 ++++++ src/support/writeReport.ts | 1 - src/test/oocdBoards.test.ts | 21 +- src/test/project.test.ts | 2 +- src/utils.ts | 32 +- src/versionSwitcher/index.ts | 5 +- src/views/commons/espCommons.scss | 2 +- src/views/setup/components/selectEspIdf.vue | 2 +- src/views/setup/main.ts | 3 + src/views/setup/store.ts | 6 + src/views/troubleshoot/App.vue | 96 +++ src/views/troubleshoot/main.ts | 38 ++ src/views/troubleshoot/store.ts | 50 ++ src/workspaceConfig.ts | 2 +- templates/.devcontainer/devcontainer.json | 9 +- templates/.vscode/c_cpp_properties.json | 8 +- .../.vscode/c_cpp_properties.json | 8 +- webpack.config.js | 27 +- yarn.lock | 84 ++- 68 files changed, 1994 insertions(+), 687 deletions(-) create mode 100644 src/espIdf/monitor/checkWebsocketClient.ts create mode 100644 src/support/troubleshootPanel.ts create mode 100644 src/views/troubleshoot/App.vue create mode 100644 src/views/troubleshoot/main.ts create mode 100644 src/views/troubleshoot/store.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eee0c938..448af8ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,31 @@ All notable changes to the "Espressif IDF" extension will be documented in this file. +## [1.8.0](https://github.com/espressif/vscode-esp-idf-extension/releases/tag/v1.8.0) + +### Features and enhancements + +- [Add button to enable custom partition when calling Partition table editor](https://github.com/espressif/vscode-esp-idf-extension/pull/1160) +- [Add ESP-IDF version switcher](https://github.com/espressif/vscode-esp-idf-extension/pull/1173) +- [Translation using l10n vscode api, remove gulp files](https://github.com/espressif/vscode-esp-idf-extension/pull/1178) +- [Add Eclipse CDT Debug Adapter and update debugging documentation](https://github.com/espressif/vscode-esp-idf-extension/pull/1131) +- [Add Chip Id in port selection](https://github.com/espressif/vscode-esp-idf-extension/pull/1195) +- [Add idf.py reconfigure task as extension command](https://github.com/espressif/vscode-esp-idf-extension/pull/1198) +- [Add white spaces support for IDF_PATH and extension tasks](https://github.com/espressif/vscode-esp-idf-extension/pull/1159) +- [Add Hints viewers bar and code editor highlight](https://github.com/espressif/vscode-esp-idf-extension/pull/1225) +- [Add docs espressif files and workflow](https://github.com/espressif/vscode-esp-idf-extension/pull/1226) + +### Bug Fixes + +- [Avoid saveDefSdkconfig in all menu items](https://github.com/espressif/vscode-esp-idf-extension/pull/1171) Thanks @ArcticLampyrid +- [Add clarity to flash placeholder text](https://github.com/espressif/vscode-esp-idf-extension/pull/1142) +- [Fix output channel interrupt](https://github.com/espressif/vscode-esp-idf-extension/pull/1174) +- [Fix github tags to retrieve up to 100 tags](https://github.com/espressif/vscode-esp-idf-extension/pull/1196) +- [Fix and update devcontainer json mount and python setting](https://github.com/espressif/vscode-esp-idf-extension/pull/1200) +- [Add no ports validation](https://github.com/espressif/vscode-esp-idf-extension/pull/1204) +- [Update blink example reference in docs](https://github.com/espressif/vscode-esp-idf-extension/pull/1188) Thanks @kowyo +- [Consistent ESP Component Registry URL](https://github.com/espressif/vscode-esp-idf-extension/pull/1206) Thanks @XDanielPaul + ## [1.7.1](https://github.com/espressif/vscode-esp-idf-extension/releases/tag/v1.7.1) ### Features and enhancements diff --git a/README.md b/README.md index 18ebe1830..7b2fd3aeb 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,81 @@ Develop, build, flash, monitor, [debug](./docs/DEBUGGING.md) and [more](./docs/F Make sure to review our [documentation](./docs/ONBOARDING.md) first to properly use the extension. +# How to use + +1. Download and install [Visual Studio Code](https://code.visualstudio.com/). + +2. Install ESP-IDF system requirements for your operating system: + +- Requirements for [Linux](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-setup.html#install-prerequisites) +- Requirements for [MacOS](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/macos-setup.html#install-prerequisites) +- For Windows the [C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools) might be required. + +3. In Visual Studio Code, Open the **Extensions** view by clicking on the Extension icon in the Activity Bar on the side of Visual Studio Code or the **View: Extensions** command (shortcut: X or Ctrl+Shift+X. + +4. Search for [ESP-IDF Extension](https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension). + +5. Install the extension. + +6. (OPTIONAL) Press F1 and type **ESP-IDF: Select where to Save Configuration Settings**, which can be User Settings (global), Workspace Settings or Workspace Folder Settings. Default is User settings. + + > **NOTE:** Please take a look at [Working with multiple projects](./docs/MULTI_PROJECTS.md) for more information. + +7. In Visual Studio Code, select menu "View" and "Command Palette" and type `configure esp-idf extension`. After, choose the **ESP-IDF: Configure ESP-IDF Extension** option. You can also choose where to save settings in the setup wizard. + > **NOTE:** For versions of ESP-IDF < 5.0, spaces are not supported inside configured paths. + +

+ Select ESP-IDF +

+ +8. Choose **Express** and select the download server: + +- Espressif: Faster speed in China using Espressif Download servers links. +- Github: Using github releases links. + +9. Pick an ESP-IDF version to download or the `find ESP-IDF in your system` option to search for existing ESP-IDF directory. + +10. Choose the location for ESP-IDF Tools (also known as `IDF_TOOLS_PATH`) which is `$HOME\.espressif` on MacOS/Linux and `%USERPROFILE%\.espressif` on Windows by default. + +11. If your operating system is Linux or MacOS, choose the python executable to create ESP-IDF virtual environment. + + > **NOTE:** Windows users don't need to select a python executable since it is part of the setup. + > **NOTE:** Make sure that `IDF_TOOLS_PATH` doesn't have any spaces to avoid any build issues. Also make sure that `IDF_TOOLS_PATH` is not the same directory as `IDF_PATH`. + +12. The user will see a page showing the setup progress status showing ESP-IDF download progress, ESP-IDF Tools download and install progress as well as the creation of a python virtual environment. + +13. If everything is installed correctly, the user will see a message that all settings have been configured. You can start using the extension. Otherwise check the [Troubleshooting](#Troubleshooting) section if you have any issues. + +14. Press F1 and type **ESP-IDF: Show Examples Projects** to create a new project from ESP-IDF examples. Select ESP-IDF and choose an example to create a new project from. + +15. (OPTIONAL) Configure the `.vscode/c_cpp_properties.json` as explained in [C/C++ Configuration](./docs/C_CPP_CONFIGURATION.md). + +> **Note:** For code navigation the [Microsoft C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) or [Clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) can be used for C/C++ language support. By default, projects created with **ESP-IDF: Create Project from Extension Template** or **ESP-IDF: Show Examples Projects** include a template for Microsoft C/C++ extension `c_cpp_properties.json` configuration file and doesn't need to be configured. Run **ESP-IDF: Run idf.py reconfigure task** to generate the compile_commands.json file so language support works. + +16. Set the serial port of your device by pressing F1, typing **ESP-IDF: Select Port to Use:** and choosing the serial port your device is connected. + +17. Select an Espressif target (esp32, esp32s2, etc.) with the **ESP-IDF: Set Espressif Device Target** command. + +18. Use the **ESP-IDF: Select OpenOCD Board Configuration** to choose the openOCD configuration files for the extension openOCD server. + +19. Next configure your ESP-IDF project by pressing F1 and typing **ESP-IDF: SDK Configuration Editor** command (CTRL E G keyboard shortcut ) where the user can modify the ESP-IDF project settings. After all changes are made, click save and close this window. + +20. When you are ready, build your project by pressing F1 and typing **ESP-IDF: Build your Project**. + +21. Flash to your device by pressing F1 and typing **ESP-IDF: Select Flash Method and Flash** to select either `UART`, `DFU` or `JTAG` depending on your serial connection. + +> **NOTE:** You can also use the **ESP-IDF: Flash (UART) your Project** or **ESP-IDF: Flash (with JTag)** directly. + +22. Start a monitor by pressing F1 and typing **ESP-IDF: Monitor Device** which will log the device activity in a Visual Studio Code terminal. + +23. To make sure you can debug your device, select your board configuration by pressing F1 and typing **ESP-IDF: Select OpenOCD Board Configuration**. You can test the connection by pressing F1 and typing **ESP-IDF: OpenOCD Manager**. The output is shown in the menu `View` -> `Output` and choose `ESP-IDF` from the dropdown list. + + > **NOTE:** The user can start or stop the OpenOCD from Visual Studio Code using the **ESP-IDF: OpenOCD Manager** command or from the `OpenOCD Server (Running | Stopped)` button in the visual studio code status bar. + +24. If you want to start a debug session, just press `F5` (make sure you had at least build, flash and openOCD is connecting correctly so the debugger works correctly). + +Check the [Troubleshooting](#Troubleshooting) section if you have any issues. + # Tutorials 1. [Install and setup the extension](./docs/tutorial/install.md). @@ -46,124 +121,446 @@ Check all the tutorials [here](./docs/tutorial/toc.md). Check all the [documentation](./docs/ONBOARDING.md). -# How to use - -- Download and install [Visual Studio Code](https://code.visualstudio.com/). -- Then - - Either open Visual Studio Code and create a workspace folder. - - Run `code ${YOUR_PROJECT_DIR}` from a command line terminal. -- Install this extension in your Visual Studio Code. - -There are few dependencies required in your system and available in environment variable PATH before installing this extension. Please review the following documentation. - -- Requirements for [Linux](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-setup.html#install-prerequisites) -- Requirements for [MacOS](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/macos-setup.html#install-prerequisites) -- For Windows the [C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools) might be required. - -Install ESP-IDF and ESP-IDF Tools by following the [install tutorial](./docs/tutorial/install.md). - -> **NOTE:** Please note that this extension **only [supports](https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md)** the release versions of ESP-IDF, you can use the extension on `master` branch or other branch, but certain features might not properly work. - -> **NOTE:** If you are using Windows Subsystem for Linux (WSL) 2, please take a look at the [WSL tutorial](docs/tutorial/wsl.md) for an step by step instruction or check the requirements in [WSL Documentation](./docs/WSL.md) needed in the WSL distribution. - -- (OPTIONAL) Press F1 and type **ESP-IDF: Select where to Save Configuration Settings**, which can be User settings, Workspace settings or workspace folder settings. - - > **NOTE:** Please take a look at [Working with multiple projects](./docs/MULTI_PROJECTS.md) for more information. Default is User settings. - -- On the first time using the extension, press F1 to show the Visual Studio Code Command Palette and type **ESP-IDF: Configure ESP-IDF extension** to open the extension configuration wizard. This will install ESP-IDF, ESP-IDF tools, create a virtual python environment with ESP-IDF and this extension python packages and configure the extension settings with these values. - - > **NOTE:** For versions of ESP-IDF < 5.0, spaces are not supported inside configured paths. - - > **NOTE:** Please take a look at [Install tutorial](./docs/tutorial/install.md) documentation or the [Setup documentation](./docs/SETUP.md) for details about extension setup and configuration. - -- Press F1 and type **ESP-IDF: Show Examples Projects** to create a new project from ESP-IDF examples. - -- Configure the `.vscode/c_cpp_properties.json` as explained in [C/C++ Configuration](./docs/C_CPP_CONFIGURATION.md). There is a default configuration that should work when you create a new project with the extension commands but you might want to modify it to your needs. - - > **Note:** For code navigation the [Microsoft C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) or [Clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) can be used to resolve header/source links. By default, projects created with **ESP-IDF: Create Project from Extension Template** or **ESP-IDF: Show Examples Projects** include a template for Microsoft C/C++ extension `c_cpp_properties.json` configuration file. This can be optimized by building the project first and configure your project to use `build/compile_commands.json` as explained in [C/C++ Configuration](./docs/C_CPP_CONFIGURATION.md). - -- Do some coding! -- Check you set the correct port of your device by pressing F1, typing **ESP-IDF: Select Port to Use:** and choosing the serial port your device is connected. -- Select an Espressif target (esp32, esp32s2, etc.) with the **ESP-IDF: Set Espressif Device Target** command. -- Use the **ESP-IDF: Select OpenOCD Board Configuration** to choose the openOCD configuration files for the extension openOCD server. -- When you are ready, build your project by pressing F1 and typing **ESP-IDF: Build your Project**. -- Flash to your device by pressing F1 and typing **ESP-IDF: Select Flash Method and Flash** to select either UART or JTAG. You can also use the **ESP-IDF: Flash (UART) your Project** or **ESP-IDF: Flash (with JTag)** directly. - > **NOTE:** When using the **ESP-IDF: Select Flash Method and Flash** command, your choice will be saved in the `idf.flashType` configuration setting in the current workspace folder's settings.json. -- You can later start a monitor by pressing F1 and typing **ESP-IDF: Monitor Device** which will log the device activity in a Visual Studio Code terminal. -- To make sure you can debug your device, select the your board by pressing F1 and typing **ESP-IDF: Select OpenOCD Board Configuration** or manually define the openOCD configuration files with `idf.openOcdConfigs` configuration in your settings.json. -- If you want to start a debug session, just press F5 (make sure you had at least build and flash once before so the debugger works correctly). Check the [Troubleshooting](./README.md#Troubleshooting) section if you have any issues. - # Available commands -Click F1 to show Visual studio code actions, then type **ESP-IDF** to see possible actions. - -| Command Description | Keyboard Shortcuts (Mac) | Keyboard Shortcuts (Windows/ Linux) | -| ------------------------------------------------------- | -------------------------------------- | ----------------------------------------- | -| Add Arduino ESP32 as ESP-IDF Component | | | -| Add Docker Container Configuration | | | -| Add Editor coverage | | | -| Add OpenOCD rules file (For Linux users) | | | -| Add vscode configuration folder | | | -| Build, Flash and start a monitor on your device | I D | Ctrl E D | -| Build your project | I B | Ctrl E B | -| Clear eFuse Summary | | | -| Clear ESP-IDF Search Results | | | -| Clear Saved ESP-IDF Setups | | | -| Configure ESP-IDF extension | | | -| Configure Paths | | | -| Configure Project SDKConfig for Coverage | | | -| Create project from Extension Template | I C | Ctrl E C | -| Create New ESP-IDF Component | | | -| Device configuration | | | -| Dispose Current SDK Configuration Editor Server Process | | | -| Doctor Command | | | -| Encrypt and Flash your Project | | | -| Erase Flash Memory from Device | I R | Ctrl E R | -| Execute Custom Task | I J | Ctrl E J | -| Flash your project | I F | Ctrl E F | -| Flash (DFU) your project | | | -| Flash (UART) your project | | | -| Flash (with JTag) | | | -| Full Clean Project | I X | Ctrl E X | -| Get eFuse Summary | | | -| Get HTML Coverage Report for project | | | -| Import ESP-IDF Project | | | -| Install ESP-ADF | | | -| Install ESP-IDF Python Packages | | | -| Install ESP-MDF | | | -| Install ESP-Matter | | | -| Install ESP-Rainmaker | | | -| Install ESP-HomeKit-SDK | | | -| Launch IDF Monitor for CoreDump / GDB-Stub Mode | | | -| Launch QEMU Server | | | -| Launch QEMU Debug Session | | | -| Monitor device | I M | Ctrl E M | -| Monitor QEMU Device | | | -| New Project | I N | Ctrl E N | -| Open ESP-IDF Terminal | I T | Ctrl E T | -| NVS Partition Editor | | | -| Partition Table Editor | | | -| Pick a workspace folder | | | -| Remove Editor coverage | | | -| Run idf.py reconfigure task | | | -| Run ESP-IDF-SBOM vulnerability check | | | -| Save Default SDKCONFIG file (save-defconfig) | | | -| SDK Configuration editor | I G | Ctrl E G | -| Search in documentation... | I Q | Ctrl E Q | -| Select Flash Method | | | -| Select port to use | I P | Ctrl E P | -| Select OpenOCD Board Configuration | | | -| Select where to save configuration settings | | | -| Select output and notification mode | | | -| Set default sdkconfig file in project | | | -| Set Espressif device target | | | -| Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH) | | | -| Show Examples Projects | | | -| Show Ninja Build Summary | | | -| Size analysis of the binaries | I S | Ctrl E S | -| Unit Test: Build and flash unit test app for testing | | | -| Unit Test: Install ESP-IDF PyTest requirements | | | -| Search Error Hint | | | +Click F1 to show Visual studio code actions, then type **ESP-IDF** to see all possible actions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryCommand DescriptionDescriptionKeyboard Shortcuts (Mac)Keyboard Shortcuts (Windows/ Linux)
ConfigurationAdd OpenOCD rules file (For Linux users)Add OpenOCD permissions to /etc/udev/rules.d to allow OpenOCD execution.
Add Docker Container ConfigurationAdd the .devcontainer files to the currently opened project directory, necessary to use a ESP-IDF project in a Docker container with Visual Studio Code + Remote - Containers extension
Add vscode configuration folderAdd .vscode files to the currently opened project directory. These include launch.json (for debugging), settings.json and c_cpp_properties.json for syntax highlight.
Configure ESP-IDF extensionOpen a window with a setup wizard to install ESP-IDF, IDF Tools and python virtual environment.
Select output and notification modeThis extension shows many notifications and output in the Output window ESP-IDF. This command allows the user to set if to show notifications, show output, both or none of them.
Select where to save configuration settingsIn Visual Studio Code settings can be saved in 3 places: User Settings (global settings), workspace ( .code-workspace file) or workspace folder (.vscode/settings.json). + More information in working with multiple projects.
Pick a workspace folderwhen using a Visual Studio Code workspace with multiple workspace folders, this command allow you to select which workspace folder to use for this extension commands. + More information in working with multiple projects.
BasicShow Examples ProjectsLaunch UI to show examples from selected framework and allow the user to create a project from them. This command will show frameworks already configured in the extension so if + you want to see ESP-Rainmaker examples you need to run the Install ESP-Rainmaker first (or set the equivalent setting idf.espRainmakerPath) and then execute this command to see the examples.
Set Espressif device targetThis will set the target for the current project (IDF_TARGET). Similar to idf.py set-target. For example if you want to use ESP32 or ESP32-C3 you need to execute this command.
SDK Configuration editorLaunch a UI to configure your ESP-IDF project settings. This is equivalent to idf.py menuconfig I GCtrl E G
Build your projectBuild your project using `CMake` and `Ninja-build` as explained in ESP-IDF Build System Using Cmake Directly. You could modify the behavior of the build task with idf.cmakeCompilerArgs for Cmake configure step and idf.ninjaArgs for Ninja step. For example, using [-j N] where N is the number of jobs run in parallel. I BCtrl E B
Size analysis of the binariesLaunch UI with the ESP-IDF project binaries size information. I SCtrl E S
Select port to useSelect which serial port to use for ESP-IDF tasks like flashing or monitor your device. I PCtrl E P
Flash your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project. This command will use either UART, DFU or JTAG based on idf.flashType I FCtrl E F
Monitor deviceThis command will execute idf.py monitor to start serial communication with Espressif device. + Please take a look at the IDF Monitor Documentation. I MCtrl E M
Open ESP-IDF TerminalLaunch a terminal window configured with extension ESP-IDF settings. Similar to export.sh script from ESP-IDF CLI. I TCtrl E T
Select OpenOCD Board ConfigurationSelect the openOCD configuration files that match your Espressif device target. For example if you are using DevKitC or ESP-Wrover-Kit. This is necessary for flashing with JTAG or debugging your device.
Build, Flash and start a monitor on your deviceBuild the project, write binaries program to device and start a monitor terminal with a single command. Similar to `idf.py build flash monitor` I DCtrl E D
Project creationShow Examples ProjectsLaunch UI to show examples from selected framework and allow the user to create a project from them. This command will show frameworks already configured in the extension so if + you want to see ESP-Rainmaker examples you need to run the Install ESP-Rainmaker first (or set the equivalent setting idf.espRainmakerPath) and then execute this command to see the examples.
Create project from Extension TemplateCreate ESP-IDF using one of the extension template projects. I CCtrl E C
Create New ESP-IDF ComponentCreate a new component in the current directory based on ESP-IDF component template
Import ESP-IDF ProjectImport an existing ESP-IDF project and add .vscode and .devcontainer files to a new location and also able to rename the project.
New ProjectLaunch UI with a ESP-IDF project creation wizard using examples templates from ESP-IDF and additional frameworks configured in the extension. I NCtrl E N
FlashingSelect Flash MethodSelect which flash method to use for Flash your project command. It can be DFU, JTAG or UART.
Flash your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project. This command will use either UART, DFU or JTAG based on idf.flashType I FCtrl E F
Flash (DFU) your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project using DFU. Only for ESP32-S2 and ESP32-S3.
Flash (UART) your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project using esptool.py
Flash (with JTag)Write binary data to the ESP’s flash chip from your current ESP-IDF project using OpenOCD JTAG
Encrypt and Flash your ProjectExecute flashing the project program to device while adding --encrypt for partitions to be encrypted.
Erase Flash Memory from DeviceExecute esptool.py erase_flash command to erase flash chip (set to 0xFF bytes) I RCtrl E R
Code coverageAdd Editor coverageParse your project GCOV Code coverage files to add color lines + representing code coverage on currently opened source code file
Configure Project SDKConfig for CoverageSet required values in your project SDKConfig to enable Code Coverage
Get HTML Coverage Report for projectParse your project GCOV Code coverage files to generate a HTML coverage report.
Remove Editor coverageRemove editor colored lines from Add Editor coverage command
Additional frameworksInstall ESP-ADFClone ESP-ADF inside the selected directory and set idf.espAdfPath (idf.espAdfPathWin in Windows) configuration setting.
Add Arduino ESP32 as ESP-IDF ComponentAdd Arduino-ESP32 as a ESP-IDF component + in your current directory (${CURRENT_DIRECTORY}/components/arduino).
Install ESP-IDF Python Packages (DEPRECATION NOTICE)Install extension python packages. Deprecated will be removed soon.
Install ESP-MDFClone ESP-MDF inside the selected directory and set idf.espMdfPath (idf.espMdfPathWin in Windows) configuration setting.
Install ESP-MatterClone ESP-Matter and set idf.espMatterPath. The ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH) is used to define the device path for ESP-Matter. ESP-Matter is not supported in Windows. Make sure to install Matter system prerequisites first.
Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)The ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH) is used to define the device path for ESP-Matter. ESP-Matter is not supported in Windows.
Install ESP-RainmakerClone ESP-Rainmaker and set idf.espRainmakerPath (idf.espRainmakerPathWin in Windows) configuration setting.
Install ESP-HomeKit-SDKClone ESP-HomeKit-SDK inside the selected directory and set idf.espHomeKitSdkPath (idf.espHomeKitSdkPathWin in Windows) configuration setting.
eFuseGet eFuse SummaryGet list of eFuse and values from currently serial port chip.
Clear eFuse SummaryClear the eFuse Summary tree from ESP Explorer EFUSEEXPLORER
QEMULaunch QEMU ServerAs described in QEMU documentation this command will execute ESP32 QEMU from the project Dockerfile with the current project binaries.
Launch QEMU Debug SessionAs described in QEMU documentation this command will start a debug session to ESP32 QEMU from the project Dockerfile with the current project binaries.
Monitor QEMU DeviceAs described in QEMU documentation this command will start a terminal to monitor the ESP32 QEMU from the project Dockerfile with the current project binaries.
MonitoringMonitor deviceThis command will execute idf.py monitor to start serial communication with Espressif device. + Please take a look at the IDF Monitor Documentation. I MCtrl E M
Launch IDF Monitor for CoreDump / GDB-Stub ModeLaunch ESP-IDF Monitor with websocket capabilities. If the user has configured the panic handler to gdbstub or core dump, the monitor will launch a post mortem debug session of the chip.
Monitor QEMU DeviceAs described in QEMU documentation this command will start a terminal to monitor the ESP32 QEMU from the project Dockerfile with the current project binaries.
EditorsNVS Partition EditorLaunch UI to create a CSV file for ESP_IDF Non Volatile Storage
Partition Table EditorLaunch UI to manage custom partition table as described in ESP_IDF Partition Table
SDK Configuration editorLaunch a UI to configure your ESP-IDF project settings. This is equivalent to idf.py menuconfig I GCtrl E G
Unit TestingUnit Test: Build and flash unit test app for testingCopy the unit test app in the current project, build the current project and flash the unit test application to the connected device. More information in Unit testing documentation
Unit Test: Install ESP-IDF PyTest requirementsInstall the ESP-IDF Pytest requirements packages to be able to execute ESP-IDF Unit tests. More information in
Scripts and ToolsRun idf.py reconfigure taskThis command will execute idf.py reconfigure (CMake configure task). Useful when you need to generate compile_commands.json for the C/C++ language support.
Erase Flash Memory from DeviceExecute esptool.py erase_flash command to erase flash chip (set to 0xFF bytes) I RCtrl E R
Dispose Current SDK Configuration Editor Server ProcessIf you already executed the SDK Configuration editor, a cache process will remain in the background for faster re opening. This command will dispose of such cache process.
Doctor CommandRun a diagnostic of the extension setup settings and extension logs to provide a troubleshooting report.
Troubleshoot FormLaunch UI for user to send a troubleshoot report with steps to reproduce, run a diagnostic of the extension setup settings and extension logs to send to telemetry backend.
Run ESP-IDF-SBOM vulnerability checkCreates Software bill of materials (SBOM) files in the Software Package Data Exchange (SPDX) format for applications generated by the Espressif IoT Development Framework (ESP-IDF).
Save Default SDKCONFIG file (save-defconfig)Generate sdkconfig.defaults files using the project current sdkconfig file.
Show Ninja Build SummaryExecute the Chromium ninja-build-summary.py
Search in documentation...Select some text from your source code file and search in ESP-IDF documentation with results right in the vscode ESP-IDF Explorer tab. I QCtrl E Q
Search Error HintType some text to find a matching error from ESP-IDF hints dictionary.
Clear ESP-IDF Search ResultsClear results from ESP Explorer Documentation Search Results
Clear Saved ESP-IDF SetupsClear existing esp-idf setups saved by the extension.
# About commands @@ -175,7 +572,7 @@ Click F1 to show Visual studio code actions, then type **ESP-IDF** to 3. The **Install ESP-ADF** will clone ESP-ADF inside the selected directory and set `idf.espAdfPath` (`idf.espAdfPathWin` in Windows) configuration setting. -4. The **Install ESP-Matter** will clone ESP-Matter inside the selected directory and set `idf.espMatterPath` configuration setting. The **ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)** is used to define the device path for ESP-Matter. **ESP-Matter is not supported in Windows**. +4. The **Install ESP-Matter** will clone ESP-Matter inside the selected directory and set `idf.espMatterPath` configuration setting. The **ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)** is used to define the device path for ESP-Matter. **ESP-Matter is not supported in Windows**. Make sure to install Matter system prerequisites first. 5. The **Install ESP-MDF** will clone ESP-MDF inside the selected directory and set `idf.espMdfPath` (`idf.espMdfPathWin` in Windows) configuration setting. diff --git a/docs/FEATURES.md b/docs/FEATURES.md index cfa6802a5..fe30c2a8c 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -23,6 +23,411 @@ This extension provides many features to ease development of ESP-IDF Projects. - [CMake Editor](#CMake-Editor) - [Support for WSL 2](./WSL.md) +## Commands + +List of all the commands contributed by the extension + +Here's the complete HTML table that combines the given information: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Command DescriptionDescriptionKeyboard Shortcuts (Mac)Keyboard Shortcuts (Windows/ Linux)
Add Arduino ESP32 as ESP-IDF ComponentAdd Arduino-ESP32 as a ESP-IDF component + in your current directory (${CURRENT_DIRECTORY}/components/arduino).
Add Docker Container ConfigurationAdd the .devcontainer files to the currently opened project directory, necessary to use a ESP-IDF project in a Docker container with Visual Studio Code + Remote - Containers extension
Add Editor coverageParse your project GCOV Code coverage files to add color lines + representing code coverage on currently opened source code file
Add OpenOCD rules file (For Linux users)Add OpenOCD permissions to /etc/udev/rules.d to allow OpenOCD execution.
Add vscode configuration folderAdd .vscode files to the currently opened project directory. These include launch.json (for debugging), settings.json and c_cpp_properties.json for syntax highlight.
Build, Flash and start a monitor on your deviceBuild the project, write binaries program to device and start a monitor terminal with a single command. Similar to `idf.py build flash monitor` I DCtrl E D
Build your projectBuild your project using `CMake` and `Ninja-build` as explained in ESP-IDF Build System Using Cmake Directly. You could modify the behavior of the build task with idf.cmakeCompilerArgs for Cmake configure step and idf.ninjaArgs for Ninja step. For example, using [-j N] where N is the number of jobs run in parallel. I BCtrl E B
Clear eFuse SummaryClear the eFuse Summary tree from ESP Explorer EFUSEEXPLORER
Clear ESP-IDF Search ResultsClear results from ESP Explorer Documentation Search Results
Clear Saved ESP-IDF SetupsClear existing esp-idf setups saved by the extension.
Configure ESP-IDF extensionOpen a window with a setup wizard to install ESP-IDF, IDF Tools and python virtual environment.
Configure Project SDKConfig for CoverageSet required values in your project SDKConfig to enable Code Coverage
Create project from Extension TemplateCreate ESP-IDF using one of the extension template projects. I CCtrl E C
Create New ESP-IDF ComponentCreate a new component in the current directory based on ESP-IDF component template
Dispose Current SDK Configuration Editor Server ProcessIf you already executed the SDK Configuration editor, a cache process will remain in the background for faster re opening. This command will dispose of such cache process.
Doctor CommandRun a diagnostic of the extension setup settings and extension logs to provide a troubleshooting report.
Troubleshoot FormLaunch UI for user to send a troubleshoot report with steps to reproduce, run a diagnostic of the extension setup settings and extension logs to send to telemetry backend.
Encrypt and Flash your ProjectExecute flashing the project program to device while adding --encrypt for partitions to be encrypted.
Erase Flash Memory from DeviceExecute esptool.py erase_flash command to erase flash chip (set to 0xFF bytes) I RCtrl E R
Execute Custom TaskUser can define a command line command or script in idf.customTask which can be executed with this command. I JCtrl E J
Flash your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project. This command will use either UART, DFU or JTAG based on idf.flashType I FCtrl E F
Flash (DFU) your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project using DFU. Only for ESP32-S2 and ESP32-S3.
Flash (UART) your projectWrite binary data to the ESP’s flash chip from your current ESP-IDF project using esptool.py
Flash (with JTag)Write binary data to the ESP’s flash chip from your current ESP-IDF project using OpenOCD JTAG
Full Clean ProjectDelete the current ESP-IDF project build directory. I XCtrl E X
Get eFuse SummaryGet list of eFuse and values from currently serial port chip.
Get HTML Coverage Report for projectParse your project GCOV Code coverage files to generate a HTML coverage report.
Import ESP-IDF ProjectImport an existing ESP-IDF project and add .vscode and .devcontainer files to a new location and also able to rename the project.
Install ESP-ADFClone ESP-ADF inside the selected directory and set idf.espAdfPath (idf.espAdfPathWin in Windows) configuration setting.
Install ESP-IDF Python Packages (DEPRECATION NOTICE)Install extension python packages. Deprecated will be removed soon.
Install ESP-MDFClone ESP-MDF inside the selected directory and set idf.espMdfPath (idf.espMdfPathWin in Windows) configuration setting.
Install ESP-MatterClone ESP-Matter and set idf.espMatterPath. The ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH) is used to define the device path for ESP-Matter. ESP-Matter is not supported in Windows.
Install ESP-RainmakerClone ESP-Rainmaker and set idf.espRainmakerPath (idf.espRainmakerPathWin in Windows) configuration setting.
Install ESP-HomeKit-SDKClone ESP-HomeKit-SDK inside the selected directory and set idf.espHomeKitSdkPath (idf.espHomeKitSdkPathWin in Windows) configuration setting.
Launch IDF Monitor for CoreDump / GDB-Stub ModeLaunch ESP-IDF Monitor with websocket capabilities. If the user has configured the panic handler to gdbstub or core dump, the monitor will launch a post mortem debug session of the chip.
Launch QEMU ServerAs described in QEMU documentation this command will execute ESP32 QEMU from the project Dockerfile with the current project binaries.
Launch QEMU Debug SessionAs described in QEMU documentation this command will start a debug session to ESP32 QEMU from the project Dockerfile with the current project binaries.
Monitor deviceThis command will execute idf.py monitor to start serial communication with Espressif device. + Please take a look at the IDF Monitor Documentation. I MCtrl E M
Monitor QEMU DeviceAs described in QEMU documentation this command will start a terminal to monitor the ESP32 QEMU from the project Dockerfile with the current project binaries.
New ProjectLaunch UI with a ESP-IDF project creation wizard using examples templates from ESP-IDF and additional frameworks configured in the extension. I NCtrl E N
Open ESP-IDF TerminalLaunch a terminal window configured with extension ESP-IDF settings. Similar to export.sh script from ESP-IDF CLI. I TCtrl E T
NVS Partition EditorLaunch UI to create a CSV file for ESP_IDF Non Volatile Storage
Partition Table EditorLaunch UI to manage custom partition table as described in ESP_IDF Partition Table
Pick a workspace folderwhen using a Visual Studio Code workspace with multiple workspace folders, this command allow you to select which workspace folder to use for this extension commands. + More information in working with multiple projects.
Remove Editor coverageRemove editor colored lines from Add Editor coverage command
Run idf.py reconfigure taskThis command will execute idf.py reconfigure (CMake configure task). Useful when you need to generate compile_commands.json for the C/C++ language support.
Run ESP-IDF-SBOM vulnerability checkCreates Software bill of materials (SBOM) files in the Software Package Data Exchange (SPDX) format for applications generated by the Espressif IoT Development Framework (ESP-IDF).
Save Default SDKCONFIG file (save-defconfig)Generate sdkconfig.defaults files using the project current sdkconfig file.
SDK Configuration editorLaunch a UI to configure your ESP-IDF project settings. This is equivalent to idf.py menuconfig I GCtrl E G
Search in documentation...Select some text from your source code file and search in ESP-IDF documentation with results right in the vscode ESP-IDF Explorer tab. I QCtrl E Q
Search Error HintType some text to find a matching error from ESP-IDF hints dictionary.
Select Flash MethodSelect which flash method to use for Flash your project command. It can be DFU, JTAG or UART.
Select port to useSelect which serial port to use for ESP-IDF tasks like flashing or monitor your device. I PCtrl E P
Select OpenOCD Board ConfigurationSelect the openOCD configuration files that match your Espressif device target. For example if you are using DevKitC or ESP-Wrover-Kit. This is necessary for flashing with JTAG or debugging your device.
Select where to save configuration settingsIn Visual Studio Code settings can be saved in 3 places: User Settings (global settings), workspace ( .code-workspace file) or workspace folder (.vscode/settings.json). + More information in working with multiple projects.
Select output and notification modeThis extension shows many notifications and output in the Output window ESP-IDF. This command allows the user to set if to show notifications, show output, both or none of them.
Set Espressif device targetThis will set the target for the current project (IDF_TARGET). Similar to idf.py set-target. For example if you want to use ESP32 or ESP32-C3 you need to execute this command.
Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)The ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH) is used to define the device path for ESP-Matter. ESP-Matter is not supported in Windows.
Show Examples ProjectsLaunch UI to show examples from selected framework and allow the user to create a project from them. This command will show frameworks already configured in the extension so if + you want to see ESP-Rainmaker examples you need to run the Install ESP-Rainmaker first (or set the equivalent setting idf.espRainmakerPath) and then execute this command to see the examples.
Show Ninja Build SummaryExecute the Chromium ninja-build-summary.py
Size analysis of the binariesLaunch UI with the ESP-IDF project binaries size information. I SCtrl E S
Unit Test: Build and flash unit test app for testingCopy the unit test app in the current project, build the current project and flash the unit test application to the connected device. More information in Unit testing documentation
Unit Test: Install ESP-IDF PyTest requirementsInstall the ESP-IDF Pytest requirements packages to be able to execute ESP-IDF Unit tests. More information in
+ ## Arduino as ESP-IDF Component The **Add Arduino-ESP32 as ESP-IDF Component** command will add [Arduino-ESP32](https://github.com/espressif/arduino-esp32) as a ESP-IDF component in your current directory (`${CURRENT_DIRECTORY}/components/arduino`). You can also use the **ESP-IDF: Create Project from Extension Template** command with `arduino-as-component` template to create a new project directory that includes Arduino-esp32 as an ESP-IDF component. @@ -81,7 +486,7 @@ In Visual Studio Code, for **ESP-IDF: Monitor Device** we use the shell executab The user can start or stop the OpenOCD from Visual Studio Code using the **ESP-IDF: OpenOCD Manager** command or from the `OpenOCD Server (Running | Stopped)` button in the Visual Studio Code status bar. The output is shown in menu `View` -> `Output` -> `OpenOCD`. By default it will be launched using localhost, port 4444 for Telnet communication, port 6666 for TCL communication and port 3333 for Gdb. -Before using the OpenOCD server, you need to set the proper values for OpenOCD Configuration files in the `idf.openOCDConfigs` configuration setting. You can choose a specific board listed in OpenOCD using **ESP-IDF: Select OpenOCD Board Configuration** or use **ESP-IDF: Device Configuration** to manually set any value you desire. +Before using the OpenOCD server, you need to set the proper values for OpenOCD Configuration files in the `idf.openOCDConfigs` configuration setting. You can choose a specific board listed in OpenOCD using **ESP-IDF: Select OpenOCD Board Configuration**. > **NOTE:** The user can modify `openocd.tcl.host` and `openocd.tcl.port` configuration settings to modify these values. Please review [ESP-IDF Settings](../SETTINGS.md) to see how to modify these configuration settings. diff --git a/docs/HARDWARE_SUPPORT.md b/docs/HARDWARE_SUPPORT.md index 863e2bc50..bb0237eed 100644 --- a/docs/HARDWARE_SUPPORT.md +++ b/docs/HARDWARE_SUPPORT.md @@ -24,7 +24,7 @@ In addition to ESP-IDF chips, there are several boards configurations files impl - [Espressif Mesh Development Framework (ESP-MDF)](https://github.com/espressif/esp-mdf) to develop with the [ESP-WIFI-MESH](https://docs.espressif.com/projects/esp-idf/en/stable/api-guides/mesh.html) networking protocol. The **Install ESP-MDF** will clone ESP-MDF to a selected directory and set `idf.espMdfPath` (`idf.espMdfPathWin` in Windows) configuration setting. -- [Espressif Matter Framework (ESP-Matter)](https://github.com/espressif/esp-matter) to develop with the [Matter](https://buildwithmatter.com/) unified IP-based connectivity protocol. The **Install ESP-Matter** will clone ESP-Matter to a selected directory and set `idf.espMatterPath` configuration setting. **ESP-Matter is Not Supported in Windows**. +- [Espressif Matter Framework (ESP-Matter)](https://github.com/espressif/esp-matter) to develop with the [Matter](https://buildwithmatter.com/) unified IP-based connectivity protocol. The **Install ESP-Matter** will clone ESP-Matter to a selected directory and set `idf.espMatterPath` configuration setting. **ESP-Matter is Not Supported in Windows**. Make sure to install Matter system prerequisites first. - [Espressif Rainmaker](https://github.com/espressif/esp-rainmaker) can be clone with the **ESP-IDF: Install ESP-Rainmaker** to a selected and set `idf.espRainmakerPath` (`idf.espRainmakerPathWin` in Windows) configuration setting. diff --git a/docs/ONBOARDING.md b/docs/ONBOARDING.md index b651646ff..bc248d079 100644 --- a/docs/ONBOARDING.md +++ b/docs/ONBOARDING.md @@ -22,6 +22,7 @@ 16. [Open Existing ESP-IDF Project](./tutorial/existing_idf_project.md) 17. [Using the Project Configuration Editor](./tutorial/project_configuration.md) 18. [Using Multiple Build Configuration with the Project Configuration Editor](./tutorial/multiple_config.md) +19. [ESP-IDF Hints viewer](./tutorial/hints_viewer.md) ## Documentation diff --git a/docs/SETTINGS.md b/docs/SETTINGS.md index cbe97f8e7..df5a53825 100644 --- a/docs/SETTINGS.md +++ b/docs/SETTINGS.md @@ -4,7 +4,7 @@ This extension contributes the following settings that can be later updated in s > **NOTE:** Please consider that `~`, `%VARNAME%` and `$VARNAME` are not recognized when set on ANY of this extension configuration settings. You can instead set any environment variable in the path using a `${env:VARNAME}` such as `${env:HOME}` or you can refer to other configuration parameter path with `${config:SETTINGID}` such as `${config:idf.espIdfPath}`. -The `idf.saveScope` allows the user to specify where to save settings when using commands such as `Configure Paths`, `Device Configuration`, `Set Espressif Device Target` and other commands. Possible values are Global (User Settings), Workspace and WorkspaceFolder. For more information please take a look at [Working with Multiple Projects](./MULTI_PROJECTS.md). Use the `Select where to Save Configuration Settings` command to choose where to save settings when using this extension commands. +The `idf.saveScope` allows the user to specify where to save settings when using commands such as `Set Espressif Device Target` and other commands. Possible values are Global (User Settings), Workspace and WorkspaceFolder. For more information please take a look at [Working with Multiple Projects](./MULTI_PROJECTS.md). Use the `Select where to Save Configuration Settings` command to choose where to save settings when using this extension commands. > **NOTE:** All settings can be applied to Global (User Settings), Workspace and WorkspaceFolder unless Scope is specified. @@ -68,7 +68,7 @@ This is how the extension uses them: 1. `idf.adapterTargetName` is used to select the chipset (esp32, esp32s2, esp32s3, esp32c3 and custom) on which to run the extension commands. > **NOTE** When you use the command **ESP-IDF: Set Espressif Device Target** it will override `idf.adapterTargetName` with selected chip and `idf.openOcdConfigs` with its default OpenOCD Configuration Files. > - > > If you want to customize the `idf.openOcdConfigs` alone, you can modify your user settings.json or use **ESP-IDF: Device Configuration** and select `Enter OpenOCD Configuration File Paths List` by entering each file separated by comma ",". + > > If you want to customize the `idf.openOcdConfigs` alone, you can use the **ESP-IDF: Select OpenOCD Board Configuration** or modify your settings.json directly. 2. `idf.customAdapterTargetName` is used when `idf.adapterTargetName` is set to `custom`. 3. `idf.flashBaudRate` is the baud rate value used for the **ESP-IDF: Flash your Project** command and [ESP-IDF Debug](./DEBUGGING.md). 4. `idf.monitorBaudRate` is the ESP-IDF Monitor baud rate value and fallback from your project's skdconfig `CONFIG_ESPTOOLPY_MONITOR_BAUD` (idf.py monitor' baud rate). This value can also be override by setting the environment variable `IDF_MONITOR_BAUD` or `MONITORBAUD` in your system environment variables or this extension's `idf.customExtraVars` configuration setting. @@ -156,14 +156,6 @@ These settings allow to support additional frameworks together with ESP-IDF: | `idf.espRainmakerPathWin` | Path to locate ESP-Rainmaker framework in Windows (RMAKER_PATH) | | `idf.sbomFilePath` | Path to create ESP-IDF SBOM report | -The **ESP-IDF: Install ESP-ADF** command will clone ESP-ADF and set `idf.espAdfPath` (`idf.espAdfPathWin` in Windows). -The **ESP-IDF: Install ESP-MDF** command will clone ESP-MDF and set `idf.espMdfPath` (`idf.espMdfPathWin` in Windows). -The **ESP-IDF: Install ESP-Matter** command will clone ESP-Matter and set `idf.espMatterPath`. The **ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)** is used to define the device path for ESP-Matter. ESP-Matter is not supported in Windows. -The **ESP-IDF: Install ESP-Rainmaker** command will clone ESP-Rainmaker and set `idf.espRainmakerPath` (`idf.espRainmakerPathWin` in Windows) configuration setting. -The **ESP-IDF: Install ESP-HomeKit-SDK** command will clone ESP-HomeKit-SDK inside the selected directory and set `idf.espHomeKitSdkPath` (`idf.espHomeKitSdkPathWin` in Windows) configuration setting. - -The **ESP-IDF: Show Examples Projects** command allows you create a new project using one of the examples in ESP-IDF, ESP-ADF, ESP-Matter or ESP-MDF directory if related configuration settings are set, or to create projects from examples found in the ESP Component Registry. - ## Use of Environment Variables in ESP-IDF settings.json and tasks.json Environment (env) variables and other ESP-IDF settings (config) current values strings can be used in other ESP-IDF setting as `${env:VARNAME}` and `${config:ESPIDFSETTING}`, respectively. diff --git a/docs/SETUP.md b/docs/SETUP.md index 10c201a1a..ad336f562 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -117,7 +117,7 @@ where: Make sure to install the extension and extension debug adapter Python requirements by running the following commands in your terminal: ``` -PYTHON_INTERPRETER -m pip install --upgrade -r EXTENSION_PATH/esp_debug_adapter/requirements.txt +PYTHON_INTERPRETER -m pip install --upgrade -r EXTENSION_PATH/esp_debug_adapter/requirements.txt --extra-index-url https://dl.espressif.com/pypi ``` where EXTENSION_PATH is diff --git a/docs/tutorial/additional_frameworks.md b/docs/tutorial/additional_frameworks.md index a54443557..83b78365f 100644 --- a/docs/tutorial/additional_frameworks.md +++ b/docs/tutorial/additional_frameworks.md @@ -8,7 +8,7 @@ Besides ESP-IDF, you can install other frameworks to extend the extension functi 2. [Espressif Mesh Development Framework (ESP-MDF)](https://github.com/espressif/esp-mdf) with this extension using the **Install ESP-MDF** command, which will clone ESP-MDF to the selected directory and set `idf.espMdfPath` (`idf.espMdfPathWin` in Windows) configuration setting. -3. [Espressif Matter Framework (ESP-Matter)](https://github.com/espressif/esp-matter) with this extension using the **Install ESP-Matter** command, which will clone ESP-Matter to the selected directory and set `idf.espMatterPath` configuration setting. The **ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)** is used to define the device path for ESP-Matter. **ESP-Matter is Not Supported in Windows**. +3. [Espressif Matter Framework (ESP-Matter)](https://github.com/espressif/esp-matter) with this extension using the **Install ESP-Matter** command, which will clone ESP-Matter to the selected directory and set `idf.espMatterPath` configuration setting. The **ESP-IDF: Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)** is used to define the device path for ESP-Matter. **ESP-Matter is Not Supported in Windows**. Make sure to install Matter system prerequisites first. 4. [Espressif Rainmaker](https://github.com/espressif/esp-rainmaker) can be clone with the **ESP-IDF: Install ESP-Rainmaker** to a selected and set `idf.espRainmakerPath` (`idf.espRainmakerPathWin` in Windows) configuration setting. diff --git a/docs/tutorial/debugging.md b/docs/tutorial/debugging.md index 506267768..58163f226 100644 --- a/docs/tutorial/debugging.md +++ b/docs/tutorial/debugging.md @@ -5,7 +5,7 @@ This tutorial shows the user how to debug ESP-IDF projects using the Visual Studio Code extension for ESP-IDF. If you haven't configured the extension as explained in [Install tutorial](./install.md) please do it first. 1. Configure, build and flash your project as explained in [Basic use tutorial](./basic_use.md). -2. Set the proper values for openOCD Configuration files in the `idf.openOCDConfigs` configuration setting. You can choose a specific board listed in openOCD using **ESP-IDF: Select OpenOCD Board Configuration**, **ESP-IDF: Set Espressif Device Target** or use **ESP-IDF: Device Configuration** to manually set any value you desire. +2. Set the proper values for openOCD Configuration files in the `idf.openOCDConfigs` configuration setting. You can choose a specific board listed in openOCD using **ESP-IDF: Select OpenOCD Board Configuration** or **ESP-IDF: Set Espressif Device Target**. > **NOTE:** Please take a look at [Configuring of OpenOCD for specific target](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/jtag-debugging/tips-and-quirks.html#configuration-of-openocd-for-specific-target) for more information about these configuration files. diff --git a/docs/tutorial/toc.md b/docs/tutorial/toc.md index 5944fdff8..f68d9fe3d 100644 --- a/docs/tutorial/toc.md +++ b/docs/tutorial/toc.md @@ -20,3 +20,4 @@ 16. [Open Existing ESP-IDF Project](./existing_idf_project.md) 17. [Using the Project Configuration](./project_configuration.md) editor. 18. [Using Multiple Build Configuration with the Project Configuration Editor](./multiple_config.md) +19. [ESP-IDF Hints viewer](./hints_viewer.md) diff --git a/l10n/bundle.l10n.es.json b/l10n/bundle.l10n.es.json index 835aa38e1..1ab856a8c 100644 --- a/l10n/bundle.l10n.es.json +++ b/l10n/bundle.l10n.es.json @@ -5,7 +5,7 @@ "File project_description.json cannot be found.": "No se puede encontrar el archivo project_description.json.", "Open a folder first.": "Primero abra una carpeta.", "Selected command is not available in WebIDE": "El comando seleccionado no está disponible en WebIDE", - "Use current folder: {workspace}": "Usar carpeta actual: {workspace}", + "Use current folder: {workspace}": "Usar carpeta actual: {espacio de trabajo}", "Choose a container directory...": "Elija un directorio de contenedor...", "Select a directory to use": "Seleccione un directorio para usar", "Select a template to use": "Seleccione una plantilla para usar", @@ -29,26 +29,12 @@ "Do not show notifications but focus tasks output.": "No muestre notificaciones, pero centre la salida de las tareas.", "Show notifications and focus tasks output.": "Muestra notificaciones y resultados de tareas de enfoque.", "Select the output and notification mode": "Seleccione el modo de salida y notificación", - "Notification mode has changed to {mode}": "El modo de notificación ha cambiado a {modo}", - "Select framework to define its path:": "Seleccione el marco para definir su ruta:", - "IDF_PATH Path": "Ruta IDF_PATH", - "Set IDF_TOOLS_PATH Path": "Establecer ruta IDF_TOOLS_PATH", - "Set paths to append to PATH": "Establecer rutas para agregar a PATH", - "No option selected.": "Ninguna opción seleccionada.", - "Enter IDF_PATH Path": "Introduzca la ruta IDF_PATH", - "Enter IDF_TOOLS_PATH path": "Introduzca la ruta IDF_TOOLS_PATH", - "Enter extra paths to append to PATH": "Ingrese rutas adicionales para agregar a PATH", - "No path has been updated": "No se ha actualizado ninguna ruta.", + "Notification mode has changed to {mode}": "El modo de notificación ha cambiado a {mode}", "No project configuration found": "No se encontró ninguna configuración de proyecto", "Select configuration to use:": "Seleccione la configuración a utilizar:", + "No option selected.": "Ninguna opción seleccionada.", "ESP-IDF: Select Project Configuration": "ESP-IDF: Seleccionar configuración del proyecto", - "Select option to define its path:": "Seleccione la opción para definir su ruta:", - "Relative paths to OpenOCD Scripts directory separated by comma(,)": "Rutas relativas al directorio OpenOCD Scripts separadas por coma (,)", - "Enter device port Path": "Introduzca la ruta del puerto del dispositivo", - "Enter flash baud rate": "Introduzca la velocidad en baudios del flash", - "Enter monitor baud rate": "Introduzca la velocidad en baudios del monitor", "Enter OpenOCD Configuration File Paths list": "Ingrese a la lista de rutas de archivos de configuración de OpenOCD", - "No device parameter has been updated": "No se ha actualizado ningún parámetro del dispositivo.", "Installing ESP-IDF extension Python Requirements...": "Instalación de la extensión ESP-IDF Requisitos de Python...", "ESP-IDF Python Requirements has been installed": "Se han instalado los requisitos de ESP-IDF Python", "Installing ESP-Matter Python Requirements...": "Instalación de los requisitos de ESP-Matter Python...", @@ -59,6 +45,7 @@ "ESP-IDF container files have been added to the project.": "Se han agregado archivos contenedores ESP-IDF al proyecto.", "Enter ESP-IDF component name": "Ingrese el nombre del componente ESP-IDF", "The ESP-IDF component {componentName} has been created": "Se ha creado el componente ESP-IDF {componentName}", + "The current directory is not an ESP-IDF project.": "El directorio actual no es un proyecto ESP-IDF.", "ESP-IDF: SDK Configuration Editor": "ESP-IDF: Editor de configuración del SDK", "ESP-IDF: Save Default Configuration (save-defconfig)": "ESP-IDF: Guardar configuración predeterminada (save-defconfig)", "Enter target name (IDF_TARGET)": "Introduzca el nombre del objetivo (IDF_TARGET)", @@ -83,6 +70,8 @@ "Select an action to use": "Seleccione una acción para usar", "ESP-IDF: Preparing ESP-IDF extension report": "ESP-IDF: Preparando informe de extensión ESP-IDF", "Extension configuration report has been copied to clipboard with errors": "El informe de configuración de la extensión se ha copiado al portapapeles con errores", + "No launch.json found.\n Use the ESP-IDF: Add vscode Configuration Folder command.": "No se encontró launch.json.\n ", + "No gdbtarget configuration found in launch.json.\n Delete launch.json and use the ESP-IDF: Add vscode Configuration Folder' command.": "No se encontró ninguna configuración de gdbtarget en launch.json.\n ", "Cannot call this command directly, click on any Trace to view its report!": "No se puede llamar a este comando directamente. Haga clic en cualquier seguimiento para ver su informe.", "Do you want to view Heap Trace plot or System View Trace": "¿Quiere ver el gráfico de seguimiento del montón o el seguimiento de vista del sistema?", "Show System View Tracing Plot (will open a webview window)": "Mostrar gráfico de seguimiento de vista del sistema (se abrirá una ventana de vista web)", @@ -93,7 +82,7 @@ "Would you like to unlink your ESP Rainmaker cloud account?": "¿Le gustaría desvincular su cuenta en la nube ESP Rainmaker?", "Would you like to delete this node from your ESP Rainmaker account?": "¿Le gustaría eliminar este nodo de su cuenta ESP Rainmaker?", "ESP-IDF: Deleting node from your rainmaker account": "ESP-IDF: Eliminando nodo de su cuenta rainmaker", - "Failed to delete node, maybe the node is already marked for delete, please try again after sometime": "No se pudo eliminar el nodo, tal vez el nodo ya esté marcado para eliminarse; inténtelo nuevamente después de algún tiempo", + "Failed to delete node, maybe the node is already marked for delete, please try again after sometime": "No se pudo eliminar el nodo; tal vez el nodo ya esté marcado para eliminarse; inténtelo nuevamente después de algún tiempo", "Coming Soon!! until then you can add nodes using mobile app": "¡¡Muy pronto!! ", "Failed to update the param, please try once more": "No se pudo actualizar el parámetro, inténtelo una vez más.", "Failed to update param because, ": "No se pudo actualizar el parámetro porque, ", @@ -133,14 +122,16 @@ "ESP-IDF: Select Flash Method": "ESP-IDF: seleccione el método Flash", "ESP-IDF: Flash Device": "ESP-IDF: Dispositivo flash", "ESP-IDF: Monitor Device": "ESP-IDF: Dispositivo de monitoreo", + "ESP-IDF: Debug": "ESP-IDF: Depurar", "ESP-IDF: Build, Flash and Monitor": "ESP-IDF: construir, flashear y monitorear", "ESP-IDF: Open ESP-IDF Terminal": "ESP-IDF: Abrir terminal ESP-IDF", "ESP-IDF: Execute Custom Task": "ESP-IDF: ejecutar tarea personalizada", - "QEMU is not running. Run first.": "QEMU no se está ejecutando. ", "ESP-IDF: Building project": "ESP-IDF: Proyecto de construcción", "Select flash method, you can modify the choice later from 'settings.json' (idf.flashType)": "Seleccione el método flash, puede modificar la elección más tarde desde 'settings.json' (idf.flashType)", "Current app binary is different from your project. Flash first.": "El binario de la aplicación actual es diferente de su proyecto. ", "ESP-IDF Welcome": "ESP-IDF Bienvenido", + "ESP-IDF Troubleshooting Form": "Formulario de solución de problemas ESP-IDF", + "ESP-IDF Troubleshoot Report has been generated.": "Se ha generado el informe de solución de problemas de ESP-IDF.", "ESP-IDF Setup": "Configuración ESP-IDF", "ESP-IDF Project Configuration": "Configuración del proyecto ESP-IDF", "New Project": "Nuevo proyecto", diff --git a/l10n/bundle.l10n.pt.json b/l10n/bundle.l10n.pt.json index 5abfb0e87..c00ab87ef 100644 --- a/l10n/bundle.l10n.pt.json +++ b/l10n/bundle.l10n.pt.json @@ -30,25 +30,11 @@ "Show notifications and focus tasks output.": "Mostre notificações e concentre a saída das tarefas.", "Select the output and notification mode": "Selecione o modo de saída e notificação", "Notification mode has changed to {mode}": "O modo de notificação mudou para {mode}", - "Select framework to define its path:": "Selecione a estrutura para definir seu caminho:", - "IDF_PATH Path": "Caminho IDF_PATH", - "Set IDF_TOOLS_PATH Path": "Definir caminho IDF_TOOLS_PATH", - "Set paths to append to PATH": "Defina caminhos para anexar ao PATH", - "No option selected.": "Nenhuma opção selecionada.", - "Enter IDF_PATH Path": "Insira o caminho IDF_PATH", - "Enter IDF_TOOLS_PATH path": "Insira o caminho IDF_TOOLS_PATH", - "Enter extra paths to append to PATH": "Insira caminhos extras para anexar ao PATH", - "No path has been updated": "Nenhum caminho foi atualizado", "No project configuration found": "Nenhuma configuração de projeto encontrada", "Select configuration to use:": "Selecione a configuração a ser usada:", + "No option selected.": "Nenhuma opção selecionada.", "ESP-IDF: Select Project Configuration": "ESP-IDF: Selecione a configuração do projeto", - "Select option to define its path:": "Selecione a opção para definir seu caminho:", - "Relative paths to OpenOCD Scripts directory separated by comma(,)": "Caminhos relativos para o diretório OpenOCD Scripts separados por vírgula (,)", - "Enter device port Path": "Insira o caminho da porta do dispositivo", - "Enter flash baud rate": "Insira a taxa de transmissão do flash", - "Enter monitor baud rate": "Insira a taxa de transmissão do monitor", "Enter OpenOCD Configuration File Paths list": "Insira a lista de caminhos de arquivos de configuração do OpenOCD", - "No device parameter has been updated": "Nenhum parâmetro do dispositivo foi atualizado", "Installing ESP-IDF extension Python Requirements...": "Instalando a extensão ESP-IDF Requisitos do Python...", "ESP-IDF Python Requirements has been installed": "Os requisitos ESP-IDF Python foram instalados", "Installing ESP-Matter Python Requirements...": "Instalando os requisitos do ESP-Matter Python...", @@ -59,6 +45,7 @@ "ESP-IDF container files have been added to the project.": "Arquivos contêiner ESP-IDF foram adicionados ao projeto.", "Enter ESP-IDF component name": "Insira o nome do componente ESP-IDF", "The ESP-IDF component {componentName} has been created": "O componente ESP-IDF {componentName} foi criado", + "The current directory is not an ESP-IDF project.": "O diretório atual não é um projeto ESP-IDF.", "ESP-IDF: SDK Configuration Editor": "ESP-IDF: Editor de configuração do SDK", "ESP-IDF: Save Default Configuration (save-defconfig)": "ESP-IDF: Salvar configuração padrão (save-defconfig)", "Enter target name (IDF_TARGET)": "Insira o nome do destino (IDF_TARGET)", @@ -83,6 +70,8 @@ "Select an action to use": "Selecione uma ação para usar", "ESP-IDF: Preparing ESP-IDF extension report": "ESP-IDF: Preparando relatório de extensão ESP-IDF", "Extension configuration report has been copied to clipboard with errors": "O relatório de configuração da extensão foi copiado para a área de transferência com erros", + "No launch.json found.\n Use the ESP-IDF: Add vscode Configuration Folder command.": "Nenhum launch.json encontrado.\n ", + "No gdbtarget configuration found in launch.json.\n Delete launch.json and use the ESP-IDF: Add vscode Configuration Folder' command.": "Nenhuma configuração gdbtarget encontrada em launch.json.\n ", "Cannot call this command directly, click on any Trace to view its report!": "Não é possível chamar este comando diretamente, clique em qualquer Trace para visualizar seu relatório!", "Do you want to view Heap Trace plot or System View Trace": "Você deseja visualizar o gráfico de rastreamento de heap ou o rastreamento do System View", "Show System View Tracing Plot (will open a webview window)": "Mostrar gráfico de rastreamento do System View (abrirá uma janela de visualização na web)", @@ -128,19 +117,21 @@ "ESP-IDF: Select Port to Use (COM, tty, usbserial)": "ESP-IDF: Selecione a porta a ser usada (COM, tty, usbserial)", "ESP-IDF: Set Espressif Device Target": "ESP-IDF: Definir destino do dispositivo Espressif", "ESP-IDF: SDK Configuration Editor (menuconfig)": "ESP-IDF: Editor de configuração do SDK (menuconfig)", - "ESP-IDF: Full Clean": "ESP-IDF: Limpeza Completa", + "ESP-IDF: Full Clean": "ESP-IDF: Limpeza completa", "ESP-IDF: Build Project": "ESP-IDF: Projeto de construção", "ESP-IDF: Select Flash Method": "ESP-IDF: Selecione o método Flash", "ESP-IDF: Flash Device": "ESP-IDF: Dispositivo Flash", "ESP-IDF: Monitor Device": "ESP-IDF: Dispositivo Monitor", + "ESP-IDF: Debug": "ESP-IDF: depuração", "ESP-IDF: Build, Flash and Monitor": "ESP-IDF: construir, atualizar e monitorar", "ESP-IDF: Open ESP-IDF Terminal": "ESP-IDF: Terminal ESP-IDF aberto", "ESP-IDF: Execute Custom Task": "ESP-IDF: Executar tarefa personalizada", - "QEMU is not running. Run first.": "QEMU não está em execução. ", "ESP-IDF: Building project": "ESP-IDF: Projeto de construção", "Select flash method, you can modify the choice later from 'settings.json' (idf.flashType)": "Selecione o método flash, você pode modificar a escolha posteriormente em 'settings.json' (idf.flashType)", "Current app binary is different from your project. Flash first.": "O binário atual do aplicativo é diferente do seu projeto. ", "ESP-IDF Welcome": "Bem-vindo ESP-IDF", + "ESP-IDF Troubleshooting Form": "Formulário de solução de problemas ESP-IDF", + "ESP-IDF Troubleshoot Report has been generated.": "O relatório de solução de problemas do ESP-IDF foi gerado.", "ESP-IDF Setup": "Configuração ESP-IDF", "ESP-IDF Project Configuration": "Configuração do projeto ESP-IDF", "New Project": "Novo projeto", diff --git a/l10n/bundle.l10n.ru.json b/l10n/bundle.l10n.ru.json index 433743b3d..d133d5284 100644 --- a/l10n/bundle.l10n.ru.json +++ b/l10n/bundle.l10n.ru.json @@ -30,25 +30,11 @@ "Show notifications and focus tasks output.": "Показывать уведомления и фокусировать вывод задач.", "Select the output and notification mode": "Выберите режим вывода и уведомления", "Notification mode has changed to {mode}": "Режим уведомлений изменен на {mode}.", - "Select framework to define its path:": "Выберите структуру, чтобы определить ее путь:", - "IDF_PATH Path": "IDF_PATH Путь", - "Set IDF_TOOLS_PATH Path": "Установить путь IDF_TOOLS_PATH", - "Set paths to append to PATH": "Установите пути для добавления в PATH", - "No option selected.": "Опция не выбрана.", - "Enter IDF_PATH Path": "Введите путь IDF_PATH", - "Enter IDF_TOOLS_PATH path": "Введите путь IDF_TOOLS_PATH", - "Enter extra paths to append to PATH": "Введите дополнительные пути для добавления к PATH.", - "No path has been updated": "Ни один путь не был обновлен", "No project configuration found": "Конфигурация проекта не найдена", "Select configuration to use:": "Выберите конфигурацию для использования:", + "No option selected.": "Опция не выбрана.", "ESP-IDF: Select Project Configuration": "ESP-IDF: выберите конфигурацию проекта", - "Select option to define its path:": "Выберите опцию, чтобы определить путь:", - "Relative paths to OpenOCD Scripts directory separated by comma(,)": "Относительные пути к каталогу сценариев OpenOCD, разделенные запятой (,)", - "Enter device port Path": "Введите путь к порту устройства", - "Enter flash baud rate": "Введите скорость передачи флэш-памяти", - "Enter monitor baud rate": "Введите скорость передачи данных монитора", "Enter OpenOCD Configuration File Paths list": "Войдите в список путей к файлам конфигурации OpenOCD", - "No device parameter has been updated": "Ни один параметр устройства не был обновлен", "Installing ESP-IDF extension Python Requirements...": "Установка расширения ESP-IDF Требования Python...", "ESP-IDF Python Requirements has been installed": "Требования ESP-IDF Python установлены.", "Installing ESP-Matter Python Requirements...": "Установка требований ESP-Matter Python...", @@ -59,6 +45,7 @@ "ESP-IDF container files have been added to the project.": "В проект добавлены файлы-контейнеры ESP-IDF.", "Enter ESP-IDF component name": "Введите имя компонента ESP-IDF", "The ESP-IDF component {componentName} has been created": "Компонент ESP-IDF {comComponentName} создан.", + "The current directory is not an ESP-IDF project.": "Текущий каталог не является проектом ESP-IDF.", "ESP-IDF: SDK Configuration Editor": "ESP-IDF: Редактор конфигурации SDK", "ESP-IDF: Save Default Configuration (save-defconfig)": "ESP-IDF: сохранить конфигурацию по умолчанию (save-defconfig)", "Enter target name (IDF_TARGET)": "Введите имя цели (IDF_TARGET)", @@ -83,6 +70,8 @@ "Select an action to use": "Выберите действие для использования", "ESP-IDF: Preparing ESP-IDF extension report": "ESP-IDF: подготовка отчета о расширении ESP-IDF.", "Extension configuration report has been copied to clipboard with errors": "Отчет о конфигурации расширения скопирован в буфер обмена с ошибками.", + "No launch.json found.\n Use the ESP-IDF: Add vscode Configuration Folder command.": "Файл launch.json не найден.\n ", + "No gdbtarget configuration found in launch.json.\n Delete launch.json and use the ESP-IDF: Add vscode Configuration Folder' command.": "В файле launch.json не найдена конфигурация gdbtarget.\n ", "Cannot call this command directly, click on any Trace to view its report!": "Невозможно вызвать эту команду напрямую. Щелкните любую трассировку, чтобы просмотреть ее отчет!", "Do you want to view Heap Trace plot or System View Trace": "Вы хотите просмотреть график Heap Trace или System View Trace?", "Show System View Tracing Plot (will open a webview window)": "Показать график трассировки системного представления (откроется окно веб-просмотра)", @@ -133,14 +122,16 @@ "ESP-IDF: Select Flash Method": "ESP-IDF: выберите метод прошивки", "ESP-IDF: Flash Device": "ESP-IDF: флэш-устройство", "ESP-IDF: Monitor Device": "ESP-IDF: Устройство мониторинга", + "ESP-IDF: Debug": "ESP-IDF: отладка", "ESP-IDF: Build, Flash and Monitor": "ESP-IDF: сборка, прошивка и мониторинг", "ESP-IDF: Open ESP-IDF Terminal": "ESP-IDF: открыть терминал ESP-IDF.", "ESP-IDF: Execute Custom Task": "ESP-IDF: выполнить пользовательскую задачу", - "QEMU is not running. Run first.": "QEMU не работает. ", "ESP-IDF: Building project": "ESP-IDF: Строительный проект", "Select flash method, you can modify the choice later from 'settings.json' (idf.flashType)": "Выберите метод прошивки. Вы можете изменить выбор позже в «settings.json» (idf.flashType).", "Current app binary is different from your project. Flash first.": "Текущий двоичный файл приложения отличается от вашего проекта. ", "ESP-IDF Welcome": "ESP-IDF Добро пожаловать", + "ESP-IDF Troubleshooting Form": "Форма устранения неполадок ESP-IDF", + "ESP-IDF Troubleshoot Report has been generated.": "Отчет об устранении неполадок ESP-IDF создан.", "ESP-IDF Setup": "Настройка ESP-IDF", "ESP-IDF Project Configuration": "Конфигурация проекта ESP-IDF", "New Project": "Новый проект", @@ -150,7 +141,7 @@ "Cannot proceed with size analysis on a canceled context": "Невозможно продолжить анализ размера в отмененном контексте.", "Build is required for a size analysis, build your project first": "Для анализа размера требуется сборка. Сначала создайте свой проект.", "Gathering Overview": "Обзор сбора", - "Gathering Archive List": "Сбор списка архивов", + "Gathering Archive List": "Сбор архивного списка", "Calculating File Sizes for all the archives": "Расчет размеров файлов для всех архивов", "Error encountered while calling idf_size.py": "Ошибка при вызове idf_size.py.", "Select the available serial port where your device is connected.": "Выберите доступный последовательный порт, к которому подключено ваше устройство.", diff --git a/l10n/bundle.l10n.zh-CN.json b/l10n/bundle.l10n.zh-CN.json index 4c6fb5222..623d5676f 100644 --- a/l10n/bundle.l10n.zh-CN.json +++ b/l10n/bundle.l10n.zh-CN.json @@ -30,25 +30,11 @@ "Show notifications and focus tasks output.": "显示通知和焦点任务输出。", "Select the output and notification mode": "选择输出和通知模式", "Notification mode has changed to {mode}": "通知模式已更改为{mode}", - "Select framework to define its path:": "选择框架来定义其路径:", - "IDF_PATH Path": "IDF_PATH 路径", - "Set IDF_TOOLS_PATH Path": "设置 IDF_TOOLS_PATH 路径", - "Set paths to append to PATH": "设置附加到 PATH 的路径", - "No option selected.": "未选择任何选项。", - "Enter IDF_PATH Path": "输入 IDF_PATH 路径", - "Enter IDF_TOOLS_PATH path": "输入 IDF_TOOLS_PATH 路径", - "Enter extra paths to append to PATH": "输入附加到 PATH 的额外路径", - "No path has been updated": "没有更新路径", "No project configuration found": "找不到项目配置", "Select configuration to use:": "选择要使用的配置:", + "No option selected.": "未选择任何选项。", "ESP-IDF: Select Project Configuration": "ESP-IDF:选择项目配置", - "Select option to define its path:": "选择定义其路径的选项:", - "Relative paths to OpenOCD Scripts directory separated by comma(,)": "OpenOCD 脚本目录的相对路径,以逗号 (,) 分隔", - "Enter device port Path": "输入设备端口路径", - "Enter flash baud rate": "输入闪存波特率", - "Enter monitor baud rate": "输入监视器波特率", "Enter OpenOCD Configuration File Paths list": "输入 OpenOCD 配置文件路径列表", - "No device parameter has been updated": "没有更新设备参数", "Installing ESP-IDF extension Python Requirements...": "安装 ESP-IDF 扩展 Python 要求...", "ESP-IDF Python Requirements has been installed": "ESP-IDF Python 要求已安装", "Installing ESP-Matter Python Requirements...": "安装 ESP-Matter Python 要求...", @@ -59,6 +45,7 @@ "ESP-IDF container files have been added to the project.": "ESP-IDF 容器文件已添加到项目中。", "Enter ESP-IDF component name": "输入 ESP-IDF 组件名称", "The ESP-IDF component {componentName} has been created": "ESP-IDF 组件 {componentName} 已创建", + "The current directory is not an ESP-IDF project.": "当前目录不是 ESP-IDF 项目。", "ESP-IDF: SDK Configuration Editor": "ESP-IDF:SDK 配置编辑器", "ESP-IDF: Save Default Configuration (save-defconfig)": "ESP-IDF:保存默认配置 (save-defconfig)", "Enter target name (IDF_TARGET)": "输入目标名称 (IDF_TARGET)", @@ -83,6 +70,8 @@ "Select an action to use": "选择要使用的操作", "ESP-IDF: Preparing ESP-IDF extension report": "ESP-IDF:准备 ESP-IDF 扩展报告", "Extension configuration report has been copied to clipboard with errors": "扩展配置报告已复制到剪贴板,但有错误", + "No launch.json found.\n Use the ESP-IDF: Add vscode Configuration Folder command.": "未找到 launch.json。\n ", + "No gdbtarget configuration found in launch.json.\n Delete launch.json and use the ESP-IDF: Add vscode Configuration Folder' command.": "launch.json 中未找到 gdbtarget 配置。\n ", "Cannot call this command directly, click on any Trace to view its report!": "不能直接调用该命令,点击任意Trace即可查看其报告!", "Do you want to view Heap Trace plot or System View Trace": "您想要查看堆跟踪图还是系统视图跟踪", "Show System View Tracing Plot (will open a webview window)": "显示系统视图跟踪图(将打开网络视图窗口)", @@ -133,14 +122,16 @@ "ESP-IDF: Select Flash Method": "ESP-IDF:选择闪存方法", "ESP-IDF: Flash Device": "ESP-IDF:闪存设备", "ESP-IDF: Monitor Device": "ESP-IDF:监控设备", + "ESP-IDF: Debug": "ESP-IDF:调试", "ESP-IDF: Build, Flash and Monitor": "ESP-IDF:构建、刷新和监控", "ESP-IDF: Open ESP-IDF Terminal": "ESP-IDF:打开 ESP-IDF 终端", "ESP-IDF: Execute Custom Task": "ESP-IDF:执行自定义任务", - "QEMU is not running. Run first.": "QEMU 未运行。", "ESP-IDF: Building project": "ESP-IDF:建设项目", "Select flash method, you can modify the choice later from 'settings.json' (idf.flashType)": "选择 flash 方法,您可以稍后从“settings.json”(idf.flashType)修改选择", "Current app binary is different from your project. Flash first.": "当前应用程序二进制文件与您的项目不同。", "ESP-IDF Welcome": "ESP-IDF 欢迎", + "ESP-IDF Troubleshooting Form": "ESP-IDF 故障排除表", + "ESP-IDF Troubleshoot Report has been generated.": "ESP-IDF 故障排除报告已生成。", "ESP-IDF Setup": "ESP-IDF 设置", "ESP-IDF Project Configuration": "ESP-IDF 项目配置", "New Project": "新项目", diff --git a/package.json b/package.json index fec342229..00562b419 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "esp-idf-extension", "displayName": "ESP-IDF", - "description": "Develop and debug applications for Espressif ESP32, ESP32-S2 chips with ESP-IDF", + "description": "Develop and debug applications for Espressif chips with ESP-IDF", "version": "1.7.1", "license": "Apache-2.0", "publisher": "espressif", @@ -57,12 +57,9 @@ "onCommand:espIdf.addArduinoAsComponentToCurFolder", "onCommand:espIdf.createIdfTerminal", "onCommand:espIdf.createVsCodeFolder", - "onCommand:espIdf.setPath", "onCommand:espIdf.selectConfTarget", - "onCommand:espIdf.configDevice", "onCommand:espIdf.menuconfig.start", "onCommand:espIdf.cmakeListsEditor.start", - "onCommand:espIdf.setDefaultConfig", "onCommand:espIdf.selectPort", "onCommand:espIdf.setTarget", "onCommand:espIdf.buildDevice", @@ -1007,11 +1004,6 @@ "title": "%espIdf.createIdfTerminal.title%", "category": "ESP-IDF" }, - { - "command": "espIdf.setPath", - "title": "%espIdf.setPath.title%", - "category": "ESP-IDF" - }, { "command": "espIdf.selectConfTarget", "title": "%espIdf.selectConfTarget.title%", @@ -1022,11 +1014,6 @@ "title": "%espIdf.setTarget.title%", "category": "ESP-IDF" }, - { - "command": "espIdf.configDevice", - "title": "%espIdf.configDevice.title%", - "category": "ESP-IDF" - }, { "command": "espIdf.menuconfig.start", "title": "%espIdf.menuconfig.start.title%", @@ -1047,11 +1034,6 @@ "title": "%espIdf.cmakeListsEditor.start.title%", "category": "ESP-IDF" }, - { - "command": "espIdf.setDefaultConfig", - "title": "%espIdf.setDefaultConfig.title%", - "category": "ESP-IDF" - }, { "command": "espIdf.selectPort", "title": "%espIdf.selectPort.title%", @@ -1296,6 +1278,10 @@ "title": "%espIdf.doctorCommand.title%", "category": "ESP-IDF" }, + { + "command": "espIdf.troubleshootPanel", + "title": "%espIdf.troubleshootPanel.title%" + }, { "command": "espIdf.createNewComponent", "title": "%espIdf.createNewComponent.title%", @@ -2137,6 +2123,7 @@ "pretty-quick": "^2.0.1", "process": "^0.11.10", "reflect-metadata": "^0.1.13", + "rimraf": "^5.0.7", "sass": "^1.49.8", "sass-loader": "^10", "string-replace-loader": "^3.1.0", diff --git a/package.nls.es.json b/package.nls.es.json index 1f2b33d51..3fd06b0ce 100644 --- a/package.nls.es.json +++ b/package.nls.es.json @@ -3,7 +3,7 @@ "debug.initConfig.description": "Una nueva configuración para lanzar proyectos ESP-IDF", "debug.initConfig.name": "Depuración de ESP-IDF: Lanzamiento", "esp.component-manager.cli.addDependencyError": "Se encontró un error al agregar una dependencia al componente", - "esp.component-manager.ui.show.title": "Mostrar Registro de Componentes", + "esp.component-manager.ui.show.title": "Mostrar Registro de Componentes ESP", "esp.component-manager.url.description": "URL del registro de componentes", "esp.efuse.summary.title": "Obtener Resumen de efuse", "esp.rainmaker.backend.add_node.title": "Agregar nuevo nodo", @@ -23,7 +23,6 @@ "espIdf.clearDocsSearchResult.title": "Limpiar resultados de búsqueda de ESP-IDF", "espIdf.clearSavedIdfSetups.title": "Limpiar configuraciones de ESP-IDF guardadas", "espIdf.cmakeListsEditor.start.title": "Editor CMakeLists.txt", - "espIdf.configDevice.title": "Configuración del dispositivo", "espIdf.createDevContainer.title": "Agregar configuración de contenedor Docker", "espIdf.createFiles.title": "Crear proyecto a partir de la plantilla de extensión", "espIdf.createIdfTerminal.title": "Abrir terminal ESP-IDF", @@ -33,6 +32,7 @@ "espIdf.customTask.title": "Ejecutar tarea personalizada", "espIdf.disposeConfserverProcess.title": "Disponer proceso del servidor actual del editor de configuración SDK", "espIdf.doctorCommand.title": "Comando de Doctor", + "espIdf.troubleshootPanel.title": "ESP-IDF: Formulario de solución de problemas", "espIdf.efuse.clearResults.title": "Limpiar resumen de efuse", "espIdf.eraseFlash.title": "Borrar memoria Flash del dispositivo", "espIdf.examples.title": "Mostrar proyectos de ejemplo", @@ -78,10 +78,8 @@ "espIdf.selectNotificationMode.title": "Seleccionar modo de notificación y salida", "espIdf.selectOpenOcdConfigFiles.title": "Seleccionar archivos de configuración de placa OpenOCD", "espIdf.selectPort.title": "Seleccionar puerto a usar (COM, tty, usbserial)", - "espIdf.setDefaultConfig.title": "Establecer archivo SDKConfig predeterminado en el proyecto", "espIdf.setGcovConfig.title": "Configurar SDKConfig del proyecto para cobertura", "espIdf.setMatterDevicePath.title": "Establecer Ruta del Dispositivo ESP-MATTER (ESP_MATTER_DEVICE_PATH)", - "espIdf.setPath.title": "Configurar Rutas", "espIdf.setTarget.title": "Establecer Objetivo del Dispositivo Espressif", "espIdf.setup.title": "Configurar Extensión ESP-IDF", "espIdf.size.title": "Análisis de tamaño de los binarios", diff --git a/package.nls.json b/package.nls.json index 1f121e3ba..0ff78391a 100644 --- a/package.nls.json +++ b/package.nls.json @@ -23,7 +23,6 @@ "espIdf.clearDocsSearchResult.title": "Clear ESP-IDF Search Results", "espIdf.clearSavedIdfSetups.title": "Clear Saved ESP-IDF Setups", "espIdf.cmakeListsEditor.start.title": "CMakeLists.txt Editor", - "espIdf.configDevice.title": "Device Configuration", "espIdf.createDevContainer.title": "Add Docker Container Configuration", "espIdf.createFiles.title": "Create Project from Extension Template", "espIdf.createIdfTerminal.title": "Open ESP-IDF Terminal", @@ -33,6 +32,7 @@ "espIdf.customTask.title": "Execute Custom Task", "espIdf.disposeConfserverProcess.title": "Dispose Current SDK Configuration Editor Server Process", "espIdf.doctorCommand.title": "Doctor Command", + "espIdf.troubleshootPanel.title": "ESP-IDF: Troubleshoot Form", "espIdf.efuse.clearResults.title": "Clear eFuse Summary", "espIdf.eraseFlash.title": "Erase Flash Memory from Device", "espIdf.examples.title": "Show Examples Projects", @@ -78,10 +78,8 @@ "espIdf.selectNotificationMode.title": "Select Output and Notification Mode", "espIdf.selectOpenOcdConfigFiles.title": "Select OpenOCD Board Configuration", "espIdf.selectPort.title": "Select Port to Use (COM, tty, usbserial)", - "espIdf.setDefaultConfig.title": "Set Default SDKConfig File in Project", "espIdf.setGcovConfig.title": "Configure Project SDKConfig for Coverage", "espIdf.setMatterDevicePath.title": "Set ESP-MATTER Device Path (ESP_MATTER_DEVICE_PATH)", - "espIdf.setPath.title": "Configure Paths", "espIdf.setTarget.title": "Set Espressif Device Target", "espIdf.setup.title": "Configure ESP-IDF Extension", "espIdf.size.title": "Size Analysis of the Binaries", diff --git a/package.nls.pt.json b/package.nls.pt.json index 7b33fe19b..ffbcf52df 100644 --- a/package.nls.pt.json +++ b/package.nls.pt.json @@ -3,7 +3,7 @@ "debug.initConfig.description": "Uma nova configuração para lançamento de projetos ESP-IDF", "debug.initConfig.name": "Depuração ESP-IDF: lançamento", "esp.component-manager.cli.addDependencyError": "Erro encontrado ao adicionar dependência ao componente", - "esp.component-manager.ui.show.title": "Mostrar registro de componentes", + "esp.component-manager.ui.show.title": "Mostrar registro de componentes ESP", "esp.component-manager.url.description": "URL de registro do componente", "esp.efuse.summary.title": "Obtenha o resumo do eFuse", "esp.rainmaker.backend.add_node.title": "Adicionar novo nó", @@ -23,7 +23,6 @@ "espIdf.clearDocsSearchResult.title": "Limpar resultados da pesquisa ESP-IDF", "espIdf.clearSavedIdfSetups.title": "Limpar configurações ESP-IDF salvas", "espIdf.cmakeListsEditor.start.title": "Editor CMakeLists.txt", - "espIdf.configDevice.title": "Configuração do dispositivo", "espIdf.createDevContainer.title": "Adicionar configuração de contêiner Docker", "espIdf.createFiles.title": "Criar projeto a partir do modelo de extensão", "espIdf.createIdfTerminal.title": "Abra o terminal ESP-IDF", @@ -33,6 +32,7 @@ "espIdf.customTask.title": "Executar tarefa personalizada", "espIdf.disposeConfserverProcess.title": "Descartar o processo atual do servidor do editor de configuração do SDK", "espIdf.doctorCommand.title": "Comando Médico", + "espIdf.troubleshootPanel.title": "ESP-IDF: Formulário de solução de problemas", "espIdf.efuse.clearResults.title": "Limpar resumo do eFuse", "espIdf.eraseFlash.title": "Apagar memória flash do dispositivo", "espIdf.examples.title": "Mostrar exemplos de projetos", @@ -78,10 +78,8 @@ "espIdf.selectNotificationMode.title": "Selecione o modo de saída e notificação", "espIdf.selectOpenOcdConfigFiles.title": "Selecione a configuração da placa OpenOCD", "espIdf.selectPort.title": "Selecione a porta a ser usada (COM, tty, usbserial)", - "espIdf.setDefaultConfig.title": "Definir arquivo SDKConfig padrão no projeto", "espIdf.setGcovConfig.title": "Configurar o projeto SDKConfig para cobertura", "espIdf.setMatterDevicePath.title": "Definir caminho do dispositivo ESP-MATTER (ESP_MATTER_DEVICE_PATH)", - "espIdf.setPath.title": "Configurar caminhos", "espIdf.setTarget.title": "Definir destino do dispositivo Espressif", "espIdf.setup.title": "Configurar extensão ESP-IDF", "espIdf.size.title": "Análise de tamanho dos binários", diff --git a/package.nls.ru.json b/package.nls.ru.json index 6b74b881c..ac942a6c3 100644 --- a/package.nls.ru.json +++ b/package.nls.ru.json @@ -3,7 +3,7 @@ "debug.initConfig.description": "Новая конфигурация для запуска проектов ESP-IDF.", "debug.initConfig.name": "Отладка ESP-IDF: запуск", "esp.component-manager.cli.addDependencyError": "Произошла ошибка при добавлении зависимости к компоненту.", - "esp.component-manager.ui.show.title": "Показать реестр компонентов", + "esp.component-manager.ui.show.title": "Показать реестр компонентов ESP", "esp.component-manager.url.description": "URL-адрес реестра компонентов", "esp.efuse.summary.title": "Получить сводку eFuse", "esp.rainmaker.backend.add_node.title": "Добавить новый узел", @@ -23,7 +23,6 @@ "espIdf.clearDocsSearchResult.title": "Очистить результаты поиска ESP-IDF", "espIdf.clearSavedIdfSetups.title": "Очистить сохраненные настройки ESP-IDF", "espIdf.cmakeListsEditor.start.title": "Редактор CMakeLists.txt", - "espIdf.configDevice.title": "Конфигурация устройства", "espIdf.createDevContainer.title": "Добавить конфигурацию Docker-контейнера", "espIdf.createFiles.title": "Создать проект из шаблона расширения", "espIdf.createIdfTerminal.title": "Открыть терминал ESP-IDF", @@ -33,6 +32,7 @@ "espIdf.customTask.title": "Выполнить пользовательскую задачу", "espIdf.disposeConfserverProcess.title": "Удалить текущий серверный процесс редактора конфигурации SDK", "espIdf.doctorCommand.title": "Доктор Команда", + "espIdf.troubleshootPanel.title": "ESP-IDF: форма устранения неполадок", "espIdf.efuse.clearResults.title": "Очистить сводку eFuse", "espIdf.eraseFlash.title": "Очистить флэш-память с устройства", "espIdf.examples.title": "Показать примеры проектов", @@ -78,10 +78,8 @@ "espIdf.selectNotificationMode.title": "Выберите режим вывода и уведомления", "espIdf.selectOpenOcdConfigFiles.title": "Выберите конфигурацию платы OpenOCD", "espIdf.selectPort.title": "Выберите порт для использования (COM, tty, usbserial)", - "espIdf.setDefaultConfig.title": "Установить файл SDKConfig по умолчанию в проекте", "espIdf.setGcovConfig.title": "Настройка Project SDKConfig для покрытия", "espIdf.setMatterDevicePath.title": "Установите путь к устройству ESP-MATTER (ESP_MATTER_DEVICE_PATH)", - "espIdf.setPath.title": "Настроить пути", "espIdf.setTarget.title": "Установите целевое устройство Espressif", "espIdf.setup.title": "Настройка расширения ESP-IDF", "espIdf.size.title": "Анализ размера двоичных файлов", diff --git a/package.nls.zh-CN.json b/package.nls.zh-CN.json index 8a9ee5583..9e895f576 100644 --- a/package.nls.zh-CN.json +++ b/package.nls.zh-CN.json @@ -3,7 +3,7 @@ "debug.initConfig.description": "为启动 ESP-IDF 项目创建新配置", "debug.initConfig.name": "ESP-IDF 调试:启动", "esp.component-manager.cli.addDependencyError": "添加依赖到组件时出错", - "esp.component-manager.ui.show.title": "显示组件注册表", + "esp.component-manager.ui.show.title": "ESP显示组件注册表", "esp.component-manager.url.description": "组件注册表 URL", "esp.efuse.summary.title": "获取 eFuse 摘要", "esp.rainmaker.backend.add_node.title": "添加新节点", @@ -23,7 +23,6 @@ "espIdf.clearDocsSearchResult.title": "清除 ESP-IDF 搜索结果", "espIdf.clearSavedIdfSetups.title": "清除保存的 ESP-IDF 设置", "espIdf.cmakeListsEditor.start.title": "CMakeLists.txt 编辑器", - "espIdf.configDevice.title": "设备配置", "espIdf.createDevContainer.title": "添加 Docker 容器配置", "espIdf.createFiles.title": "从扩展模板创建项目", "espIdf.createIdfTerminal.title": "打开 ESP-IDF 终端", @@ -33,6 +32,7 @@ "espIdf.customTask.title": "执行自定义任务", "espIdf.disposeConfserverProcess.title": "释放当前 SDK 配置编辑器服务器进程", "espIdf.doctorCommand.title": "诊断命令", + "espIdf.troubleshootPanel.title": "ESP-IDF:疑难解答表格", "espIdf.efuse.clearResults.title": "清除 eFuse 摘要", "espIdf.eraseFlash.title": "擦除设备的闪存", "espIdf.examples.title": "显示示例项目", @@ -78,10 +78,8 @@ "espIdf.selectNotificationMode.title": "选择通知模式和输出模式", "espIdf.selectOpenOcdConfigFiles.title": "选择 OpenOCD 板配置", "espIdf.selectPort.title": "选择要使用的端口 (COM、tty、usbserial)", - "espIdf.setDefaultConfig.title": "在项目中设置默认 SDKConfig 文件", "espIdf.setGcovConfig.title": "为项目 SDKConfig 配置覆盖率", "espIdf.setMatterDevicePath.title": "设置 ESP-MATTER 设备路径 (ESP_MATTER_DEVICE_PATH)", - "espIdf.setPath.title": "配置路径", "espIdf.setTarget.title": "设置 Espressif 设备目标", "espIdf.setup.title": "配置 ESP-IDF 扩展", "espIdf.size.title": "分析二进制文件的大小", diff --git a/src/build/buildCmd.ts b/src/build/buildCmd.ts index 4b3c2a796..5b7415d38 100644 --- a/src/build/buildCmd.ts +++ b/src/build/buildCmd.ts @@ -28,6 +28,8 @@ import { IdfSizeTask } from "../espIdf/size/idfSizeTask"; import { CustomTask, CustomTaskType } from "../customTasks/customTaskProvider"; import { readParameter } from "../idfConfiguration"; import { ESP } from "../config"; +import { createFlashModel } from "../flash/flashModelBuilder"; +import { OutputChannel } from "../logger/outputChannel"; export async function buildCommand( workspace: vscode.Uri, @@ -38,7 +40,9 @@ export async function buildCommand( const buildTask = new BuildTask(workspace); const customTask = new CustomTask(workspace); if (BuildTask.isBuilding || FlashTask.isFlashing) { - const waitProcessIsFinishedMsg = vscode.l10n.t("Wait for ESP-IDF build or flash to finish"); + const waitProcessIsFinishedMsg = vscode.l10n.t( + "Wait for ESP-IDF build or flash to finish" + ); Logger.errorNotify( waitProcessIsFinishedMsg, new Error("One_Task_At_A_Time") @@ -86,6 +90,8 @@ export async function buildCommand( if (!cancelToken.isCancellationRequested) { updateIdfComponentsTree(workspace); Logger.infoNotify("Build Successfully"); + const flashCmd = await buildFinishFlashCmd(workspace); + OutputChannel.appendLineAndShow(flashCmd, "Build"); TaskManager.disposeListeners(); } } catch (error) { @@ -104,3 +110,52 @@ export async function buildCommand( buildTask.building(false); return continueFlag; } + + + +export async function buildFinishFlashCmd(workspace: vscode.Uri) { + const buildPath = readParameter( + "idf.buildPath", + workspace + ) as string; + const flasherArgsPath = join(buildPath, "flasher_args.json"); + const flasherArgsExists = await pathExists(flasherArgsPath); + if (!flasherArgsExists) { + return; + } + const port = readParameter("idf.port", workspace); + const flashBaudRate = readParameter("idf.flashBaudRate", workspace); + + const flasherArgsModel = await createFlashModel( + flasherArgsPath, + port, + flashBaudRate + ); + + let flashFiles = `--flash_mode ${flasherArgsModel.mode}`; + flashFiles += ` --flash_size ${flasherArgsModel.size}`; + flashFiles += ` --flash_freq ${flasherArgsModel.frequency} `; + for (const flashFile of flasherArgsModel.flashSections) { + flashFiles += `${flashFile.address} ${flashFile.binFilePath} `; + } + + let flashString = "Project build complete. To flash, run:\n"; + flashString += + "ESP-IDF: Flash your project in the ESP-IDF Visual Studio Code Extension\n"; + flashString += "or in a ESP-IDF Terminal:\n"; + flashString += "idf.py flash\n"; + flashString += "or\r\nidf.py -p PORT flash\n"; + flashString += "or\r\n"; + flashString += `python -m esptool --chip ${ + flasherArgsModel.chip + } -b ${flashBaudRate} --before ${flasherArgsModel.before} --after ${ + flasherArgsModel.after + } ${ + flasherArgsModel.stub === false ? "--no-stub" : "" + } --port ${port} write_flash ${flashFiles}\n`; + flashString += `or from the "${buildPath}" directory\n`; + flashString += `python -m esptool --chip ${flasherArgsModel.chip} `; + flashString += `-b ${flashBaudRate} --before ${flasherArgsModel.before} `; + flashString += `--after ${flasherArgsModel.after} write_flash "@flash_args"`; + return flashString; +} diff --git a/src/build/buildTask.ts b/src/build/buildTask.ts index 79df9cef2..d514d1f4c 100644 --- a/src/build/buildTask.ts +++ b/src/build/buildTask.ts @@ -162,7 +162,11 @@ export class BuildTask { compilerArgs.push("-DCCACHE_ENABLE=1"); } } - const compileExecution = new vscode.ProcessExecution(canAccessCMake, compilerArgs, this.processOptions); + const compileExecution = new vscode.ProcessExecution( + canAccessCMake, + compilerArgs, + this.processOptions + ); const compilePresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, @@ -189,7 +193,11 @@ export class BuildTask { string >) || []; const ninjaCommand = "ninja"; - const buildExecution = new vscode.ProcessExecution(ninjaCommand, buildArgs, this.processOptions); + const buildExecution = new vscode.ProcessExecution( + ninjaCommand, + buildArgs, + this.processOptions + ); const buildPresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, @@ -233,9 +241,13 @@ export class BuildTask { "--json", join(this.buildDirPath, "flasher_args.json"), "--pid", - selectedDFUAdapterId(this.adapterTargetName) + selectedDFUAdapterId(this.adapterTargetName), ]; - const writeExecution = new vscode.ProcessExecution(this.pythonBinPath, args, this.processOptions); + const writeExecution = new vscode.ProcessExecution( + this.pythonBinPath, + args, + this.processOptions + ); const buildPresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, diff --git a/src/checkExtensionSettings.ts b/src/checkExtensionSettings.ts index e39097115..e4b4ab3c2 100644 --- a/src/checkExtensionSettings.ts +++ b/src/checkExtensionSettings.ts @@ -33,10 +33,17 @@ export async function checkExtensionSettings( if (!showSetupWindow) { return; } - const isExtensionConfigured = await isCurrentInstallValid(workspace); - if (isExtensionConfigured) { - vscode.commands.executeCommand("espIdf.welcome.start"); - return; + try { + const isExtensionConfigured = await isCurrentInstallValid(workspace); + if (isExtensionConfigured) { + vscode.commands.executeCommand("espIdf.welcome.start"); + return; + } + } catch (error) { + const msg = error.message + ? error.message + : "Checking if current install is valid throws an error."; + Logger.error(msg, error); } const notificationMode = readParameter( "idf.notificationMode", diff --git a/src/cmdTreeView/cmdTreeDataProvider.ts b/src/cmdTreeView/cmdTreeDataProvider.ts index f55935d3f..c6afc1849 100644 --- a/src/cmdTreeView/cmdTreeDataProvider.ts +++ b/src/cmdTreeView/cmdTreeDataProvider.ts @@ -203,7 +203,7 @@ export class CommandsProvider implements TreeDataProvider { "Build", CommandType.Command, "espIdf.buildDevice", - "database" + "symbol-property" ); const sizeCmd = new CommandItem( @@ -241,6 +241,13 @@ export class CommandsProvider implements TreeDataProvider { "device-desktop" ); + const debugCmd = new CommandItem( + "Debug", + CommandType.Command, + "espIdf.debug", + "debug-alt" + ); + const openOCD = new CommandItem( "Start/Stop OpenOCD Server", CommandType.Command, @@ -277,6 +284,7 @@ export class CommandsProvider implements TreeDataProvider { flashCmd, eraseFlash, monitorCmd, + debugCmd, openOCD, terminalCmd, doctorCmd, diff --git a/src/common/abstractCloning.ts b/src/common/abstractCloning.ts index cb9046b53..2518c39f6 100644 --- a/src/common/abstractCloning.ts +++ b/src/common/abstractCloning.ts @@ -73,7 +73,9 @@ export class AbstractCloning { OutputChannel.appendLine( `Cloning mirror ${ mirror == ESP.IdfMirror.Espressif ? "Espressif" : "Github" - } with URL ${mirror === ESP.IdfMirror.Espressif ? this.GITEE_REPO : this.GITHUB_REPO}` + } with URL ${ + mirror === ESP.IdfMirror.Espressif ? this.GITEE_REPO : this.GITHUB_REPO + }` ); return this.spawnWithProgress( this.gitBinPath, @@ -188,6 +190,9 @@ export class AbstractCloning { cancelToken.onCancellationRequested((e) => { this.cancel(); }); + if (typeof recursiveDownload === "undefined") { + recursiveDownload = mirrorOption.target !== ESP.IdfMirror.Espressif; + } await this.downloadByCloning( installDirPath, undefined, @@ -195,6 +200,9 @@ export class AbstractCloning { recursiveDownload, mirrorOption.target ); + if (mirrorOption.target === ESP.IdfMirror.Espressif) { + await this.updateSubmodules(resultingPath, undefined, progress); + } const target = idfConf.readParameter("idf.saveScope"); await idfConf.writeParameter(configurationId, resultingPath, target); Logger.infoNotify(`${this.name} has been installed`); @@ -260,11 +268,12 @@ export class AbstractCloning { const lines = gitModules.split("\n"); function getSubmoduleUrl(line: string) { - const matches = line.match( - /^submodule\.([^.]*)\.(?:url=)..\/..\/(.*).git$/ - ); - if (matches) { - const [, subPath, url] = matches; + const subpathMatch = line.match(/^submodule\.([^.]*?)\.url.*$/); + const subPath = subpathMatch ? subpathMatch[1] : ""; + + const locationMatch = line.match(/.*\/(.*)\.git/); + let url = locationMatch ? locationMatch[1] : ""; + if (subPath && url) { return { subPath, url }; } return null; diff --git a/src/component-manager/panel.ts b/src/component-manager/panel.ts index f0534958e..12e86288a 100644 --- a/src/component-manager/panel.ts +++ b/src/component-manager/panel.ts @@ -98,11 +98,37 @@ export class ComponentManagerUIPanel { } private async onMessage(message: IMessage, workspaceUri: Uri) { + const notificationMode = readParameter( + "idf.notificationMode", + workspaceUri + ) as string; + const ProgressLocation = + notificationMode === NotificationMode.All || + notificationMode === NotificationMode.Notifications + ? vscode.ProgressLocation.Notification + : vscode.ProgressLocation.Window; switch (message.message) { case "install": if (!message.dependency) return; const component = message.component || "main"; - addDependency(this.workspaceRoot, message.dependency, component); + await vscode.window.withProgress( + { + cancellable: false, + location: ProgressLocation, + title: `ESP-IDF: Adding ${message.dependency} to component ${component}...`, + }, + async ( + progress: vscode.Progress<{ message: string; increment: number }>, + cancelToken: vscode.CancellationToken + ) => { + await addDependency( + this.workspaceRoot, + message.dependency, + component, + cancelToken + ); + } + ); break; case "create-project-from-example": @@ -117,15 +143,6 @@ export class ComponentManagerUIPanel { if (!selectedFolder) { return; } - const notificationMode = readParameter( - "idf.notificationMode", - workspaceUri - ) as string; - const ProgressLocation = - notificationMode === NotificationMode.All || - notificationMode === NotificationMode.Notifications - ? vscode.ProgressLocation.Notification - : vscode.ProgressLocation.Window; await vscode.window.withProgress( { location: ProgressLocation, diff --git a/src/component-manager/utils.ts b/src/component-manager/utils.ts index b2a69a8db..75a489954 100644 --- a/src/component-manager/utils.ts +++ b/src/component-manager/utils.ts @@ -17,14 +17,15 @@ import { existsSync } from "fs"; import { Logger } from "../logger/logger"; import { spawn, appendIdfAndToolsToPath } from "../utils"; -import { Uri, l10n } from "vscode"; +import { CancellationToken, Uri, l10n } from "vscode"; import { readParameter } from "../idfConfiguration"; import { join } from "path"; export async function addDependency( workspace: Uri, dependency: string, - component: string + component: string, + cancelToken: CancellationToken ) { try { const idfPathDir = readParameter("idf.espIdfPath", workspace); @@ -51,7 +52,7 @@ export async function addDependency( const addDependencyResult = await spawn(pythonBinPath, addDependencyArgs, { cwd: workspace.fsPath, env: modifiedEnv, - }); + }, undefined, undefined, cancelToken); Logger.infoNotify( `Added dependency ${dependency} to the component "${component}"` ); diff --git a/src/coverage/coverageService.ts b/src/coverage/coverageService.ts index f937ede19..246077522 100644 --- a/src/coverage/coverageService.ts +++ b/src/coverage/coverageService.ts @@ -149,8 +149,18 @@ export async function generateCoverageForEditors( } } catch (error) { const msg = error.message ? error.message : error; - Logger.error("Error generate editor coverage.\n" + msg, error); - OutputChannel.appendLine("Error generating editor coverage.\n" + msg); + Logger.error( + "Error generate editor coverage.\n" + + "Check the ESP-IDF output for more details." + + msg, + error + ); + OutputChannel.appendLine( + msg + + "\nError generating editor coverage.\n" + + "Review the code coverage tutorial https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/code_coverage.md \n" + + "or ESP-IDF documentation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#gcov-source-code-coverage \n" + ); } return coveredEditors; } @@ -166,7 +176,7 @@ export async function previewReport(dirPath: vscode.Uri) { return; } const gcovObj = await getGcovData(dirPath); - const reportHtml = await createGcovHtmlReport(gcovObj); + const reportHtml = createGcovHtmlReport(gcovObj); gcovHtmlPanel = vscode.window.createWebviewPanel( "gcoveragePreview", "GCC Code Coverage Report", @@ -176,8 +186,17 @@ export async function previewReport(dirPath: vscode.Uri) { gcovHtmlPanel.webview.html = reportHtml; gcovHtmlPanel.onDidDispose(() => (gcovHtmlPanel = undefined)); } catch (e) { - const msg = e.message ? e.message : e; - Logger.error("Error building gcov html.\n" + msg, e); - OutputChannel.appendLine("Error building gcov html.\n" + msg); + const msg = e && e.message ? e.message : e; + Logger.errorNotify( + "Error building gcov html.\n" + + "Check the ESP-IDF output for more details.", + e + ); + OutputChannel.appendLine( + msg + + "\nError building gcov html.\n" + + "Review the code coverage tutorial https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/code_coverage.md \n" + + "or ESP-IDF documentation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#gcov-source-code-coverage \n" + ); } } diff --git a/src/coverage/gcdaPaths.ts b/src/coverage/gcdaPaths.ts index 12620153d..d749ce32a 100644 --- a/src/coverage/gcdaPaths.ts +++ b/src/coverage/gcdaPaths.ts @@ -73,13 +73,13 @@ export async function getGcovData(workspaceFolder: Uri) { }, (err, stdout, stderr) => { if (err) { - const msg = err.message ? err.message : err; + const msg = err && err.message ? err.message : err; Logger.error(`exec error: ${msg}`, err); - return reject(); + return reject(err); } const output = []; if (!stdout) { - return reject(); + return reject(stderr); } const parts = stdout.toString().split("\n"); for (const part of parts) { diff --git a/src/coverage/renderer.ts b/src/coverage/renderer.ts index c759d1917..0ddd3d897 100644 --- a/src/coverage/renderer.ts +++ b/src/coverage/renderer.ts @@ -234,8 +234,12 @@ export class CoverageRenderer { editor.setDecorations(this.marginDecoratorType, []); } this.cache = []; - this.coverageWatcher.dispose(); - this.editorEventListener.dispose(); + if (this.coverageWatcher) { + this.coverageWatcher.dispose(); + } + if (this.editorEventListener) { + this.editorEventListener.dispose(); + } } public dispose() { diff --git a/src/espBom/index.ts b/src/espBom/index.ts index 1f6c21bbf..cfdbb275f 100644 --- a/src/espBom/index.ts +++ b/src/espBom/index.ts @@ -155,7 +155,14 @@ export async function installEspSBOM(workspace: Uri) { } catch (error) { const installResult = await execChildProcess( pythonBinPath, - ["-m", "pip", "install", "esp-idf-sbom"], + [ + "-m", + "pip", + "install", + "esp-idf-sbom", + "--extra-index-url", + "https://dl.espressif.com/pypi", + ], workspace.fsPath, OutputChannel.init(), { env: modifiedEnv } diff --git a/src/espIdf/monitor/checkWebsocketClient.ts b/src/espIdf/monitor/checkWebsocketClient.ts new file mode 100644 index 000000000..37dce24f4 --- /dev/null +++ b/src/espIdf/monitor/checkWebsocketClient.ts @@ -0,0 +1,56 @@ +/* + * Project: ESP-IDF VSCode Extension + * File Created: Friday, 14th June 2024 7:59:17 am + * 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 { Uri } from "vscode"; +import { readParameter } from "../../idfConfiguration"; +import { OutputChannel } from "../../logger/outputChannel"; +import { appendIdfAndToolsToPath, execChildProcess } from "../../utils"; + +export async function installWebsocketClient(workspace: Uri) { + const pythonBinPath = readParameter("idf.pythonBinPath", workspace) as string; + const modifiedEnv = appendIdfAndToolsToPath(workspace); + try { + const showResult = await execChildProcess( + pythonBinPath, + ["-m", "pip", "show", "websocket_client"], + workspace.fsPath, + OutputChannel.init(), + { env: modifiedEnv } + ); + OutputChannel.appendLine(showResult); + } catch (error) { + OutputChannel.appendLine( + "Installing the websocket_client package for IDE integration!" + ); + const installResult = await execChildProcess( + pythonBinPath, + [ + "-m", + "pip", + "install", + "websocket_client", + "--extra-index-url", + "https://dl.espressif.com/pypi", + ], + workspace.fsPath, + OutputChannel.init(), + { env: modifiedEnv } + ); + OutputChannel.appendLine(installResult); + } +} diff --git a/src/espIdf/openOcd/boardConfiguration.ts b/src/espIdf/openOcd/boardConfiguration.ts index 3e4ce6a83..356244245 100644 --- a/src/espIdf/openOcd/boardConfiguration.ts +++ b/src/espIdf/openOcd/boardConfiguration.ts @@ -51,8 +51,8 @@ export function getOpenOcdScripts(workspace: Uri): string { } export async function getBoards( - idfTarget: string = "", - openOcdScriptsPath: string = "" + openOcdScriptsPath: string = "", + idfTarget: string = "" ) { if (!openOcdScriptsPath) { const filteredDefaultBoards = defaultBoards.filter((b) => { diff --git a/src/espIdf/openOcd/openOcdManager.ts b/src/espIdf/openOcd/openOcdManager.ts index 027825a57..42a778aac 100644 --- a/src/espIdf/openOcd/openOcdManager.ts +++ b/src/espIdf/openOcd/openOcdManager.ts @@ -2,13 +2,13 @@ * Project: ESP-IDF VSCode Extension * File Created: Friday, 12th July 2019 5:59:07 pm * Copyright 2019 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. @@ -32,9 +32,6 @@ import { TCLClient, TCLConnection } from "./tcl/tclClient"; import { ESP } from "../../config"; export interface IOpenOCDConfig { - host: string; - port: number; - openOcdConfigFilesList: string[]; workspace: vscode.Uri; } @@ -46,12 +43,9 @@ export class OpenOCDManager extends EventEmitter { return OpenOCDManager.instance; } private static instance: OpenOCDManager; - - private openOcdConfigFilesList: string[]; private server: ChildProcess; private chan: Buffer; private statusBar: vscode.StatusBarItem; - private tclConnectionParams: TCLConnection; private workspace: vscode.Uri; private encounteredErrors: boolean = false; @@ -123,21 +117,9 @@ export class OpenOCDManager extends EventEmitter { } public configureServer(config: IOpenOCDConfig) { - if (config.openOcdConfigFilesList) { - this.openOcdConfigFilesList = config.openOcdConfigFilesList; - } - if (config.workspace) { this.workspace = config.workspace; } - - if (config.host) { - this.tclConnectionParams.host = config.host; - } - - if (config.port) { - this.tclConnectionParams.port = config.port; - } } public isRunning(): boolean { @@ -145,7 +127,10 @@ export class OpenOCDManager extends EventEmitter { } public async promptUserToLaunchOpenOCDServer(): Promise { - const tclClient = new TCLClient(this.tclConnectionParams); + const host = idfConf.readParameter("openocd.tcl.host", this.workspace); + const port = idfConf.readParameter("openocd.tcl.port", this.workspace); + const tclConnectionParams: TCLConnection = { host, port }; + const tclClient = new TCLClient(tclConnectionParams); if (!(await tclClient.isOpenOCDServerRunning())) { const resp = await vscode.window.showInformationMessage( "OpenOCD is not running, do you want to launch it?", @@ -178,9 +163,14 @@ export class OpenOCDManager extends EventEmitter { ); } + const openOcdConfigFilesList = idfConf.readParameter( + "idf.openOcdConfigs", + this.workspace + ) as string[]; + if ( - typeof this.openOcdConfigFilesList === "undefined" || - this.openOcdConfigFilesList.length < 1 + typeof openOcdConfigFilesList === "undefined" || + openOcdConfigFilesList.length < 1 ) { throw new Error( "Invalid OpenOCD Config files. Check idf.openOcdConfigs configuration value." @@ -194,7 +184,7 @@ export class OpenOCDManager extends EventEmitter { ) as string; openOcdArgs.push(`-d${openOcdDebugLevel}`); - this.openOcdConfigFilesList.forEach((configFile) => { + openOcdConfigFilesList.forEach((configFile) => { openOcdArgs.push("-f"); openOcdArgs.push(configFile); }); @@ -257,7 +247,10 @@ export class OpenOCDManager extends EventEmitter { `OpenOCD Exit with non-zero error code ${code}`, new Error("Spawn exit with non-zero" + code) ); - OutputChannel.appendLine(`OpenOCD Exit with non-zero error code ${code}`, "OpenOCD"); + OutputChannel.appendLine( + `OpenOCD Exit with non-zero error code ${code}`, + "OpenOCD" + ); } this.stop(); }); @@ -291,18 +284,11 @@ export class OpenOCDManager extends EventEmitter { } private configureServerWithDefaultParam() { - const openOcdConfigFilesList = idfConf.readParameter( - "idf.openOcdConfigs" - ) as string[]; if (PreCheck.isWorkspaceFolderOpen()) { this.workspace = vscode.workspace.workspaceFolders[0].uri; } - const host = idfConf.readParameter("openocd.tcl.host", this.workspace); - const port = idfConf.readParameter("openocd.tcl.port", this.workspace); - this.openOcdConfigFilesList = openOcdConfigFilesList; this.chan = Buffer.alloc(0); OutputChannel.init(); - this.tclConnectionParams = { host, port }; this.registerOpenOCDStatusBarItem(); } diff --git a/src/espIdf/serial/serialPort.ts b/src/espIdf/serial/serialPort.ts index 0a8b2f2d4..5a4369932 100644 --- a/src/espIdf/serial/serialPort.ts +++ b/src/espIdf/serial/serialPort.ts @@ -89,7 +89,7 @@ export class SerialPort { const listOfSerialPorts = await SerialPortLib.SerialPort.list(); if (!listOfSerialPorts || listOfSerialPorts.length === 0) { - reject(new Error('No serial ports found')); + reject(new Error("No serial ports found")); return; } @@ -116,8 +116,11 @@ export class SerialPort { "esptool", "esptool.py" ); - const stat = await vscode.workspace.fs.stat(vscode.Uri.file(esptoolPath)); - if (stat.type !== vscode.FileType.File) { // esptool.py does not exists + const stat = await vscode.workspace.fs.stat( + vscode.Uri.file(esptoolPath) + ); + if (stat.type !== vscode.FileType.File) { + // esptool.py does not exists throw new Error(`esptool.py does not exists in ${esptoolPath}`); } async function processPorts(serialPort: SerialPortDetails) { @@ -126,12 +129,16 @@ export class SerialPort { pythonBinPath, [esptoolPath, "--port", serialPort.comName, "chip_id"], {}, - 2000 // success is quick, failing takes too much time + 2000, // success is quick, failing takes too much time + true ); const regexp = /Chip is(.*?)[\r]?\n/; const chipIdString = chipIdBuffer.toString().match(regexp); - serialPort.chipType = chipIdString && chipIdString.length > 1 ? chipIdString[1].trim() : undefined; + serialPort.chipType = + chipIdString && chipIdString.length > 1 + ? chipIdString[1].trim() + : undefined; } catch (error) { serialPort.chipType = undefined; } diff --git a/src/espIdf/setTarget/getTargets.ts b/src/espIdf/setTarget/getTargets.ts index 88a0b4075..4f996ed4d 100644 --- a/src/espIdf/setTarget/getTargets.ts +++ b/src/espIdf/setTarget/getTargets.ts @@ -43,7 +43,9 @@ export async function getTargetsFromEspIdf(workspaceFolder: Uri) { { cwd: workspaceFolder.fsPath, env: modifiedEnv, - } + }, + undefined, + true ); const listTargetsArray = listTargetsResult.toString().trim().split(EOL); @@ -61,7 +63,9 @@ export async function getTargetsFromEspIdf(workspaceFolder: Uri) { { cwd: workspaceFolder.fsPath, env: modifiedEnv, - } + }, + undefined, + true ); const listTargetsWithPreviewArray = listTargetsWithPreviewResult .toString() @@ -86,5 +90,3 @@ export async function getTargetsFromEspIdf(workspaceFolder: Uri) { } as IdfTarget); return resultTargetArray; } - - diff --git a/src/espIdf/setTarget/index.ts b/src/espIdf/setTarget/index.ts index 5780d80b4..99bb8eb1b 100644 --- a/src/espIdf/setTarget/index.ts +++ b/src/espIdf/setTarget/index.ts @@ -20,6 +20,7 @@ import { ConfigurationTarget, Progress, ProgressLocation, + WorkspaceFolder, window, } from "vscode"; import { @@ -33,11 +34,8 @@ import { getBoards, getOpenOcdScripts } from "../openOcd/boardConfiguration"; import { getTargetsFromEspIdf } from "./getTargets"; import { setTargetInIDF } from "./setTargetInIdf"; -export async function setIdfTarget(placeHolderMsg: string) { +export async function setIdfTarget(placeHolderMsg: string, workspaceFolder: WorkspaceFolder) { const configurationTarget = ConfigurationTarget.WorkspaceFolder; - let workspaceFolder = await window.showWorkspaceFolderPick({ - placeHolder: `Pick Workspace Folder to which settings should be applied`, - }); if (!workspaceFolder) { return; } @@ -100,8 +98,8 @@ export async function setIdfTarget(placeHolderMsg: string) { ); const openOcdScriptsPath = getOpenOcdScripts(workspaceFolder.uri); const boards = await getBoards( - selectedTarget.target, - openOcdScriptsPath + openOcdScriptsPath, + selectedTarget.target ); const choices = boards.map((b) => { return { diff --git a/src/espMatter/espMatterDownload.ts b/src/espMatter/espMatterDownload.ts index 85512ad42..01f04ed9d 100644 --- a/src/espMatter/espMatterDownload.ts +++ b/src/espMatter/espMatterDownload.ts @@ -104,9 +104,10 @@ export class EspMatterCloning extends AbstractCloning { if (shellExecutableArgs && shellExecutableArgs.length) { shellOptions.shellArgs = shellExecutableArgs; } - const curWorkspaceFolder = workspace.workspaceFolders.find( - (w) => w.uri === this.currWorkspace - ); + const curWorkspaceFolder = + workspace.workspaceFolders && workspace.workspaceFolders.length + ? workspace.workspaceFolders.find((w) => w.uri === this.currWorkspace) + : undefined; const buildGnExec = this.getShellExecution(bootstrapFilePath, shellOptions); const notificationMode = readParameter( @@ -294,7 +295,6 @@ export async function installPythonReqs( espMatterPath, pyPath, undefined, - OutputChannel.init(), cancelToken ); } diff --git a/src/extension.ts b/src/extension.ts index c294338aa..b2c6637dd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -71,7 +71,7 @@ import { ArduinoComponentInstaller } from "./espIdf/arduino/addArduinoComponent" import { PartitionTableEditorPanel } from "./espIdf/partition-table"; import { ESPEFuseTreeDataProvider } from "./efuse/view"; import { ESPEFuseManager } from "./efuse"; -import { constants, createFileSync, pathExists } from "fs-extra"; +import { constants, createFileSync, pathExists, readJson } from "fs-extra"; import { getEspAdf } from "./espAdf/espAdfDownload"; import { getEspMdf } from "./espMdf/espMdfDownload"; import { SetupPanel } from "./setup/SetupPanel"; @@ -150,6 +150,8 @@ import { CDTDebugConfigurationProvider } from "./cdtDebugAdapter/debugConfProvid import { CDTDebugAdapterDescriptorFactory } from "./cdtDebugAdapter/server"; import { IdfReconfigureTask } from "./espIdf/reconfigure/task"; import { ErrorHintProvider, HintHoverProvider } from "./espIdf/hints/index"; +import { installWebsocketClient } from "./espIdf/monitor/checkWebsocketClient"; +import { TroubleshootingPanel } from "./support/troubleshootPanel"; // Global variables shared by commands let workspaceRoot: vscode.Uri; @@ -1000,78 +1002,6 @@ export async function activate(context: vscode.ExtensionContext) { await clearPreviousIdfSetups(); }); - registerIDFCommand("espIdf.setPath", () => { - PreCheck.perform([webIdeCheck], async () => { - const selectFrameworkMsg = vscode.l10n.t( - "Select framework to define its path:" - ); - try { - const option = await vscode.window.showQuickPick( - [ - { - description: vscode.l10n.t("IDF_PATH Path"), - label: "IDF_PATH", - target: "esp", - }, - { - description: vscode.l10n.t("Set IDF_TOOLS_PATH Path"), - label: "IDF_TOOLS_PATH", - target: "idfTools", - }, - { - description: vscode.l10n.t("Set paths to append to PATH"), - label: "Custom extra paths", - target: "customExtraPath", - }, - ], - { placeHolder: selectFrameworkMsg } - ); - if (!option) { - const noOptionMsg = vscode.l10n.t("No option selected."); - Logger.infoNotify(noOptionMsg); - return; - } - let currentValue; - let msg: string; - let paramName: string; - switch (option.target) { - case "esp": - msg = vscode.l10n.t("Enter IDF_PATH Path"); - paramName = "idf.espIdfPath"; - break; - case "idfTools": - msg = vscode.l10n.t("Enter IDF_TOOLS_PATH path"); - paramName = "idf.toolsPath"; - break; - case "customExtraPath": - msg = vscode.l10n.t("Enter extra paths to append to PATH"); - paramName = "idf.customExtraPaths"; - break; - default: - const noPathUpdatedMsg = vscode.l10n.t("No path has been updated"); - Logger.infoNotify(noPathUpdatedMsg); - break; - } - if (msg && paramName) { - currentValue = idfConf.readParameter(paramName, workspaceRoot); - await idfConf.updateConfParameter( - paramName, - msg, - currentValue, - option.label, - workspaceRoot - ); - } - } catch (error) { - const errMsg = - error && error.message - ? error.message - : "Error at defining framework path."; - Logger.errorNotify(errMsg, error); - } - }); - }); - registerIDFCommand("espIdf.rmProjectConfStatusBar", async () => { if (statusBarItems["projectConf"]) { statusBarItems["projectConf"].dispose(); @@ -1175,92 +1105,6 @@ export async function activate(context: vscode.ExtensionContext) { }); }); - registerIDFCommand("espIdf.configDevice", async () => { - const selectConfigMsg = vscode.l10n.t("Select option to define its path:"); - try { - const option = await vscode.window.showQuickPick( - [ - { - description: "Target (IDF_TARGET)", - label: "Device Target", - target: "deviceTarget", - }, - { - description: "Serial port", - label: "Device Port", - target: "devicePort", - }, - { - description: "Flash baud rate", - label: "Flash Baud Rate", - target: "flashBaudRate", - }, - { - description: vscode.l10n.t( - "Relative paths to OpenOCD Scripts directory separated by comma(,)" - ), - label: "OpenOcd Config Files", - target: "openOcdConfig", - }, - ], - { placeHolder: selectConfigMsg } - ); - if (!option) { - const noOptionMsg = vscode.l10n.t("No option selected."); - Logger.infoNotify(noOptionMsg); - return; - } - let currentValue; - let msg: string; - let paramName: string; - switch (option.target) { - case "deviceTarget": - return vscode.commands.executeCommand("espIdf.setTarget"); - case "devicePort": - msg = vscode.l10n.t("Enter device port Path"); - paramName = "idf.port"; - break; - case "flashBaudRate": - msg = vscode.l10n.t("Enter flash baud rate"); - paramName = "idf.flashBaudRate"; - break; - case "monitorBaudRate": - msg = vscode.l10n.t("Enter monitor baud rate"); - paramName = "idf.monitorBaudRate"; - break; - case "openOcdConfig": - msg = vscode.l10n.t("Enter OpenOCD Configuration File Paths list"); - paramName = "idf.openOcdConfigs"; - break; - default: - const noParamUpdatedMsg = vscode.l10n.t( - "No device parameter has been updated" - ); - Logger.infoNotify(noParamUpdatedMsg); - break; - } - if (msg && paramName) { - currentValue = idfConf.readParameter(paramName, workspaceRoot); - if (currentValue instanceof Array) { - currentValue = currentValue.join(","); - } - await idfConf.updateConfParameter( - paramName, - msg, - currentValue, - option.label, - workspaceRoot - ); - } - } catch (error) { - const errMsg = - error && error.message - ? error.message - : "Error at device configuration."; - Logger.errorNotify(errMsg, error); - } - }); - vscode.workspace.onDidChangeConfiguration(async (e) => { const winFlag = process.platform === "win32" ? "Win" : ""; if (e.affectsConfiguration("idf.enableStatusBar")) { @@ -1276,15 +1120,6 @@ export async function activate(context: vscode.ExtensionContext) { statusBarItems[statusItem] = undefined; } } - } else if (e.affectsConfiguration("idf.openOcdConfigs")) { - const openOcdConfigFilesList = idfConf.readParameter( - "idf.openOcdConfigs", - workspaceRoot - ); - const openOCDConfig: IOpenOCDConfig = { - openOcdConfigFilesList, - } as IOpenOCDConfig; - openOCDManager.configureServer(openOCDConfig); } else if (e.affectsConfiguration("idf.adapterTargetName")) { let idfTarget = idfConf.readParameter( "idf.adapterTargetName", @@ -1301,7 +1136,7 @@ export async function activate(context: vscode.ExtensionContext) { } as IDebugAdapterConfig; debugAdapterManager.configureAdapter(debugAdapterConfig); if (statusBarItems && statusBarItems["target"]) { - statusBarItems["target"].text = "$(circuit-board) " + idfTarget; + statusBarItems["target"].text = "$(chip) " + idfTarget; } } else if (e.affectsConfiguration("idf.espIdfPath" + winFlag)) { ESP.URL.Docs.IDF_INDEX = undefined; @@ -1329,27 +1164,9 @@ export async function activate(context: vscode.ExtensionContext) { } as IDebugAdapterConfig; debugAdapterManager.configureAdapter(debugAdapterConfig); if (statusBarItems && statusBarItems["target"]) { - statusBarItems["target"].text = "$(circuit-board) " + idfTarget; + statusBarItems["target"].text = "$(chip) " + idfTarget; } } - } else if (e.affectsConfiguration("openocd.tcl.host")) { - const tclHost = idfConf.readParameter( - "openocd.tcl.host", - workspaceRoot - ) as string; - const openOCDConfig: IOpenOCDConfig = { - host: tclHost, - } as IOpenOCDConfig; - openOCDManager.configureServer(openOCDConfig); - } else if (e.affectsConfiguration("openocd.tcl.port")) { - const tclPort = idfConf.readParameter( - "openocd.tcl.port", - workspaceRoot - ) as number; - const openOCDConfig: IOpenOCDConfig = { - port: tclPort, - } as IOpenOCDConfig; - openOCDManager.configureServer(openOCDConfig); } else if (e.affectsConfiguration("idf.flashType")) { let flashType = idfConf.readParameter( "idf.flashType", @@ -1503,7 +1320,21 @@ export async function activate(context: vscode.ExtensionContext) { registerIDFCommand("espIdf.genCoverage", () => { return PreCheck.perform([openFolderCheck], async () => { - await covRenderer.renderCoverage(); + try { + await covRenderer.renderCoverage(); + } catch (e) { + const msg = e && e.message ? e.message : e; + Logger.errorNotify( + "Error building gcov data from gcda files.\nCheck the ESP-IDF output for more details.", + e + ); + OutputChannel.appendLine( + msg + + "\nError building gcov data from gcda files.\n\n" + + "Review the code coverage tutorial https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/code_coverage.md \n" + + "or ESP-IDF documentation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#gcov-source-code-coverage \n" + ); + } }); }); @@ -1625,8 +1456,7 @@ export async function activate(context: vscode.ExtensionContext) { pyPath, espIdfPath, toolsPath, - undefined, - OutputChannel.init() + undefined ); vscode.window.showInformationMessage( vscode.l10n.t("ESP-IDF Python Requirements has been installed") @@ -1706,7 +1536,6 @@ export async function activate(context: vscode.ExtensionContext) { espMatterPath, pyPath, undefined, - OutputChannel.init(), cancelToken ); @@ -1922,6 +1751,15 @@ export async function activate(context: vscode.ExtensionContext) { ConfserverProcess.loadExistingInstance(); return; } + const isIdfProject = utils.checkIsProjectCmakeLists( + workspaceRoot.fsPath + ); + if (!isIdfProject) { + Logger.infoNotify( + vscode.l10n.t("The current directory is not an ESP-IDF project.") + ); + return; + } const notificationMode = idfConf.readParameter( "idf.notificationMode", workspaceRoot @@ -2001,7 +1839,10 @@ export async function activate(context: vscode.ExtensionContext) { const enterDeviceTargetMsg = vscode.l10n.t( "Enter target name (IDF_TARGET)" ); - await setIdfTarget(enterDeviceTargetMsg); + const workspaceFolder = vscode.workspace.getWorkspaceFolder( + workspaceRoot + ); + await setIdfTarget(enterDeviceTargetMsg, workspaceFolder); }); }); @@ -2241,7 +2082,7 @@ export async function activate(context: vscode.ExtensionContext) { workspaceRoot ) as string; } - const boards = await getBoards(idfTarget, openOcdScriptsPath); + const boards = await getBoards(openOcdScriptsPath, idfTarget); const choices = boards.map((b) => { return { description: `${b.description} (${b.configFiles})`, @@ -2759,12 +2600,62 @@ export async function activate(context: vscode.ExtensionContext) { ); const reportOutput = await writeTextReport(reportedResult, context); await vscode.env.clipboard.writeText(reportOutput); + await vscode.window.showTextDocument( + vscode.Uri.file(path.join(context.extensionPath, "report.txt")) + ); return reportedResult; } } ); }); + registerIDFCommand("espIdf.troubleshootPanel", async () => { + TroubleshootingPanel.createOrShow(context, workspaceRoot); + }); + + registerIDFCommand("espIdf.debug", async () => { + PreCheck.perform([openFolderCheck], async () => { + const workspaceFolder = vscode.workspace.getWorkspaceFolder( + workspaceRoot + ); + const launchJsonPath = path.join( + workspaceRoot.fsPath, + ".vscode", + "launch.json" + ); + const launchJsonPathExist = await pathExists(launchJsonPath); + if (!launchJsonPathExist) { + await vscode.window.showInformationMessage( + vscode.l10n.t( + `No launch.json found. + Use the ESP-IDF: Add vscode Configuration Folder command.` + ) + ); + return; + } + const launchJson = await readJson(launchJsonPath); + if ( + launchJson && + launchJson.configurations && + launchJson.configurations.length + ) { + for (const conf of launchJson.configurations) { + if (conf.type === "gdbtarget") { + await vscode.debug.startDebugging(workspaceFolder, conf.name); + return; + } + } + } + await vscode.window.showInformationMessage( + vscode.l10n.t( + `No gdbtarget configuration found in launch.json. + Delete launch.json and use the ESP-IDF: Add vscode Configuration Folder' command.` + ) + ); + return; + }); + }); + registerIDFCommand( "espIdf.apptrace.archive.showReport", (trace: AppTraceArchiveItems) => { @@ -3097,6 +2988,7 @@ export async function activate(context: vscode.ExtensionContext) { new Error(idfMonitorToolPath + " is not defined") ); } + await installWebsocketClient(workspaceRoot); const buildDirPath = idfConf.readParameter( "idf.buildPath", workspaceRoot @@ -3859,7 +3751,7 @@ async function createCmdsStatusBarItems() { workspaceRoot ); } - let currentIdfVersion = await getCurrentIdfSetup(workspaceRoot); + let currentIdfVersion = await getCurrentIdfSetup(workspaceRoot, false); const statusBarItems: { [key: string]: vscode.StatusBarItem } = {}; statusBarItems["currentIdfVersion"] = createStatusBarItem( @@ -3886,7 +3778,7 @@ async function createCmdsStatusBarItems() { } statusBarItems["target"] = createStatusBarItem( - "$(circuit-board) " + idfTarget, + "$(chip) " + idfTarget, vscode.l10n.t("ESP-IDF: Set Espressif Device Target"), "espIdf.setTarget", 99 @@ -3910,7 +3802,7 @@ async function createCmdsStatusBarItems() { 96 ); statusBarItems["build"] = createStatusBarItem( - "$(database)", + "$(symbol-property)", vscode.l10n.t("ESP-IDF: Build Project"), "espIdf.buildDevice", 95 @@ -3933,23 +3825,29 @@ async function createCmdsStatusBarItems() { "espIdf.monitorDevice", 92 ); + statusBarItems["debug"] = createStatusBarItem( + "$(debug-alt)", + vscode.l10n.t("ESP-IDF: Debug"), + "espIdf.debug", + 91 + ); statusBarItems["buildFlashMonitor"] = createStatusBarItem( "$(flame)", vscode.l10n.t("ESP-IDF: Build, Flash and Monitor"), "espIdf.buildFlashMonitor", - 91 + 90 ); statusBarItems["terminal"] = createStatusBarItem( "$(terminal)", vscode.l10n.t("ESP-IDF: Open ESP-IDF Terminal"), "espIdf.createIdfTerminal", - 90 + 89 ); statusBarItems["espIdf.customTask"] = createStatusBarItem( "$(diff-renamed)", vscode.l10n.t("ESP-IDF: Execute Custom Task"), "espIdf.customTask", - 89 + 88 ); return statusBarItems; } diff --git a/src/idfToolsManager.ts b/src/idfToolsManager.ts index 227f4ad20..ea7abd1b9 100644 --- a/src/idfToolsManager.ts +++ b/src/idfToolsManager.ts @@ -221,7 +221,7 @@ export class IdfToolsManager { ) { modifiedEnv[pathNameInEnv] = modifiedPath; } - if (pkg.version_cmd.length === 0) { + if (pkg.version_cmd.length === 0 || !pkg.version_cmd[0]) { return "No command version"; } const command = pkg.version_cmd[0]; diff --git a/src/installManager.ts b/src/installManager.ts index e1a9ef063..d9c6e1d41 100644 --- a/src/installManager.ts +++ b/src/installManager.ts @@ -437,14 +437,11 @@ export class InstallManager { pkg: IPackage, cancelToken?: vscode.CancellationToken ) { - const versionToUse = idfToolsManager.getVersionToUse(pkg); return installEspIdfToolFromIdf( idfToolsManager.espIdfPath, pythonBinPath, this.installPath, pkg.name, - versionToUse, - OutputChannel.init(), cancelToken ); } diff --git a/src/newProject/newProjectInit.ts b/src/newProject/newProjectInit.ts index af7138767..de3d5cb0e 100644 --- a/src/newProject/newProjectInit.ts +++ b/src/newProject/newProjectInit.ts @@ -29,7 +29,9 @@ export interface INewProjectArgs { espIdfPath: string; espAdfPath: string; espMdfPath: string; + espMatterPath: string; espHomeKitSdkPath: string; + espRainmakerPath: string; boards: IdfBoard[]; components: IComponent[]; serialPortList: string[]; @@ -41,7 +43,7 @@ export interface INewProjectArgs { export async function getNewProjectArgs( extensionPath: string, progress: Progress<{ message: string; increment: number }>, - workspace: Uri, + workspace: Uri ) { progress.report({ increment: 10, message: "Loading ESP-IDF components..." }); const components = []; @@ -65,7 +67,6 @@ export async function getNewProjectArgs( const espBoards = await getBoards(openOcdScriptsPath); progress.report({ increment: 10, message: "Loading ESP-IDF Target list..." }); const targetList = defaultBoards; - progress.report({ increment: 10, message: "Loading ESP-IDF Target list..." }); const espIdfPath = idfConf.readParameter( "idf.espIdfPath", workspace @@ -78,10 +79,18 @@ export async function getNewProjectArgs( "idf.espMdfPath", workspace ) as string; + const espMatterPath = idfConf.readParameter( + "idf.espMatterPath", + workspace + ) as string; const espHomeKitSdkPath = idfConf.readParameter( "idf.espHomeKitSdkPath", workspace ) as string; + const espRainmakerPath = idfConf.readParameter( + "idf.espRainmakerPath", + workspace + ) as string; let templates: { [key: string]: IExampleCategory } = {}; templates["Extension"] = getExamplesList(extensionPath, "templates"); const idfExists = await dirExistPromise(espIdfPath); @@ -94,6 +103,16 @@ export async function getNewProjectArgs( const adfTemplates = getExamplesList(espAdfPath); templates["ESP-ADF"] = adfTemplates; } + const rainmakerExists = await dirExistPromise(espRainmakerPath); + if (rainmakerExists) { + const rainmakerTemplates = getExamplesList(espRainmakerPath); + templates["ESP-RAINMAKER"] = rainmakerTemplates; + } + const matterExists = await dirExistPromise(espMatterPath); + if (matterExists) { + const matterTemplates = getExamplesList(espMatterPath); + templates["ESP-MATTER"] = matterTemplates; + } const mdfExists = await dirExistPromise(espMdfPath); if (mdfExists) { const mdfTemplates = getExamplesList(espMdfPath); @@ -111,7 +130,9 @@ export async function getNewProjectArgs( espAdfPath: adfExists ? espAdfPath : undefined, espIdfPath: idfExists ? espIdfPath : undefined, espMdfPath: mdfExists ? espMdfPath : undefined, - espHomeKitSdkPath: homekitSdkExists ? espHomeKitSdkPath: undefined, + espMatterPath: matterExists ? espMatterPath : undefined, + espHomeKitSdkPath: homekitSdkExists ? espHomeKitSdkPath : undefined, + espRainmakerPath: rainmakerExists ? espRainmakerPath : undefined, serialPortList, targetList, templates, diff --git a/src/newProject/newProjectPanel.ts b/src/newProject/newProjectPanel.ts index ae060397f..dba8f68eb 100644 --- a/src/newProject/newProjectPanel.ts +++ b/src/newProject/newProjectPanel.ts @@ -76,6 +76,12 @@ export class NewProjectPanel { if (newProjectArgs.espMdfPath) { localResourceRoots.push(vscode.Uri.file(newProjectArgs.espMdfPath)); } + if (newProjectArgs.espMatterPath) { + localResourceRoots.push(vscode.Uri.file(newProjectArgs.espMatterPath)); + } + if (newProjectArgs.espRainmakerPath) { + localResourceRoots.push(vscode.Uri.file(newProjectArgs.espRainmakerPath)); + } if (newProjectArgs.espHomeKitSdkPath) { localResourceRoots.push( vscode.Uri.file(newProjectArgs.espHomeKitSdkPath) @@ -112,7 +118,6 @@ export class NewProjectPanel { if ( message.components && message.containerFolder && - message.openOcdConfigFiles && message.port && message.projectName && message.target && @@ -121,11 +126,11 @@ export class NewProjectPanel { this.createProject( JSON.parse(message.components), message.target, - message.openOcdConfigFiles, message.port, message.containerFolder, message.projectName, JSON.parse(message.template), + message.openOcdConfigFiles, newProjectArgs.workspaceFolder ); } @@ -198,11 +203,11 @@ export class NewProjectPanel { private async createProject( components: IComponent[], idfTarget: string, - openOcdConfigs: string, port: string, projectDirectory: string, projectName: string, template: IExample, + openOcdConfigs?: string, workspaceFolder?: vscode.Uri ) { const newProjectPath = path.join(projectDirectory, projectName); @@ -284,8 +289,8 @@ export class NewProjectPanel { const settingsJson = await setCurrentSettingsInTemplate( settingsJsonPath, idfTarget, - openOcdConfigs, port, + openOcdConfigs, workspaceFolder ); await writeJSON(settingsJsonPath, settingsJson, { diff --git a/src/newProject/utils.ts b/src/newProject/utils.ts index 29cd0e5da..68856b351 100644 --- a/src/newProject/utils.ts +++ b/src/newProject/utils.ts @@ -23,8 +23,8 @@ import { Uri } from "vscode"; export async function setCurrentSettingsInTemplate( settingsJsonPath: string, idfTarget: string, - openOcdConfigs: string, port: string, + openOcdConfigs?: string, workspace?: Uri ) { const settingsJson = await readJSON(settingsJsonPath); @@ -52,10 +52,12 @@ export async function setCurrentSettingsInTemplate( if (mdfPathDir) { settingsJson["idf.espMdfPath" + isWin] = mdfPathDir; } - settingsJson["idf.openOcdConfigs"] = - openOcdConfigs.indexOf(",") !== -1 - ? openOcdConfigs.split(",") - : [openOcdConfigs]; + if (openOcdConfigs) { + settingsJson["idf.openOcdConfigs"] = + openOcdConfigs.indexOf(",") !== -1 + ? openOcdConfigs.split(",") + : [openOcdConfigs]; + } if (port.indexOf("no port") === -1) { settingsJson["idf.port" + isWin] = port; } diff --git a/src/pythonManager.ts b/src/pythonManager.ts index b1a8a3350..482a26910 100644 --- a/src/pythonManager.ts +++ b/src/pythonManager.ts @@ -13,19 +13,18 @@ // limitations under the License. import { PyReqLog } from "./PyReqLog"; -import { CancellationToken, ExtensionContext, OutputChannel } from "vscode"; +import { CancellationToken, ExtensionContext } from "vscode"; import * as utils from "./utils"; import { constants, pathExists } from "fs-extra"; import { Logger } from "./logger/logger"; import { delimiter, dirname, join, sep } from "path"; +import { OutputChannel } from "./logger/outputChannel"; export async function installEspIdfToolFromIdf( espDir: string, pythonBinPath: string, idfToolsPath: string, toolName: string, - toolVersion: string, - channel?: OutputChannel, cancelToken?: CancellationToken ) { const idfToolsPyPath = join(espDir, "tools", "idf_tools.py"); @@ -44,13 +43,11 @@ export async function installEspIdfToolFromIdf( pythonBinPath, args, idfToolsPath, - channel, + OutputChannel.init(), { cwd: idfToolsPath, env: modifiedEnv }, cancelToken ); - if (channel) { - channel.appendLine(processResult); - } + OutputChannel.appendLine(processResult); return resolve(); } catch (error) { return reject(error); @@ -65,7 +62,6 @@ export async function installPythonEnvFromIdfTools( pythonBinPath: string, gitPath: string, context: ExtensionContext, - channel?: OutputChannel, cancelToken?: CancellationToken ) { const idfToolsPyPath = join(espDir, "tools", "idf_tools.py"); @@ -105,10 +101,8 @@ export async function installPythonEnvFromIdfTools( await execProcessWithLog( pythonBinPath, [idfToolsPyPath, "install-python-env"], - idfToolsDir, pyTracker, - channel, - { env: modifiedEnv }, + { env: modifiedEnv, cwd: idfToolsDir }, cancelToken ); @@ -125,8 +119,7 @@ export async function installExtensionPyReqs( espDir: string, idfToolsDir: string, pyTracker?: PyReqLog, - channel?: OutputChannel, - opts?: { env: NodeJS.ProcessEnv; cwd?: string }, + opts?: { env: NodeJS.ProcessEnv; cwd: string }, cancelToken?: CancellationToken ) { const reqDoesNotExists = " doesn't exist. Make sure the path is correct."; @@ -137,9 +130,7 @@ export async function installExtensionPyReqs( ); if (!utils.canAccessFile(debugAdapterRequirements, constants.R_OK)) { Logger.warnNotify(debugAdapterRequirements + reqDoesNotExists); - if (channel) { - channel.appendLine(debugAdapterRequirements + reqDoesNotExists); - } + OutputChannel.appendLine(debugAdapterRequirements + reqDoesNotExists); return; } const espIdfVersion = await utils.getEspIdfFromCMake(espDir); @@ -168,9 +159,7 @@ export async function installExtensionPyReqs( if (pyTracker) { pyTracker.Log = installDAPyPkgsMsg; } - if (channel) { - channel.appendLine(installDAPyPkgsMsg + "\n"); - } + OutputChannel.appendLine(installDAPyPkgsMsg + "\n"); const args = [ "-m", "pip", @@ -180,13 +169,13 @@ export async function installExtensionPyReqs( "--no-warn-script-location", "-r", debugAdapterRequirements, + "--extra-index-url", + "https://dl.espressif.com/pypi", ]; await execProcessWithLog( virtualEnvPython, args, - idfToolsDir, pyTracker, - channel, opts, cancelToken ); @@ -198,13 +187,12 @@ export async function installEspMatterPyReqs( espMatterDir: string, pythonBinPath: string, pyTracker?: PyReqLog, - channel?: OutputChannel, cancelToken?: CancellationToken ) { const modifiedEnv: { [key: string]: string } = <{ [key: string]: string }>( Object.assign({}, process.env) ); - const opts = { env: modifiedEnv }; + const opts = { env: modifiedEnv, cwd: idfToolsDir }; const pyEnvPath = await getPythonEnvPath(espDir, idfToolsDir, pythonBinPath); const pyDir = process.platform === "win32" @@ -216,9 +204,7 @@ export async function installEspMatterPyReqs( const matterRequirements = join(espMatterDir, "requirements.txt"); if (!utils.canAccessFile(matterRequirements, constants.R_OK)) { Logger.warnNotify(matterRequirements + reqDoesNotExists); - if (channel) { - channel.appendLine(matterRequirements + reqDoesNotExists); - } + OutputChannel.appendLine(matterRequirements + reqDoesNotExists); throw new Error(); } const installMatterPyPkgsMsg = `Installing ESP-Matter python packages in ${virtualEnvPython} ...\n`; @@ -226,9 +212,7 @@ export async function installEspMatterPyReqs( if (pyTracker) { pyTracker.Log = installMatterPyPkgsMsg; } - if (channel) { - channel.appendLine(installMatterPyPkgsMsg + "\n"); - } + OutputChannel.appendLine(installMatterPyPkgsMsg + "\n"); const args = [ "-m", "pip", @@ -237,13 +221,13 @@ export async function installEspMatterPyReqs( "--no-warn-script-location", "-r", matterRequirements, + "--extra-index-url", + "https://dl.espressif.com/pypi", ]; await execProcessWithLog( virtualEnvPython, args, - idfToolsDir, pyTracker, - channel, opts, cancelToken ); @@ -252,27 +236,23 @@ export async function installEspMatterPyReqs( export async function execProcessWithLog( cmd: string, args: string[], - workDir: string, pyTracker?: PyReqLog, - channel?: OutputChannel, - opts?: { env: NodeJS.ProcessEnv }, + opts?: { env: NodeJS.ProcessEnv; cwd: string }, cancelToken?: CancellationToken ) { - const processResult = await utils.execChildProcess( + const processResult = await utils.spawn( cmd, args, - workDir, - channel, opts, - cancelToken + undefined, + undefined, + cancelToken, + pyTracker.Log ); Logger.info(processResult + "\n"); if (pyTracker) { pyTracker.Log = processResult + "\n"; } - if (channel) { - channel.appendLine(processResult + "\n"); - } } export async function getPythonEnvPath( diff --git a/src/rainmaker/download/espRainmakerDownload.ts b/src/rainmaker/download/espRainmakerDownload.ts index f3fb3c564..522f58799 100644 --- a/src/rainmaker/download/espRainmakerDownload.ts +++ b/src/rainmaker/download/espRainmakerDownload.ts @@ -26,7 +26,8 @@ export class RainmakerCloning extends AbstractCloning { "https://github.com/espressif/esp-rainmaker.git", "ESP-RAINMAKER", "master", - gitBinPath + gitBinPath, + "https://gitee.com/EspressifSystems/esp-rainmaker.git" ); } } diff --git a/src/setup/SetupPanel.ts b/src/setup/SetupPanel.ts index 981923042..39367db88 100644 --- a/src/setup/SetupPanel.ts +++ b/src/setup/SetupPanel.ts @@ -216,6 +216,7 @@ export class SetupPanel { const pathSep = path.sep; this.panel.webview.postMessage({ command: "initialLoad", + downloadMirror: setupArgs.downloadMirror, espIdfContainer: defaultEspIdfPathContainer, espIdf: setupArgs.espIdfPath, extensionVersion: setupArgs.extensionVersion, @@ -333,11 +334,12 @@ export class SetupPanel { } setupErrHandler(error: Error) { - const errMsg = error.message ? error.message : "Error during ESP-IDF setup"; + const errMsg = error && error.message ? error.message : "Error during ESP-IDF setup"; if ( errMsg.indexOf("ERROR_EXISTING_ESP_IDF") !== -1 || errMsg.indexOf("IDF_PATH_WITH_SPACES") !== -1 || - errMsg.indexOf("IDF_TOOLS_PATH_WITH_SPACES") !== -1 + errMsg.indexOf("IDF_TOOLS_PATH_WITH_SPACES") !== -1 || + errMsg.indexOf("ERROR_SAME_IDF_PATH_AND__IDF_TOOLS_PATH") !== -1 ) { SetupPanel.postMessage({ command: "setEspIdfErrorStatus", @@ -436,13 +438,16 @@ export class SetupPanel { idfGitPath = embedPaths.idfGitPath; idfPythonPath = embedPaths.idfPythonPath; } - const pathToCheck = + const idfPathToCheck = selectedIdfVersion.filename === "manual" ? espIdfPath : idfContainerPath; - this.checkSpacesInPaths( - toolsPath, - ); + this.checkSpacesInPaths(toolsPath); + + if (idfPathToCheck === toolsPath) { + const idfPathSameIdfToolsPathMsg = `IDF_PATH and IDF_TOOLS_PATH can't be the same. Please use another location. (ERROR_SAME_IDF_PATH_AND__IDF_TOOLS_PATH)`; + throw new Error(idfPathSameIdfToolsPathMsg); + } await expressInstall( selectedIdfVersion, idfPythonPath, @@ -572,14 +577,12 @@ export class SetupPanel { idfGitPath = embedPaths.idfGitPath; idfPythonPath = embedPaths.idfPythonPath; } - this.checkSpacesInPaths( - toolsPath, - ); + this.checkSpacesInPaths(toolsPath); await downloadIdfTools( idfPath, toolsPath, - pyPath, - gitPath, + idfPythonPath, + idfGitPath, mirror, saveScope, workspaceFolderUri, @@ -696,9 +699,7 @@ export class SetupPanel { } } - private checkSpacesInPaths( - idfToolsPath: string, - ) { + private checkSpacesInPaths(idfToolsPath: string) { const doesIdfToolsPathHasSpaces = checkSpacesInPath(idfToolsPath); let pathHasSpaces = ""; if (doesIdfToolsPathHasSpaces) { diff --git a/src/setup/installPyReqs.ts b/src/setup/installPyReqs.ts index 1e714a1fe..7464a36fc 100644 --- a/src/setup/installPyReqs.ts +++ b/src/setup/installPyReqs.ts @@ -79,7 +79,6 @@ export async function installPyReqs( sysPyBinPath, gitPath, context, - OutputChannel.init(), cancelToken ); if (virtualEnvPyBin) { diff --git a/src/setup/setupInit.ts b/src/setup/setupInit.ts index beb4e94d3..cecb3e3b8 100644 --- a/src/setup/setupInit.ts +++ b/src/setup/setupInit.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ConfigurationTarget, Progress, StatusBarItem, Uri } from "vscode"; +import { ConfigurationTarget, Progress, StatusBarItem, Uri, env } from "vscode"; import { IdfToolsManager } from "../idfToolsManager"; import * as utils from "../utils"; import { getEspIdfTags, getEspIdfVersions } from "./espIdfVersionList"; -import { IdfSetup, IEspIdfLink } from "../views/setup/types"; +import { IdfMirror, IdfSetup, IEspIdfLink } from "../views/setup/types"; import { getPythonList } from "./installPyReqs"; import { pathExists } from "fs-extra"; import path from "path"; @@ -33,6 +33,7 @@ import { packageJson } from "../utils"; import { getCurrentIdfSetup } from "../versionSwitcher"; export interface ISetupInitArgs { + downloadMirror: IdfMirror; espIdfPath: string; espToolsPath: string; existingIdfSetups: IdfSetup[]; @@ -134,7 +135,13 @@ export async function getSetupInitialValues( const idfSetups = await getPreviousIdfSetups(false); const extensionVersion = packageJson.version as string; const saveScope = idfConf.readParameter("idf.saveScope") as number; + const initialDownloadMirror = + env.language.toLowerCase().indexOf("zh-cn") !== -1 || + env.language.toLowerCase().indexOf("zh-tw") !== -1 + ? IdfMirror.Espressif + : IdfMirror.Github; const setupInitArgs = { + downloadMirror: initialDownloadMirror, espIdfVersionsList, espIdfTagsList, extensionVersion, diff --git a/src/support/troubleshootPanel.ts b/src/support/troubleshootPanel.ts new file mode 100644 index 000000000..ad8963b2d --- /dev/null +++ b/src/support/troubleshootPanel.ts @@ -0,0 +1,206 @@ +/* + * Project: ESP-IDF VSCode Extension + * File Created: Friday, 14th June 2024 5:13:57 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 { join } from "path"; +import { + Disposable, + ExtensionContext, + Progress, + ProgressLocation, + Uri, + ViewColumn, + WebviewPanel, + env, + l10n, + window, +} from "vscode"; +import { NotificationMode, readParameter } from "../idfConfiguration"; +import { initializeReportObject } from "./initReportObj"; +import { generateConfigurationReport } from "."; +import { Logger } from "../logger/logger"; +import { writeTextReport } from "./writeReport"; +import { EOL } from "os"; +import { Telemetry } from "../telemetry"; + +export class TroubleshootingPanel { + public static currentPanel: TroubleshootingPanel | undefined; + + public static createOrShow(context: ExtensionContext, workspace: Uri) { + const column = window.activeTextEditor + ? window.activeTextEditor.viewColumn + : ViewColumn.One; + if (TroubleshootingPanel.currentPanel) { + TroubleshootingPanel.currentPanel.panel.reveal(column); + } else { + TroubleshootingPanel.currentPanel = new TroubleshootingPanel( + workspace, + context, + column + ); + } + } + + public static isCreatedAndHidden() { + return ( + TroubleshootingPanel.currentPanel && + TroubleshootingPanel.currentPanel.panel.visible === false + ); + } + + private static readonly viewType = "TroubleshootingPanel"; + private readonly panel: WebviewPanel; + private disposables: Disposable[] = []; + + constructor(workspace: Uri, context: ExtensionContext, column: ViewColumn) { + const welcomePanelTitle = l10n.t("ESP-IDF Troubleshooting Form"); + + this.panel = window.createWebviewPanel( + TroubleshootingPanel.viewType, + welcomePanelTitle, + column, + { + enableScripts: true, + retainContextWhenHidden: true, + localResourceRoots: [ + Uri.file(join(context.extensionPath, "dist", "views")), + ], + } + ); + + this.panel.iconPath = Uri.file( + join(context.extensionPath, "media", "espressif_icon.png") + ); + + const scriptPath = this.panel.webview.asWebviewUri( + Uri.file( + join(context.extensionPath, "dist", "views", "troubleshoot-bundle.js") + ) + ); + + this.panel.webview.html = this.createTroubleshootPageHtml(scriptPath); + + this.panel.webview.onDidReceiveMessage(async (msg) => { + switch (msg.command) { + case "sendForm": + if (msg.title && msg.stepsToReproduce && msg.description) { + await this.createTroubleshootingReport( + msg.title, + msg.description, + msg.stepsToReproduce, + workspace, + context + ); + } + break; + default: + break; + } + }); + + this.panel.onDidDispose(() => this.dispose(), null, this.disposables); + } + + private async createTroubleshootingReport( + title: string, + description: string, + stepsToReproduce: string, + workspace: Uri, + context: ExtensionContext + ) { + let troubleshootOutput = `---------------------------------------------- ESP-IDF Troubleshoot report -----------------------------------------------------------------${EOL}`; + const lineBreak = `--------------------------------------------------------------------------------------------------------------------------------------------${EOL}`; + troubleshootOutput += `Title: ${title} ${EOL}`; + troubleshootOutput += lineBreak; + troubleshootOutput += `Description:${EOL} ${description} ${EOL}`; + troubleshootOutput += lineBreak; + troubleshootOutput += `Steps to Reproduce:${EOL} ${stepsToReproduce} ${EOL}`; + const notificationMode = readParameter( + "idf.notificationMode", + workspace + ) as string; + const progressLoc = + notificationMode === NotificationMode.All || + notificationMode === NotificationMode.Notifications + ? ProgressLocation.Notification + : ProgressLocation.Window; + await window.withProgress( + { + cancellable: false, + location: progressLoc, + title: l10n.t("ESP-IDF: Preparing ESP-IDF extension report"), + }, + async (progress: Progress<{ message: string; increment: number }>) => { + const reportedResult = initializeReportObject(); + try { + await generateConfigurationReport(context, workspace, reportedResult); + const reportOutput = await writeTextReport(reportedResult, context); + troubleshootOutput += reportOutput; + await env.clipboard.writeText(troubleshootOutput); + Telemetry.sendEvent("UserTroubleshootReport", { + title, + description, + stepsToReproduce, + report: reportOutput, + }); + Logger.infoNotify( + l10n.t("ESP-IDF Troubleshoot Report has been generated.") + ); + } catch (error) { + reportedResult.latestError = error; + const errMsg = error.message + ? error.message + : "Configuration report error"; + Logger.error(errMsg, error); + Logger.warnNotify( + l10n.t( + "Extension configuration report has been copied to clipboard with errors" + ) + ); + const reportOutput = await writeTextReport(reportedResult, context); + troubleshootOutput += reportOutput; + await env.clipboard.writeText(troubleshootOutput); + Telemetry.sendEvent("UserTroubleshootReport", { + title, + description, + stepsToReproduce, + report: reportOutput, + }); + } + } + ); + } + + private createTroubleshootPageHtml(scriptsPath: Uri): string { + return ` + + + + + ESP-IDF Troubleshoot Form + + +
+ + + `; + } + + public dispose() { + TroubleshootingPanel.currentPanel = undefined; + this.panel.dispose(); + } +} diff --git a/src/support/writeReport.ts b/src/support/writeReport.ts index 22bcda505..a0375c1c1 100644 --- a/src/support/writeReport.ts +++ b/src/support/writeReport.ts @@ -230,7 +230,6 @@ export function replaceUserPath(report: reportObj): reportObj { re = new RegExp(result, "g"); } const parsedReport = strReport.replace(re, ""); - Logger.warnNotify(parsedReport, { tag: "DOCTOR COMMAND" }); return JSON.parse(parsedReport); } diff --git a/src/test/oocdBoards.test.ts b/src/test/oocdBoards.test.ts index 492f2e893..5a230c3dc 100644 --- a/src/test/oocdBoards.test.ts +++ b/src/test/oocdBoards.test.ts @@ -2,13 +2,13 @@ * Project: ESP-IDF VSCode Extension * File Created: Thursday, 24th June 2021 4:20:56 pm * Copyright 2021 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. @@ -28,7 +28,10 @@ suite("OpenOCD Board tests", () => { setup(async () => { try { - const openOcdEspConfigJsonPath = join(openOcdScriptsPath, "esp-config.json"); + const openOcdEspConfigJsonPath = join( + openOcdScriptsPath, + "esp-config.json" + ); boardJsonObj = await readJSON(openOcdEspConfigJsonPath); } catch (error) { console.log(error); @@ -44,11 +47,17 @@ suite("OpenOCD Board tests", () => { }); test("OpenOCD Boards method", async () => { - const boards = await getBoards(boardJsonObj.boards[0].target, openOcdScriptsPath); + const boards = await getBoards( + openOcdScriptsPath, + boardJsonObj.boards[0].target + ); assert.equal(boards[0].name, boardJsonObj.boards[0].name); assert.equal(boards[0].description, boardJsonObj.boards[0].description); assert.equal(boards[0].target, boardJsonObj.boards[0].target); - assert.deepEqual(boards[0].configFiles, boardJsonObj.boards[0].config_files); + assert.deepEqual( + boards[0].configFiles, + boardJsonObj.boards[0].config_files + ); }); test("Check default boards", async () => { diff --git a/src/test/project.test.ts b/src/test/project.test.ts index 7170b6da7..60eb42be7 100644 --- a/src/test/project.test.ts +++ b/src/test/project.test.ts @@ -152,8 +152,8 @@ suite("Project tests", () => { const newSettingsJson = await setCurrentSettingsInTemplate( settingsJsonPath, "esp32", - openOcdConfigs, "no port", + openOcdConfigs, Uri.file(projectPath) ); assert.equal(newSettingsJson["idf.espIdfPath"], process.env.IDF_PATH); diff --git a/src/utils.ts b/src/utils.ts index 993b4b325..3364895f2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -129,12 +129,16 @@ export function spawn( command: string, args: string[] = [], options: any = {}, - timeout: number = 0 + timeout: number = 0, + silent: boolean = false, // this switches the output to console off the output is only returned, not printed, + cancelToken?: vscode.CancellationToken, + outputString?: string ): Promise { let buff = Buffer.alloc(0); const sendToOutputChannel = (data: Buffer) => { buff = Buffer.concat([buff, data]); - OutputChannel.appendLine(data.toString()); + outputString += buff.toString(); + !silent && OutputChannel.appendLine(data.toString()); }; return new Promise((resolve, reject) => { options.cwd = options.cwd || path.resolve(path.join(__dirname, "..")); @@ -146,6 +150,12 @@ export function spawn( }, timeout); } + if (cancelToken) { + cancelToken.onCancellationRequested((e) => { + child.kill(); + }); + } + child.stdout.on("data", sendToOutputChannel); child.stderr.on("data", sendToOutputChannel); @@ -525,7 +535,10 @@ export function execChildProcess( } if (stderr && stderr.length > 0) { message += stderr; - if (stderr.includes("Error")) { + if ( + !stderr.toLowerCase().startsWith("warning") && + stderr.includes("Error") + ) { err = true; } } @@ -547,7 +560,10 @@ export function execChildProcess( } if (stderr && stderr.length > 2) { Logger.error(stderr, new Error(stderr)); - if (stderr.includes("Error")) { + if ( + !stderr.toLowerCase().startsWith("warning") && + stderr.includes("Error") + ) { return reject(new Error(stderr)); } } @@ -1009,16 +1025,10 @@ export function appendIdfAndToolsToPath(curWorkspace: vscode.Uri) { } let IDF_ADD_PATHS_EXTRAS = path.join( - modifiedEnv.IDF_PATH, - "components", - "esptool_py", - "esptool" - ); - IDF_ADD_PATHS_EXTRAS = `${IDF_ADD_PATHS_EXTRAS}${path.delimiter}${path.join( modifiedEnv.IDF_PATH, "components", "espcoredump" - )}`; + ); IDF_ADD_PATHS_EXTRAS = `${IDF_ADD_PATHS_EXTRAS}${path.delimiter}${path.join( modifiedEnv.IDF_PATH, "components", diff --git a/src/versionSwitcher/index.ts b/src/versionSwitcher/index.ts index 2101e0f1d..03e345604 100644 --- a/src/versionSwitcher/index.ts +++ b/src/versionSwitcher/index.ts @@ -60,7 +60,8 @@ export async function selectIdfSetup( return selectedIdfSetupOption.target; } -export async function getCurrentIdfSetup(workspaceFolder: Uri) { +export async function getCurrentIdfSetup(workspaceFolder: Uri, + logToChannel: boolean = true) { const idfPath = readParameter("idf.espIdfPath", workspaceFolder); const toolsPath = readParameter("idf.toolsPath", workspaceFolder) as string; const gitPath = readParameter("idf.gitPath", workspaceFolder); @@ -80,6 +81,6 @@ export async function getCurrentIdfSetup(workspaceFolder: Uri) { version: idfVersion, isValid: false, }; - currentIdfSetup.isValid = await checkIdfSetup(currentIdfSetup); + currentIdfSetup.isValid = await checkIdfSetup(currentIdfSetup, logToChannel); return currentIdfSetup; } diff --git a/src/views/commons/espCommons.scss b/src/views/commons/espCommons.scss index 6dfddce9e..7a5f06b60 100644 --- a/src/views/commons/espCommons.scss +++ b/src/views/commons/espCommons.scss @@ -91,7 +91,7 @@ button > span.icon > i:hover { color: var(--vscode-input-placeholderForeground); } .select select:hover, -.textarea, +.textarea:hover, .input:hover { border-color: var(--vscode-inputOption-activeBorder) !important; } diff --git a/src/views/setup/components/selectEspIdf.vue b/src/views/setup/components/selectEspIdf.vue index c0b29a941..c418e526f 100644 --- a/src/views/setup/components/selectEspIdf.vue +++ b/src/views/setup/components/selectEspIdf.vue @@ -119,7 +119,7 @@ watchEffect(() => {
diff --git a/src/views/setup/main.ts b/src/views/setup/main.ts index 56b03101c..55009c03b 100644 --- a/src/views/setup/main.ts +++ b/src/views/setup/main.ts @@ -99,6 +99,9 @@ window.addEventListener("message", (event) => { if (typeof msg.saveScope !== "undefined") { store.saveScope = msg.saveScope; } + if (typeof msg.downloadMirror !== "undefined") { + store.setSelectedDownloadMirror(msg.downloadMirror); + } break; case "setEspIdfErrorStatus": if (typeof msg.errorMsg !== "undefined") { diff --git a/src/views/setup/store.ts b/src/views/setup/store.ts index 49f338e92..f61d16c59 100644 --- a/src/views/setup/store.ts +++ b/src/views/setup/store.ts @@ -317,6 +317,11 @@ export const useSetupStore = defineStore("setup", () => { moveToPySection(); } + function setSelectedDownloadMirror(mirror: IdfMirror) { + selectedIdfMirror.value = + mirror === IdfMirror.Espressif ? IdfMirror.Espressif : IdfMirror.Github; + } + function moveToPySection() { let content = document.getElementById("espidftools") as HTMLDivElement; if (content) { @@ -427,6 +432,7 @@ export const useSetupStore = defineStore("setup", () => { setStatusIdfGit, setStatusIdfPython, setIdfPythonPercentage, + setSelectedDownloadMirror, exploreComponents, openImportProject, openNewProjectPanel, diff --git a/src/views/troubleshoot/App.vue b/src/views/troubleshoot/App.vue new file mode 100644 index 000000000..59c7da438 --- /dev/null +++ b/src/views/troubleshoot/App.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/troubleshoot/main.ts b/src/views/troubleshoot/main.ts new file mode 100644 index 000000000..91b92c76c --- /dev/null +++ b/src/views/troubleshoot/main.ts @@ -0,0 +1,38 @@ +/* + * Project: ESP-IDF VSCode Extension + * File Created: Friday, 14th June 2024 4:43:09 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 { createApp } from "vue"; +import {createPinia } from "pinia"; +import App from "./App.vue"; +import { useTroubleShootingStore } from "./store"; + +const app = createApp(App); +const pinia = createPinia(); +app.use(pinia); +app.mount("#app"); + +const store = useTroubleShootingStore(); + +// Message Receiver +window.addEventListener("message", (m: any) => { + const msg = m.data; + switch (msg.command) { + default: + break; + } +}); \ No newline at end of file diff --git a/src/views/troubleshoot/store.ts b/src/views/troubleshoot/store.ts new file mode 100644 index 000000000..f00ef5cf9 --- /dev/null +++ b/src/views/troubleshoot/store.ts @@ -0,0 +1,50 @@ +/* + * Project: ESP-IDF VSCode Extension + * File Created: Friday, 14th June 2024 4:44:36 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 { defineStore } from "pinia"; +import { ref, Ref } from "vue"; + +declare var acquireVsCodeApi: any; +let vscode: any; +try { + vscode = acquireVsCodeApi(); +} catch (error) { + // tslint:disable-next-line: no-console + console.error(error); +} + +export const useTroubleShootingStore = defineStore("troubleshoot", () => { + const title: Ref = ref(""); + const stepsToReproduce: Ref = ref(""); + const description: Ref = ref(""); + + function sendForm() { + vscode.postMessage({ + command: "sendForm", + title: title.value, + stepsToReproduce: stepsToReproduce.value, + description: description.value, + }); + } + + return { + title, + stepsToReproduce, + description, + sendForm, + }; +}); diff --git a/src/workspaceConfig.ts b/src/workspaceConfig.ts index 02b5c512f..1e7a3777b 100644 --- a/src/workspaceConfig.ts +++ b/src/workspaceConfig.ts @@ -101,6 +101,6 @@ export async function getIdfTargetFromSdkconfig( workspacePath ); if (statusItem) { - statusItem.text = "$(circuit-board) " + idfTarget; + statusItem.text = "$(chip) " + idfTarget; } } diff --git a/templates/.devcontainer/devcontainer.json b/templates/.devcontainer/devcontainer.json index d2539618b..09d3b422a 100644 --- a/templates/.devcontainer/devcontainer.json +++ b/templates/.devcontainer/devcontainer.json @@ -1,5 +1,3 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu { "name": "ESP-IDF QEMU", "build": { @@ -17,7 +15,7 @@ }, "extensions": [ "espressif.esp-idf-extension" - ], + ] }, "codespaces": { "settings": { @@ -29,8 +27,9 @@ "idf.gitPath": "/usr/bin/git" }, "extensions": [ - "espressif.esp-idf-extension" - ], + "espressif.esp-idf-extension", + "espressif.esp-idf-web" + ] } }, "runArgs": ["--privileged"] diff --git a/templates/.vscode/c_cpp_properties.json b/templates/.vscode/c_cpp_properties.json index a3b49b2e9..75ad88aad 100644 --- a/templates/.vscode/c_cpp_properties.json +++ b/templates/.vscode/c_cpp_properties.json @@ -3,23 +3,19 @@ { "name": "ESP-IDF", "compilerPath": "${default}", - "compileCommands": "${workspaceFolder}/build/compile_commands.json", + "compileCommands": "${config:idf.buildPath}/compile_commands.json", "includePath": [ "${config:idf.espIdfPath}/components/**", "${config:idf.espIdfPathWin}/components/**", - "${config:idf.espAdfPath}/components/**", - "${config:idf.espAdfPathWin}/components/**", "${workspaceFolder}/**" ], "browse": { "path": [ "${config:idf.espIdfPath}/components", "${config:idf.espIdfPathWin}/components", - "${config:idf.espAdfPath}/components/**", - "${config:idf.espAdfPathWin}/components/**", "${workspaceFolder}" ], - "limitSymbolsToIncludedHeaders": false + "limitSymbolsToIncludedHeaders": true } } ], diff --git a/testFiles/testWorkspace/.vscode/c_cpp_properties.json b/testFiles/testWorkspace/.vscode/c_cpp_properties.json index a3b49b2e9..75ad88aad 100644 --- a/testFiles/testWorkspace/.vscode/c_cpp_properties.json +++ b/testFiles/testWorkspace/.vscode/c_cpp_properties.json @@ -3,23 +3,19 @@ { "name": "ESP-IDF", "compilerPath": "${default}", - "compileCommands": "${workspaceFolder}/build/compile_commands.json", + "compileCommands": "${config:idf.buildPath}/compile_commands.json", "includePath": [ "${config:idf.espIdfPath}/components/**", "${config:idf.espIdfPathWin}/components/**", - "${config:idf.espAdfPath}/components/**", - "${config:idf.espAdfPathWin}/components/**", "${workspaceFolder}/**" ], "browse": { "path": [ "${config:idf.espIdfPath}/components", "${config:idf.espIdfPathWin}/components", - "${config:idf.espAdfPath}/components/**", - "${config:idf.espAdfPathWin}/components/**", "${workspaceFolder}" ], - "limitSymbolsToIncludedHeaders": false + "limitSymbolsToIncludedHeaders": true } } ], diff --git a/webpack.config.js b/webpack.config.js index 5c8de8078..7bb660f0d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,7 +2,7 @@ const fs = require("fs"); const path = require("path"); const { VueLoaderPlugin } = require("vue-loader"); const webpack = require("webpack"); -const CopyWebpackPlugin = require('copy-webpack-plugin'); +const CopyWebpackPlugin = require("copy-webpack-plugin"); const packageConfig = JSON.parse( fs.readFileSync(path.join(__dirname, "package.json"), "utf8") @@ -53,22 +53,25 @@ const extensionConfig = { }, { test: /node-gyp-build\.js$/, - loader: 'string-replace-loader', + loader: "string-replace-loader", options: { search: /path\.join\(dir, 'prebuilds'/g, replace: "path.join(__dirname, 'prebuilds'", - } - } + }, + }, ], }, plugins: [ new CopyWebpackPlugin({ patterns: [ { - from: path.resolve(__dirname, "./node_modules/@serialport/bindings-cpp/prebuilds"), - to: path.resolve(__dirname, "./dist/prebuilds") - } - ] + from: path.resolve( + __dirname, + "./node_modules/@serialport/bindings-cpp/prebuilds" + ), + to: path.resolve(__dirname, "./dist/prebuilds"), + }, + ], }), ], resolve: { @@ -126,6 +129,13 @@ const webViewConfig = { "main.ts" ), welcomePage: path.resolve(__dirname, "src", "views", "welcome", "main.ts"), + troubleshoot: path.resolve( + __dirname, + "src", + "views", + "troubleshoot", + "main.ts" + ), }, output: { path: path.resolve(__dirname, "dist", "views"), @@ -208,7 +218,6 @@ const webViewConfig = { compress: true, port: 9000, }, - }; module.exports = [extensionConfig, webViewConfig]; diff --git a/yarn.lock b/yarn.lock index 0605b62ca..604ae5af7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2312,6 +2312,18 @@ glob@^10.3.10: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" +glob@^10.3.7: + version "10.4.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.2.tgz#bed6b95dade5c1f80b4434daced233aee76160e5" + integrity sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.0.3, glob@^7.0.6, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -2802,6 +2814,15 @@ jackspeak@^2.3.5, jackspeak@^2.3.6: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" +jackspeak@^3.1.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.0.tgz#a75763ff36ad778ede6a156d8ee8b124de445b4a" + integrity sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -3161,6 +3182,13 @@ minimatch@^9.0.1: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.4: + version "9.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" + integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -3171,6 +3199,11 @@ minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== +minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" @@ -3498,6 +3531,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" + integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== + pako@~1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -3581,6 +3619,14 @@ path-scurry@^1.10.2: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-type@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-5.0.0.tgz#14b01ed7aea7ddf9c7c3f46181d4d04f9c785bb8" @@ -3965,6 +4011,13 @@ rimraf@^3.0.0: dependencies: glob "^7.1.3" +rimraf@^5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.7.tgz#27bddf202e7d89cb2e0381656380d1734a854a74" + integrity sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg== + dependencies: + glob "^10.3.7" + rollup@^3.27.1: version "3.29.4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" @@ -4247,16 +4300,7 @@ string-replace-loader@^3.1.0: loader-utils "^2.0.0" schema-utils "^3.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4288,7 +4332,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -4302,13 +4346,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -4906,16 +4943,7 @@ workerpool@6.2.0: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==