espressif / idf-eclipse-plugin

Espressif-IDE (based on Eclipse CDT) for ESP-IDF CMake based projects 4.x and above
Eclipse Public License 2.0
302 stars 121 forks source link

IEP-1156 The Revert Target job reverts the selected DFU target #886

Closed sigmaaa closed 7 months ago

sigmaaa commented 8 months ago

Description

Changed the logic of notifying of target change to improve UX, simplify code, fix bugs, and avoid further bugs. Now, when we are changing targets while editing launch/debug configurations we are not updating LaunchBar immediately, but doing that after the dialog is closed and changes are applied.

Fixes # (IEP-1156)

Type of change

Please delete options that are not relevant.

How has this been tested?

Test Configuration:

Dependent components impacted by this PR:

Checklist

Summary by CodeRabbit

Summary by CodeRabbit

coderabbitai[bot] commented 8 months ago

[!WARNING]

Rate Limit Exceeded

@sigmaaa has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 37 seconds before requesting another review.

How to resolve this issue? After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.
How do rate limits work? CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.
Commits Files that changed from the base of the PR and between ca65017dbc750573fc812d1e7becdc961fcba8b0 and da0dc99cb9ed8bf682d1ebdcd64665225e150213.

Walkthrough

The changes reflect an enhancement in the Espressif IDF plugin for Eclipse, focusing on launch target management. A new class, ApplyTargetJob, is introduced to handle active launch target settings, while LaunchTargetHelper provides utility functions for managing these targets. The CMakeMainTab2 has been streamlined, removing and adding methods for better launch target handling. The Messages.java file provides internationalized messaging support. Tests are added to ensure the new functionality works as expected, with org.eclipse.jface and related packages now imported to support these changes.

Changes

File Path Change Summary
bundles/com.espressif.idf.core/META-INF/MANIFEST.MF
tests/com.espressif.idf.core.test/META-INF/MANIFEST.MF
Added export of com.espressif.idf.core.actions and import of org.eclipse.launchbar.ui.target, org.eclipse.jface, org.eclipse.jface.wizard.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java Added ATTR_SERIAL_PORT constant.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/actions/ApplyTargetJob.java Introduced ApplyTargetJob class responsible for setting and applying launch targets.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/actions/Messages.java Added internationalized messages for the com.espressif.idf.core.actions package.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java Introduced LaunchTargetHelper class for managing launch targets.
bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java Removed and added imports, modified methods related to launch targets.
tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java Added tests for ApplyTargetJob functionality and exception handling.
tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/TestableApplyTargetJob.java Extended ApplyTargetJob for testing purposes.
tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java Provided unit tests for LaunchTargetHelper class.

Poem

🐇 CodeRabbit hopped along the IDE,
🌟 Sprinkling features with glee, wide-eyed and free.
"Now manage targets, oh so smart,"
🚀 "Launch your code, let the magic start!"

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

Tips ### Chat There are 3 ways to chat with CodeRabbit: - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit-tests for this file.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit tests for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository from git and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit tests.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json` ### CodeRabbit Discord Community Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.
AndriiFilippov commented 8 months ago

@sigmaaa hi !

Steps:

Create project -> delete S3 target -> create custom S3 target -> go to DFU -> select custom S3 target -> click OK :

image

sigmaaa commented 8 months ago

Hi @AndriiFilippov, thank you for noticing it, this bug also exists on master. Fixed in the last commit and made some refactoring, which touches a logic a little bit, so the code looks simpler and UI is more consistent now. was: image after the commit: image

Explanation: no matter how many ILaunchTargets with esp32s2 and esp32s3 exist, there are always only two options to select from (esp32s2 and esp32s3) similar to how it's implemented for the JTAG target. After all, if there is no esp32s2 or esp32s3 after applying the dialog with no existing target there will be a notification to create this target.

AndriiFilippov commented 8 months ago

@sigmaaa hi !

Tested under: OS - Windows 10 ESP-IDF: v5.1.2

able to build DFU with custom Launch Target ✔️ do see notification message once selected non-existing target for DFU/JTAG ✔️

LGTM 👍