Closed sigmaaa closed 2 months ago
The recent changes enhance launch handling, refactor code for improved readability, and update methods for better consistency and efficiency. Key modifications include adding imports, introducing and updating methods, and improving implementations in multiple files.
Files | Change Summaries |
---|---|
.../idf/ui/LaunchBarListener.java |
Added imports for Optional , Stream , ILaunchManager , and ILaunchMode . Introduced setMode method. Updated activeLaunchDescriptorChanged method. |
...idf/ui/handlers/RunActionHandler.java |
Refactored execute method. Added imports, removed SelectLaunchConfigDialog import. Introduced runActionBasedOnDescCount and setLaunchBarWithFirstAppropriateDescriptor methods. Streamlined findSuitableDescNames and showMessage . |
...ui/dialogs/DeleteResourceWizard.java |
Modified several method signatures. Added braces for code blocks. Adjusted spacing. Enhanced method implementations in addUserInputPages , DeleteResourcesRefactoringConfigurationPage inner class, createControl , updateListOfProjects , computeNestedProjects , performFinish , and deleteRelatedConfigurations methods. |
sequenceDiagram
participant User
participant IDE
participant LaunchBarListener
participant ILaunchManager
User->>IDE: Change active launch configuration
IDE->>LaunchBarListener: Notify activeLaunchDescriptorChanged
LaunchBarListener->>ILaunchManager: Retrieve specific launch mode
ILaunchManager-->>LaunchBarListener: Return the retrieved mode
LaunchBarListener-->>IDE: Update the launch mode
sequenceDiagram
participant User
participant IDE
participant RunActionHandler
User->>IDE: Execute a run action
IDE->>RunActionHandler: Trigger execute method
RunActionHandler->>RunActionHandler: Determine descriptor count
alt Single descriptor
RunActionHandler->>RunActionHandler: setLaunchBarWithFirstAppropriateDescriptor
else Multiple descriptors
RunActionHandler->>RunActionHandler: runActionBasedOnDescCount
end
RunActionHandler-->>IDE: Complete execution
In the codebase deep and bright,
Changes come to make it light,
Launch modes now set with skill,
Run actions tailored, such a thrill!
Pacing through the wizard's maze,
Braces, spacing, all amaze!
With these tweaks, our code shall rise,
To greater heights beneath the skies! 🌟🐰
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?
@sigmaaa hi ! Tested under: OS - Windows 10
change the configuration it automatically sets the mode to Run/Debug accordingly ✔️ LGTM 👍
Follow-up behavior - Would you also like to handle the case where changing the mode (Run to Debug and vice versa) updates the launch configuration in the dropdown menu? I understand we currently handle this during launch with a pop-up, but if there's only one configuration, we could simply switch it and eliminate the pop-up choice for the user.
Follow-up behavior - Would you also like to handle the case where changing the mode (Run to Debug and vice versa) updates the launch configuration in the dropdown menu? I understand we currently handle this during launch with a pop-up, but if there's only one configuration, we could simply switch it and eliminate the pop-up choice for the user.
Hi @kolipakakondal,
thanks for the review. Implemented in the latest PR
thanks for the review. Implemented in the latest PR
Hi @sigmaaa I could still see the same issue where changing the mode is not changing the configuration. Can you please check.
@AndriiFilippov fyi.
thanks for the review. Implemented in the latest PR
Hi @sigmaaa I could still see the same issue where changing the mode is not changing the configuration. Can you please check.
@AndriiFilippov fyi.
Hi @kolipakakondal, this is the expected behavior for this PR since the goal of this PR was to change the mode based on the configuration, not vice versa. To change the configuration, click run or debug with the wrong configuration. Changing the configuration based on the mode automatically causes bugs and not consistent behavior, because changing the configuration causes changing the mode, so if we change the configuration based on the mode it could cause an infinite loop. Removing listeners didn't help to remove bugs completely. Check this PR where I tried to implement similar behaviour https://github.com/espressif/idf-eclipse-plugin/pull/806. We can revisit this PR and try to implement it again, however, we considered the logic in this PR as a good alternative. From the user's perspective, the current behavior looks like this: The user has a launch configuration selected and he wants to debug the project, so he selects mode to the debug and sees the button "Debug" -> At this point he can click it and the configuration will be changed to the debug, so the debug action will be performed
Hi @sigmaaa I'm happy if you would like to revist the existing PR on this problem and fix this issue.
Description
Now, when we change the configuration it automatically sets the mode to Run/Debug accordingly
Fixes # (IEP-1262)
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
New Features
Refactor
Bug Fixes
Style