Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IEP-1297 Consolidate information about the target and board in one place #1027

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

sigmaaa
Copy link
Collaborator

@sigmaaa sigmaaa commented Aug 5, 2024

Description

Updated the target editing page with the flash option and the board selection. Updated launch configuration and debug configuration

Fixes # (IEP-1297)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • the changes affect the build and flash/debug functionality, so need to test these functionalities carefully under different circumstances. For example -> importing configuration from the older version.

Test Configuration:

  • ESP-IDF Version:
  • OS (Windows,Linux and macOS):

Dependent components impacted by this PR:

  • Launch configuration
  • Debug Configuration
  • Target editing page

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new configuration files for Eclipse projects to streamline Java development.
    • Added custom UI components for enhanced user interactions in the GDB debugger settings.
    • Enhanced serial port management and configuration settings for the ESP32 platform.
    • Implemented new constants for launch bar target configurations.
    • Introduced classes to resolve dynamic variables related to JTAG and GDB configurations.
    • Updated naming conventions for executable paths to improve clarity and consistency.
  • Bug Fixes

    • Improved handling of dynamic variables related to JTAG and GDB operations, enhancing documentation clarity.
  • Documentation

    • Updated properties files to include new key-value pairs for better guidance on settings.
  • Chores

    • Added project configuration files to support efficient project management.

Copy link

coderabbitai bot commented Aug 5, 2024

Walkthrough

This update introduces configuration files for Java SE 17 in the Eclipse-based Java project, optimizing classpath settings and enhancing dynamic variable management for JTAG and GDB operations. Additionally, new user interface components and utility classes improve the Espressif IDF environment, streamlining the development process and expanding functionality for users.

Changes

File(s) Summary
bundles/.classpath, bundles/.settings/org.eclipse.jdt.core.prefs, bundles/.settings/org.eclipse.pde.core.prefs Created new configuration files for classpath setup and Eclipse IDE preferences for Java SE 17.
bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties, bundles/com.espressif.idf.core/plugin.xml Enhanced documentation and updated variable definitions for improved clarity in plugin configuration.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java, bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java Introduced new classes and methods for managing board configurations and dynamic variables.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java, bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFLaunchConstants.java Refactored code to utilize updated constant references for launch configurations.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/*.java Added new enums and resolvers for managing dynamic variables related to JTAG and GDB.
bundles/com.espressif.idf.swt.custom/build.properties Introduced a new build properties file for managing source and output directories.
bundles/com.espressif.idf.debug.gdbjtag.openocd/* Enhanced GDB JTAG integration through UI changes and new message properties.
bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/util/ESPFlashUtil.java Updated constant DEFAULT_ARGUMENT_PREFIX for improved clarity regarding OpenOCD executable naming.
bundles/com.espressif.idf.launch.serial.core/* Updated serial launch configurations by removing deprecated constants.
tests/com.espressif.idf.core.test/* Modified test classes to reflect changes in constants and method updates.
bundles/pom.xml, features/com.espressif.idf.feature/feature.xml Added module and plugin declarations to support the new SWT custom widgets.
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java Enhanced functionality for serial port management and configuration settings for ESP32.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant IDE
    participant CorePlugin
    participant SWTPackage

    User->>IDE: Configure Project
    IDE->>CorePlugin: Update Board Configurations
    CorePlugin->>SWTPackage: Initialize Custom Widgets
    SWTPackage-->>IDE: Load UI Components
    IDE-->>User: Display Enhanced Configuration UI
Loading

🐰 In a world of code, I hop and play,
With new tools and features brightening my day.
JTAG and GDB dance in the light,
Espressif's magic makes coding feel right!
So let’s celebrate with carrots and fun,
Hopping through changes, oh what a run! 🥕✨


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
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 <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Outside diff range, codebase verification and nitpick comments (4)
bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/Messages.java (1)

1-20: LGTM! Consider adding documentation.

The class is implemented correctly for handling localization. However, consider adding Javadoc comments for better clarity.

/**
 * Messages class for handling localized messages.
 */
public class Messages extends NLS
{
    // Other methods and fields...
}
bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java (1)

1-26: LGTM! Consider adding documentation.

The class is implemented correctly for managing the bundle lifecycle. However, consider adding Javadoc comments for better clarity.

/**
 * Activator class for managing the bundle lifecycle.
 */
public class Activator implements BundleActivator
{
    // Other methods and fields...
}
bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1)

36-43: Consider adding a default case.

The resolveForDynamicEnum method correctly resolves the value for the JTAG_FLASH_ARGS enum variable. Consider adding a default case to handle any future enum variables.

-  return switch (enumVariable)
+  return switch (enumVariable)
  {
  case JTAG_FLASH_ARGS -> generatePartOfConfigOptionsForVoltage() + generatePartOfConfigOptionsForBoard(); // $NON-NLS-1$
+  default -> StringUtil.EMPTY;
  };
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (1)

Line range hint 88-182: Ensure proper initialization of UI components.

The createControl method has been expanded to include several new UI components. Ensure that all components are properly initialized and disposed of to avoid memory leaks.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 43a06e0 and 0074f19.

Files ignored due to path filters (2)
  • bundles/com.espressif.idf.swt.custom/icons/hide.png is excluded by !**/*.png
  • bundles/com.espressif.idf.swt.custom/icons/show.png is excluded by !**/*.png
Files selected for processing (56)
  • bundles/.classpath (1 hunks)
  • bundles/.settings/org.eclipse.jdt.core.prefs (1 hunks)
  • bundles/.settings/org.eclipse.pde.core.prefs (1 hunks)
  • bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties (1 hunks)
  • bundles/com.espressif.idf.core/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (15 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/DfuCommandsUtil.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (9 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (4 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/SvdPathResolver.java (3 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java (4 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java (19 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties (1 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/SerialFlashLaunchTargetProvider.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunch.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java (3 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (18 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (5 hunks)
  • bundles/com.espressif.idf.swt.custom/.classpath (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.gitignore (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.project (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.core.resources.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.jdt.core.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.pde.core.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.swt.custom/OSGI-INF/l10n/bundle.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/build.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.swt.custom/pom.xml (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/Messages.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/messages.properties (1 hunks)
  • bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/controls/SerialSettingsPage.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/WriteFlashDialog.java (3 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (2 hunks)
  • bundles/pom.xml (1 hunks)
  • features/com.espressif.idf.feature/feature.xml (1 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java (3 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java (3 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java (5 hunks)
Files skipped from review due to trivial changes (15)
  • bundles/.classpath
  • bundles/.settings/org.eclipse.jdt.core.prefs
  • bundles/.settings/org.eclipse.pde.core.prefs
  • bundles/com.espressif.idf.swt.custom/.classpath
  • bundles/com.espressif.idf.swt.custom/.gitignore
  • bundles/com.espressif.idf.swt.custom/.project
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.core.resources.prefs
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.jdt.core.prefs
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.pde.core.prefs
  • bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF
  • bundles/com.espressif.idf.swt.custom/OSGI-INF/l10n/bundle.properties
  • bundles/com.espressif.idf.swt.custom/build.properties
  • bundles/com.espressif.idf.swt.custom/pom.xml
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/messages.properties
  • features/com.espressif.idf.feature/feature.xml
Additional comments not posted (116)
bundles/com.espressif.idf.swt.custom/plugin.xml (2)

1-2: LGTM!

The XML declaration and Eclipse version are correctly specified.


3-11: LGTM! But verify the existence and correctness of the specified class.

The plugin configuration appears correct.

However, verify that the class com.espressif.idf.swt.custom.Activator exists and is correctly implemented.

Verification successful

The class com.espressif.idf.swt.custom.Activator exists and is correctly implemented.

The Activator class contains the required start and stop methods, which are implemented appropriately.

  • start(BundleContext bundleContext): Sets the context to the provided BundleContext.
  • stop(BundleContext bundleContext): Sets the context to null.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the specified class.

# Test: Search for the class definition. Expect: The class should exist.
rg --type java 'class Activator' --glob '**/com/espressif/idf/swt/custom/Activator.java'

Length of output: 225


Script:

#!/bin/bash
# Description: Verify the implementation of the Activator class.

# Test: Search for the start and stop methods in the Activator class. Expect: Both methods should be implemented.
rg --type java 'public void start' --glob '**/com/espressif/idf/swt/custom/Activator.java' -A 10
rg --type java 'public void stop' --glob '**/com/espressif/idf/swt/custom/Activator.java' -A 10

Length of output: 1952

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java (2)

5-5: LGTM!

The package declaration is correctly specified.


7-10: LGTM!

The enum declaration and value are correctly specified.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java (2)

5-5: LGTM!

The package declaration is correctly specified.


7-10: LGTM!

The enum declaration and value are correctly specified.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java (1)

9-9: LGTM! But verify the enum usage in the codebase.

The code changes are approved.

However, ensure that all references to OPENOCD_EXE in the codebase match the new string value.

bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties (3)

6-6: LGTM!

The description for openocd_scripts is clear and concise.


7-7: LGTM!

The description for jtag_flash_args is detailed and provides clear guidance on its functionality.


8-8: LGTM!

The description for gdb_client_executable is clear and concise.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java (1)

1-22: LGTM!

The class LaunchBarTargetConstants follows Java best practices for defining constants. The use of a private constructor is appropriate, and the constants are well-named and consistent.

bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF (1)

24-25: LGTM!

The addition of com.espressif.idf.swt.custom expands the bundle's capabilities. The repositioning of com.espressif.idf.ui is likely for organizational purposes.

bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/SerialFlashLaunchTargetProvider.java (2)

Line range hint 16-19:
LGTM!

The init method correctly initializes the target manager.


Line range hint 21-24:
LGTM!

The getStatus method correctly returns the target status.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java (1)

Line range hint 3-15:
LGTM!

The remaining constants in IDFLaunchConstants are correct.

bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF (1)

45-46: Addition of new package dependency.

The new package com.espressif.idf.swt.custom has been added to the Import-Package declaration. Ensure that this package is correctly implemented and available in the project to avoid runtime issues.

Verification successful

The package com.espressif.idf.swt.custom is correctly implemented and available in the project.

The package is declared in multiple Java source files and is mentioned in various configuration and build files, confirming its proper integration.

  • Source files:

    • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java
    • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java
    • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java
  • Configuration and build files:

    • features/com.espressif.idf.feature/feature.xml
    • bundles/pom.xml
    • bundles/com.espressif.idf.swt.custom/pom.xml
    • bundles/com.espressif.idf.swt.custom/plugin.xml
    • bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF
    • bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF
    • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the `com.espressif.idf.swt.custom` package in the project.

# Test: Search for the package directory. Expect: The directory should exist.
fd --type d 'com/espressif/idf/swt/custom'

Length of output: 42


Script:

#!/bin/bash
# Description: Verify the existence of the `com.espressif.idf.swt.custom` package in the project.

# Test 1: Search for the package declaration in the source files. Expect: The package declaration should exist.
rg --glob '*.java' 'package com.espressif.idf.swt.custom'

# Test 2: Search for the package mention in configuration or build files. Expect: The package should be mentioned.
rg 'com.espressif.idf.swt.custom'

Length of output: 2542

bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java (4)

19-19: New instance variable espConfigParser.

The espConfigParser instance variable is added to hold an instance of EspConfigParser. Ensure that this variable is correctly utilized in the class.


40-43: Initialization of espConfigParser in the constructor.

The espConfigParser is initialized in the constructor. Ensure that the EspConfigParser class has a default constructor and does not throw exceptions during initialization.


11-11: New dependency on EspConfigParser.

The EspConfigParser class is imported, indicating a new dependency. Ensure that this class is correctly implemented and available in the project to avoid runtime issues.

Verification successful

New dependency on EspConfigParser verified.

The EspConfigParser class is correctly implemented and available in the project. The new dependency is valid and should not cause any runtime issues.

  • The class is located at bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/EspConfigParser.java.
  • It contains methods for parsing configuration files and retrieving various configurations.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the `EspConfigParser` class in the project.

# Test: Search for the class file. Expect: The file should exist.
fd --type f 'EspConfigParser.java'

Length of output: 118


Script:

#!/bin/bash
# Description: Verify the implementation of the `EspConfigParser` class.

# Test: Check the contents of the EspConfigParser.java file. Expect: The file should contain a valid class implementation.
cat bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/EspConfigParser.java

Length of output: 3832


55-60: New method getDefaultBoard.

The getDefaultBoard method retrieves the board configurations associated with a given target name. Ensure that the method correctly handles cases where the target name is not found or the configuration map is empty.

bundles/pom.xml (1)

33-33: Addition of new module.

The new module com.espressif.idf.swt.custom has been added to the list of modules. Ensure that this module is correctly implemented and available in the project to avoid build issues.

Verification successful

Module com.espressif.idf.swt.custom is correctly implemented and available.

The module com.espressif.idf.swt.custom is defined in the bundles/pom.xml file and has corresponding Java package declarations in multiple files within the bundles/com.espressif.idf.swt.custom/src directory. This confirms that the module is implemented and available in the project.

  • bundles/pom.xml: <module>com.espressif.idf.swt.custom</module>
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java: package com.espressif.idf.swt.custom;
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java: package com.espressif.idf.swt.custom;
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java: package com.espressif.idf.swt.custom;
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the `com.espressif.idf.swt.custom` module in the project.

# Test: Search for the module directory. Expect: The directory should exist.
fd --type d 'com/espressif/idf/swt/custom'

Length of output: 42


Script:

#!/bin/bash
# Description: Verify the existence and implementation of the `com.espressif.idf.swt.custom` module in the project.

# Test 1: Search for the module directory. Expect: The directory should exist.
fd --type d 'com/espressif/idf/swt/custom'

# Test 2: Search for the module definition in all `pom.xml` files. Expect: The module should be defined.
fd -e xml -x grep -H '<module>com.espressif.idf.swt.custom</module>' {}

# Test 3: Search for Java package declarations matching `com.espressif.idf.swt.custom`. Expect: The package should be declared in Java files.
fd -e java -x grep -H 'package com.espressif.idf.swt.custom' {}

Length of output: 637

bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunch.java (2)

29-29: LGTM! Import change approved.

The import of LaunchBarTargetConstants centralizes various launch-related constants, improving maintainability.


44-44: LGTM! Constructor change approved.

The constructor now uses LaunchBarTargetConstants.SERIAL_PORT to obtain the serial port name, improving consistency in attribute access.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java (4)

23-25: LGTM! Private constructor addition approved.

The private constructor prevents instantiation of the LaunchTargetHelper class, enforcing its use as a utility class.


54-54: LGTM! Method change approved.

The method now uses LaunchBarTargetConstants.TARGET to filter targets, improving consistency in attribute access.


60-61: LGTM! Method change approved.

The method now uses LaunchBarTargetConstants.TARGET to filter targets, improving consistency in attribute access.


70-70: LGTM! Method change approved.

The method now uses LaunchBarTargetConstants.SERIAL_PORT to retrieve the serial port, improving consistency in attribute access.

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java (4)

26-26: LGTM! Import change approved.

The import of LaunchBarTargetConstants centralizes various launch-related constants, improving maintainability.


59-62: LGTM! Method change approved.

The method now uses constants from LaunchBarTargetConstants for setting attributes, improving clarity and maintainability.


71-71: LGTM! Method change approved.

The method now uses LaunchBarTargetConstants.SERIAL_PORT to store the last used serial port, improving consistency in attribute access.


95-96: LGTM! Method change approved.

The method now includes braces for multi-line method bodies, improving readability and reducing potential errors.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (3)

26-29: LGTM!

The resolveValue method correctly resolves the value of a dynamic variable by mapping it to an appropriate enum variable.


31-34: LGTM!

The getAppropriateEnumVariable method correctly filters the JtagDynamicVariable enum to find a matching variable name.


45-56: LGTM!

The getActiveLaunchTarget method correctly retrieves the active launch target and handles exceptions appropriately.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (1)

48-57: LGTM!

The resolveForOpenocdDynamicEnum method correctly uses the new getOpenocdExecutable method, improving modularity and maintainability.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/SvdPathResolver.java (2)

26-26: LGTM!

The import statement for LaunchBarTargetConstants correctly replaces IDFLaunchConstants.


48-48: LGTM!

The resolveValue method correctly uses the new constant LaunchBarTargetConstants.TARGET, improving consistency.

tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java (3)

32-32: Simplified constant improves readability.

The constant OPENOCD_EXE_EXPECTED has been simplified to a direct string "openocd", which enhances readability and removes platform-specific path separators.


60-60: Simplified expected result improves test accuracy.

The expected result now directly uses the full expected path, simplifying the test and likely improving its accuracy.


107-110: New method improves maintainability.

The new protected method getOpenocdExecutable enhances the functionality of the class by providing a dedicated method to retrieve the executable path, improving maintainability and readability.

bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java (1)

90-149: Methods are well-implemented.

The methods in the TextWithButton class are straightforward and follow best practices.

bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java (2)

49-155: Methods are well-implemented.

The methods in the StyledInfoText class are well-structured and follow best practices.


28-47: Dispose of image resources to prevent memory leaks.

The image resources buttonShowImage and infoButtonImage should be disposed of in the constructor to prevent memory leaks.

+  // Dispose of image resources when the styledText is disposed
+  styledText.addDisposeListener(e -> {
+    buttonShowImage.dispose();
+    infoButtonImage.dispose();
+  });

Likely invalid or redundant comment.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/DfuCommandsUtil.java (4)

31-31: LGTM!

The import statement for LaunchBarTargetConstants is necessary for the changes made in the isTargetSupportDfu method.


42-44: LGTM!

The private constructor enforces the utility class pattern, indicating that the class is intended solely for static methods.


69-73: LGTM!

The lambda expression improves readability and simplifies the code in the isDfuSupported method.


81-81: LGTM!

The change to use LaunchBarTargetConstants.TARGET aligns with the refactoring aimed at centralizing target definitions.

tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java (3)

34-34: LGTM!

The import statement for LaunchBarTargetConstants is necessary for the changes made in the test methods.


94-95: LGTM!

The changes ensure that the test methods now utilize the updated constant definitions.


116-117: LGTM!

The changes ensure that the test methods now utilize the updated constant definitions.

bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/controls/SerialSettingsPage.java (3)

41-41: LGTM!

The import statement for LaunchBarTargetConstants is necessary for the changes made in the getLastUsedSerialPort method.


72-72: LGTM!

The change simplifies the logic by eliminating an unnecessary variable and potentially reduces memory usage.


82-82: LGTM!

The change enhances code maintainability and readability by using a defined constant instead of a string literal.

tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java (13)

24-24: Import statement added for LaunchBarTargetConstants.

This import is necessary for the updated references in the test functions.


77-77: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


80-80: Updated attribute retrieval to use LaunchBarTargetConstants.SERIAL_PORT.

This change ensures consistency with the updated constants.


88-88: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


89-89: Updated attribute retrieval to use LaunchBarTargetConstants.SERIAL_PORT.

This change ensures consistency with the updated constants.


100-107: Updated attribute retrievals to use LaunchBarTargetConstants.TARGET and LaunchBarTargetConstants.SERIAL_PORT.

These changes ensure consistency with the updated constants.


115-116: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


128-128: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


130-130: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


133-133: Updated attribute retrieval to use LaunchBarTargetConstants.SERIAL_PORT.

This change ensures consistency with the updated constants.


135-135: Updated attribute retrieval to use LaunchBarTargetConstants.SERIAL_PORT.

This change ensures consistency with the updated constants.


143-143: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


152-152: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java (4)

33-33: Import statement added for LaunchBarTargetConstants.

This import is necessary for the updated references in the class.


90-90: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.


90-90: Removed jtagIgnored variable and setIgnoreJtagTargetChange method.

This change simplifies the control flow by removing unnecessary complexity.


90-90: Updated attribute retrieval to use LaunchBarTargetConstants.TARGET.

This change ensures consistency with the updated constants.

bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java (4)

53-53: Import statement added for LaunchBarTargetConstants.

This import is necessary for the updated references in the class.


90-91: Updated attribute retrieval to use LaunchBarTargetConstants.SERIAL_PORT.

This change ensures consistency with the updated constants.


94-95: Refined logic for checking DFU support.

This change improves the robustness of the DFU process by ensuring that flashing only occurs if the target is compatible.


94-95: Refined logic for checking DFU support.

This change improves the robustness of the DFU process by ensuring that flashing only occurs if the target is compatible.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (1)

276-276: LGTM! Verify the usage of the new constant.

The change to use LaunchBarTargetConstants.TARGET instead of IDFLaunchConstants.ATTR_IDF_TARGET is approved.

However, ensure that all references to IDFLaunchConstants.ATTR_IDF_TARGET have been updated to LaunchBarTargetConstants.TARGET across the codebase.

Verification successful

All references to the old constant have been updated to the new constant.

The change to use LaunchBarTargetConstants.TARGET instead of IDFLaunchConstants.ATTR_IDF_TARGET has been successfully propagated across the codebase.

  • Verified in files such as LaunchBarListener.java, NewIDFProjectWizard.java, IDFBuildConfiguration.java, and others.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `IDFLaunchConstants.ATTR_IDF_TARGET` have been updated to `LaunchBarTargetConstants.TARGET`.

# Test: Search for the old constant. Expect: No occurrences of the old constant.
rg --type java $'IDFLaunchConstants.ATTR_IDF_TARGET'

Length of output: 51


Script:

#!/bin/bash
# Description: Verify the usage of the new constant `LaunchBarTargetConstants.TARGET`.

# Test: Search for the new constant. Expect: Occurrences of the new constant.
rg --type java $'LaunchBarTargetConstants.TARGET'

Length of output: 4926

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java (6)

122-125: LGTM!

The updated method signature for getGdbServerExecutable enhances code readability.


128-131: LGTM!

The updated method signature for getGdbClientExecutable enhances code readability.


136-138: LGTM!

The method getOpenocdConfig correctly retrieves the OpenOCD configuration.


143-146: LGTM!

The method getTabMainCheckProgram correctly retrieves the main check program status.


40-43: LGTM! Verify the usage of modified constants.

The modifications to GDB_SERVER_EXECUTABLE_DEFAULT, GDB_SERVER_EXECUTABLE_DEFAULT_NAME, and GDB_CLIENT_EXECUTABLE_DEFAULT are approved.

However, ensure that these constants are used correctly across the codebase.

Verification successful

Usage of modified constants verified successfully.

The constants GDB_SERVER_EXECUTABLE_DEFAULT, GDB_SERVER_EXECUTABLE_DEFAULT_NAME, and GDB_CLIENT_EXECUTABLE_DEFAULT are used correctly across the codebase.

  • The constants are correctly referenced in DefaultPreferences to provide default values.
  • The Configuration class correctly references GDB_SERVER_EXECUTABLE_DEFAULT for default configuration.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of modified constants.

# Test: Search for the usage of modified constants. Expect: Correct usage across the codebase.
rg --type java $'GDB_SERVER_EXECUTABLE_DEFAULT|GDB_SERVER_EXECUTABLE_DEFAULT_NAME|GDB_CLIENT_EXECUTABLE_DEFAULT'

Length of output: 1452


Script:

#!/bin/bash
# Extract surrounding lines of code where the constants are used to understand their context.

# Extracting usage context for GDB_SERVER_EXECUTABLE_DEFAULT
rg --type java -A 5 -B 5 'GDB_SERVER_EXECUTABLE_DEFAULT' 

# Extracting usage context for GDB_CLIENT_EXECUTABLE_DEFAULT
rg --type java -A 5 -B 5 'GDB_CLIENT_EXECUTABLE_DEFAULT'

# Extracting usage context for GDB_SERVER_EXECUTABLE_DEFAULT_NAME
rg --type java -A 5 -B 5 'GDB_SERVER_EXECUTABLE_DEFAULT_NAME'

Length of output: 11359


22-24: LGTM! Verify the usage of new imports.

The new imports for GdbClientDynamicVariable, JtagDynamicVariable, and OpenocdDynamicVariable are approved.

However, ensure that these imports are used correctly across the codebase.

Verification successful

The new imports are used correctly across the codebase.

The imports for GdbClientDynamicVariable, JtagDynamicVariable, and OpenocdDynamicVariable are utilized in multiple files, including test files and resolver classes, indicating proper integration and testing.

  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of new imports.

# Test: Search for the usage of new imports. Expect: Correct usage across the codebase.
rg --type java $'GdbClientDynamicVariable|JtagDynamicVariable|OpenocdDynamicVariable'

Length of output: 4479

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/WriteFlashDialog.java (2)

153-159: LGTM!

The use of enhanced pattern matching for instance checks simplifies the code and improves readability.


176-177: LGTM! Verify the usage of the new constant.

The change to use LaunchBarTargetConstants.SERIAL_PORT instead of ATTR_SERIAL_PORT is approved.

However, ensure that all references to ATTR_SERIAL_PORT have been updated to LaunchBarTargetConstants.SERIAL_PORT across the codebase.

Verification successful

Verification Successful

All references to ATTR_SERIAL_PORT have been updated to LaunchBarTargetConstants.SERIAL_PORT across the codebase. The new constant is being used correctly in various places.

  • No occurrences of ATTR_SERIAL_PORT were found.
  • Multiple occurrences of LaunchBarTargetConstants.SERIAL_PORT were found in relevant files.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `ATTR_SERIAL_PORT` have been updated to `LaunchBarTargetConstants.SERIAL_PORT`.

# Test: Search for the old constant. Expect: No occurrences of the old constant.
rg --type java $'ATTR_SERIAL_PORT'

Length of output: 33


Script:

#!/bin/bash
# Description: Verify all references to `ATTR_SERIAL_PORT` have been updated to `LaunchBarTargetConstants.SERIAL_PORT`.

# Test 1: Search for any remaining occurrences of the old constant.
rg --type java 'ATTR_SERIAL_PORT'

# Test 2: Search for occurrences of the new constant to ensure it's being used.
rg --type java 'LaunchBarTargetConstants.SERIAL_PORT'

Length of output: 3535

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (7)

184-193: Ensure all necessary components are initialized in setDefaults.

The setDefaults method initializes UI components with values from the launchTarget. Ensure that all necessary components are included in this initialization.


195-202: Ensure the default voltage is set correctly.

The setDefaultVoltage method sets the default flash voltage from the launchTarget. Ensure that the voltage is set correctly and that the component is properly updated.


204-226: Ensure the default target and board are set correctly.

The setDefaultTargetAndBoard method sets the default target and board from the launchTarget. Ensure that the target and board are set correctly and that the components are properly updated.


228-251: Ensure the default serial port is set correctly.

The setDefaultSerialPort method sets the default serial port from the launchTarget. Ensure that the serial port is set correctly and that the component is properly updated.


253-272: Ensure the JTAG group is created correctly.

The createJtagGroup method creates a new group for JTAG settings. Ensure that the group is created correctly and that all components are properly initialized and disposed of.


276-284: Ensure resources are disposed of correctly.

The dispose method cancels the targetPortInfo job if it is running and then calls the superclass's dispose method. Ensure that all resources are disposed of correctly to avoid memory leaks.


382-427: Ensure target port operations are performed correctly.

The run method in the TargetPortInfo class performs operations related to the target port. Ensure that the operations are performed correctly and that any exceptions are handled appropriately.

bundles/com.espressif.idf.core/plugin.xml (1)

313-330: Ensure variable names are consistent and clear.

The variable openocd_exe has been renamed to openocd_executable, and new variables JTAG_FLASH_ARGS and GDB_CLIENT_EXECUTABLE have been added. Ensure that the variable names are consistent and clear, and that the new variables are utilized correctly in the codebase.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties (1)

127-129: Ensure new entries are clear and consistent.

New entries DebuggerTab.gdbOtherOptionsBrowse, DebuggerTab.gdbOtherOptionsBrowse_Title, and DebuggerTab.gdbOtherOptionsVariable have been added. Ensure that the new entries are clear, consistent with existing entries, and correctly utilized in the codebase.

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (7)

65-69: Imports look good.

The new imports for JtagDynamicVariable, OpenocdDynamicVariable, StyledInfoText, and TextWithButton are appropriate and align with the changes in the code.


85-87: Field type changes approved.

The fields uartAgrumentsField, jtagArgumentsField, and dfuArgumentsField have been correctly changed from Text to TextWithButton to enhance UI functionality.


110-114: Introduction of StyledInfoText approved.

The addition of StyledInfoText with a mouse listener action enhances user interaction by providing styled information text.


Line range hint 139-163:
Method parameter type change approved.

The createArgumentComponent method now accepts TextWithButton instead of Text, aligning with the new UI component and enhancing functionality.


220-220: Field initialization change approved.

The uartAgrumentsField is now correctly initialized as TextWithButton, aligning with the new UI component.


Line range hint 242-268:
Field initialization changes approved.

The jtagArgumentsField and dfuArgumentsField are now correctly initialized as TextWithButton, aligning with the new UI component.


662-666: Default value initialization approved.

The initializeFromDefaults method correctly sets default values for uartAgrumentsField, jtagArgumentsField, and dfuArgumentsField.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (3)

41-41: Import change approved.

The new import for LaunchBarTargetConstants aligns with the changes in the codebase for managing launch targets.


Line range hint 363-373:
Refactoring of constant usage approved.

The getToolchainExePathForActiveTarget method now references LaunchBarTargetConstants.TARGET instead of IDFLaunchConstants.ATTR_IDF_TARGET, improving clarity and aligning with the new structure.


Line range hint 675-697:
New utility methods approved.

The getProjectFromActiveLaunchConfig and getGitExecutablePathFromSystem methods provide useful functionality and are well-implemented.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (5)

45-49: Imports look good.

The new imports for DefaultBoardProvider and LaunchBarTargetConstants align with the enhancements in functionality and centralized constant usage.


248-248: Streamlined method approved.

The removeMatchedToolChain method now uses a streamlined approach, improving readability and maintainability.


Line range hint 418-434:
Modern Java feature usage approved.

The getAvailableEspTargetList and getAllEspToolchains methods now use the toList() method directly on streams, enhancing clarity and conciseness.


Line range hint 441-456:
Modern Java feature usage approved.

The addToolchainBasedTargets method now uses the toList() method directly on streams, enhancing clarity and conciseness.


Line range hint 489-538:
Refactoring of constant usage approved.

The addLaunchTargets method now sets attributes using LaunchBarTargetConstants, improving maintainability and reducing potential errors.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3)

85-85: Import statement looks good.

The import statement for LaunchBarTargetConstants is necessary for the changes in the file.


509-511: LGTM! Centralize launch target constants.

Replacing IDFLaunchConstants.ATTR_IDF_TARGET with LaunchBarTargetConstants.TARGET improves maintainability.


644-645: LGTM! Centralize launch target constants.

Replacing IDFLaunchConstants.ATTR_IDF_TARGET with LaunchBarTargetConstants.TARGET improves maintainability.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java (6)

34-34: Import statement looks good.

The import statement for VariablesPlugin is necessary for the changes in the file.


45-46: Import statements look good.

The import statements for MouseEvent and MouseTrackAdapter are necessary for handling mouse events.


73-74: Import statements look good.

The import statements for StyledInfoText and TextWithButton are necessary for the custom UI components.


91-96: LGTM! Enhance UI with TextWithButton.

Replacing Text fields with TextWithButton for GDB server and client executables and options improves user interaction.

Also applies to: 102-102


170-174: LGTM! Enhance UI with StyledInfoText.

Adding StyledInfoText with a mouse listener action improves dynamic updates in the UI.


220-230: LGTM! Update methods for TextWithButton.

Updating browseButtonSelected and variablesButtonSelected methods to support TextWithButton is necessary.

Also applies to: 233-238

Comment on lines +20 to +26
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException
{
ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
var targetName = launchBarManager.getActiveLaunchTarget().getAttribute(LaunchBarTargetConstants.TARGET,
StringUtil.EMPTY);
return IDFUtil.getXtensaToolchainExecutablePathByTarget(targetName);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add error handling for potential null values and exceptions.

The method resolveValue should handle potential null values for launchBarManager.getActiveLaunchTarget() and targetName, and catch exceptions that might be thrown by IDFUtil.getXtensaToolchainExecutablePathByTarget.

public String resolveValue(IDynamicVariable variable, String argument) throws CoreException
{
	ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
-	var targetName = launchBarManager.getActiveLaunchTarget().getAttribute(LaunchBarTargetConstants.TARGET, StringUtil.EMPTY);
+	var activeLaunchTarget = launchBarManager.getActiveLaunchTarget();
+	if (activeLaunchTarget == null) {
+		throw new CoreException(new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, "Active launch target is null"));
+	}
+	var targetName = activeLaunchTarget.getAttribute(LaunchBarTargetConstants.TARGET, StringUtil.EMPTY);
+	if (targetName == null) {
+		throw new CoreException(new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, "Target name is null"));
+	}
	return IDFUtil.getXtensaToolchainExecutablePathByTarget(targetName);
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException
{
ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
var targetName = launchBarManager.getActiveLaunchTarget().getAttribute(LaunchBarTargetConstants.TARGET,
StringUtil.EMPTY);
return IDFUtil.getXtensaToolchainExecutablePathByTarget(targetName);
}
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException
{
ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class);
var activeLaunchTarget = launchBarManager.getActiveLaunchTarget();
if (activeLaunchTarget == null) {
throw new CoreException(new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, "Active launch target is null"));
}
var targetName = activeLaunchTarget.getAttribute(LaunchBarTargetConstants.TARGET, StringUtil.EMPTY);
if (targetName == null) {
throw new CoreException(new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, "Target name is null"));
}
return IDFUtil.getXtensaToolchainExecutablePathByTarget(targetName);
}

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0074f19 and 00146d9.

Files selected for processing (8)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (15 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (19 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (2 hunks)
Files skipped from review as they are similar to previous changes (6)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java
  • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java
Additional comments not posted (11)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (2)

42-42: Import statement change approved.

The import for LaunchBarTargetConstants is necessary for the changes in the method getToolchainExePathForActiveTarget.


374-374: Method change approved.

The method now uses LaunchBarTargetConstants.TARGET instead of IDFLaunchConstants.ATTR_IDF_TARGET, aligning with the new approach for accessing launch target attributes.

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (9)

71-75: Import statement changes approved.

The imports for JtagDynamicVariable, OpenocdDynamicVariable, StyledInfoText, and TextWithButton are necessary for the new UI components and dynamic variables used in the class.


91-93: Class variable changes approved.

The variables uartAgrumentsField, jtagArgumentsField, and dfuArgumentsField have been changed from Text to TextWithButton, enhancing the UI.


Line range hint 148-172:
Method change approved.

The method createArgumentComponent now accepts TextWithButton instead of Text, aligning with the updated class variables and enhancing the UI.


192-192: Method change approved.

The method handleVariablesButtonSelected now uses TextWithButton instead of Text, aligning with the updated class variables and the new UI components.


229-229: Method change approved.

The method createUartComposite now uses TextWithButton for uartAgrumentsField, aligning with the updated class variables and enhancing the UI.


251-251: Method change approved.

The method createJtagflashComposite now uses TextWithButton for jtagArgumentsField, aligning with the updated class variables and enhancing the UI.


277-277: Method change approved.

The method createDfuArgumentField now uses TextWithButton for dfuArgumentsField, aligning with the updated class variables and enhancing the UI.


621-622: Method change approved.

The method updateArgumentsWithDefaultFlashCommand now sets the text for jtagArgumentsField using DEFAULT_JTAG_CONFIG_OPTIONS, simplifying the logic.


685-687: Method change approved.

The method initializeFromDefaults now sets the text for uartAgrumentsField, jtagArgumentsField, and dfuArgumentsField using default values, enhancing usability.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 00146d9 and efb414b.

Files selected for processing (2)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (4 hunks)
Files skipped from review as they are similar to previous changes (2)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java

@sigmaaa sigmaaa changed the title WIP: IEP-1297 Consolidate information about the target and board in one place IEP-1297 Consolidate information about the target and board in one place Aug 7, 2024
Copy link
Collaborator

@alirana01 alirana01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of the code LGTM just a minor question I will test the functionality and will update the final approval from my side

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sigmaaa wouldn't it be better to have a single enum for all these variables?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (8)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java (1)

55-60: Add tests for getDefaultBoard method

The getDefaultBoard method in DefaultBoardProvider is not currently being tested, either directly or indirectly. It is recommended to add unit tests to ensure its functionality is verified.

  • Verify and add tests for getDefaultBoard in DefaultBoardProvider.
Analysis chain

Verify the usage and testing of getDefaultBoard.

The new method getDefaultBoard enhances the class's functionality. Ensure it is tested and used correctly.

Run the following script to check for references to getDefaultBoard and its usage in tests:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage and testing of `getDefaultBoard`.

# Test: Search for references to `getDefaultBoard`. Expect: Occurrences in implementation and tests.
rg --type java 'getDefaultBoard'

Length of output: 708


Script:

#!/bin/bash
# Description: Verify testing of `getDefaultBoard`.

# Test: Search for references to `getDefaultBoard` in test files. Expect: Occurrences in test files.
rg --type java 'getDefaultBoard' --glob '*Test.java'

Length of output: 52


Script:

#!/bin/bash
# Description: Verify indirect testing of `getDefaultBoard` through related classes.

# Test: Search for test files related to `ESPToolChainManager` and `JtagVariableResolver`.
rg --type java 'ESPToolChainManager|JtagVariableResolver' --glob '*Test.java'

Length of output: 79

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (2)

33-33: Add a comment for the new constant.

Consider adding a comment to explain the purpose of the EXECUTABLE_NAME constant for better readability.

// Constant for storing the OpenOCD executable name
private static final String EXECUTABLE_NAME = "executable.name"; //$NON-NLS-1$

56-57: Update tests to expect full executable path

The change to return the full path of the OpenOCD executable affects the OpenocdVariableResolverTest, which currently expects only the executable name. Update the test to expect the full path to ensure compatibility.

  • Update OPENOCD_EXE_EXPECTED in OpenocdVariableResolverTest.java to match the full path return.
Analysis chain

Verify the impact of returning the full executable path.

The change to return the full path of the OpenOCD executable might affect downstream code. Verify that this change is compatible with all usages of OPENOCD_EXE.

Run the following script to verify the usage of OPENOCD_EXE:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `OPENOCD_EXE` in the codebase.

# Test: Search for the usage of `OPENOCD_EXE`. Expect: Compatible with full path return.
rg --type java -A 5 $'OPENOCD_EXE'

Length of output: 4164

bundles/com.espressif.idf.core/plugin.xml (3)

321-325: Add documentation for new variable JTAG_FLASH_ARGS.

The new variable JTAG_FLASH_ARGS has been introduced. Ensure that its purpose and usage are documented properly in the relevant documentation files.


326-330: Add documentation for new variable GDB_CLIENT_EXECUTABLE.

The new variable GDB_CLIENT_EXECUTABLE has been introduced. Ensure that its purpose and usage are documented properly in the relevant documentation files.


313-313: Inconsistent Variable Name Usage Detected

The variable name openocd_exe has not been fully replaced with openocd_executable throughout the codebase. Please update the following occurrences to ensure consistency:

  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/util/ESPFlashUtil.java
  • bundles/com.espressif.idf.core/plugin.xml
  • bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties
Analysis chain

Clarify the variable name change.

The variable name openocd_exe has been changed to openocd_executable. Ensure that this change is reflected throughout the codebase to avoid any inconsistencies.

Run the following script to verify the usage of openocd_executable:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all occurrences of `openocd_executable` in the codebase.

# Test: Search for the variable usage. Expect: Only occurrences of the new name.
rg --type xml --type java --type properties 'openocd_executable'

Length of output: 99


Script:

#!/bin/bash
# Description: Verify all occurrences of `openocd_executable` and `openocd_exe` in the codebase.

# Search for the new variable name
rg --type xml --type java 'openocd_executable'

# Search for the old variable name to ensure it has been replaced
rg --type xml --type java 'openocd_exe'

Length of output: 3473

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties (1)

127-129: Ensure clarity in new UI text entries.

The new entries DebuggerTab.gdbOtherOptionsBrowse, DebuggerTab.gdbOtherOptionsBrowse_Title, and DebuggerTab.gdbOtherOptionsVariable enhance the UI. Ensure that the text is clear and consistent with existing UI elements.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (1)

248-248: Improve error handling in removeMatchedToolChain.

Consider adding more specific error handling or logging to provide additional context in case of failure.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between efb414b and 978fd0a.

Files ignored due to path filters (2)
  • bundles/com.espressif.idf.swt.custom/icons/hide.png is excluded by !**/*.png
  • bundles/com.espressif.idf.swt.custom/icons/show.png is excluded by !**/*.png
Files selected for processing (56)
  • bundles/.classpath (1 hunks)
  • bundles/.settings/org.eclipse.jdt.core.prefs (1 hunks)
  • bundles/.settings/org.eclipse.pde.core.prefs (1 hunks)
  • bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties (1 hunks)
  • bundles/com.espressif.idf.core/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (15 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/DfuCommandsUtil.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (4 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/SvdPathResolver.java (3 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java (4 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java (19 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties (1 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/SerialFlashLaunchTargetProvider.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunch.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (20 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (5 hunks)
  • bundles/com.espressif.idf.swt.custom/.classpath (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.gitignore (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.project (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.core.resources.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.jdt.core.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.pde.core.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.swt.custom/OSGI-INF/l10n/bundle.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/build.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.swt.custom/pom.xml (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/Messages.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/messages.properties (1 hunks)
  • bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/controls/SerialSettingsPage.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/WriteFlashDialog.java (3 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (2 hunks)
  • bundles/pom.xml (1 hunks)
  • features/com.espressif.idf.feature/feature.xml (1 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java (3 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java (3 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java (5 hunks)
Files skipped from review due to trivial changes (18)
  • bundles/.classpath
  • bundles/.settings/org.eclipse.jdt.core.prefs
  • bundles/.settings/org.eclipse.pde.core.prefs
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java
  • bundles/com.espressif.idf.swt.custom/.classpath
  • bundles/com.espressif.idf.swt.custom/.gitignore
  • bundles/com.espressif.idf.swt.custom/.project
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.core.resources.prefs
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.jdt.core.prefs
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.pde.core.prefs
  • bundles/com.espressif.idf.swt.custom/OSGI-INF/l10n/bundle.properties
  • bundles/com.espressif.idf.swt.custom/build.properties
  • bundles/com.espressif.idf.swt.custom/plugin.xml
  • bundles/com.espressif.idf.swt.custom/pom.xml
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/messages.properties
Additional comments not posted (77)
bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/Messages.java (1)

1-20: LGTM! The Messages class is correctly implemented.

The class follows the standard pattern for internationalization using Eclipse's NLS. The static block initializes the messages, and the private constructor prevents instantiation.

bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java (1)

1-26: LGTM! The Activator class is correctly implemented.

The class correctly implements the BundleActivator interface, managing the bundle's lifecycle by setting and clearing the context.

bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF (1)

1-19: LGTM! The OSGi manifest is well-structured.

The manifest specifies necessary metadata and dependencies for the OSGi bundle, ensuring integration with the Eclipse environment.

bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties (1)

6-8: LGTM! The configuration options are well-documented.

The additions enhance configuration clarity by providing detailed descriptions of dynamic variables used in JTAG and GDB operations.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java (1)

1-22: LGTM! The LaunchBarTargetConstants class is well-structured.

The class provides a centralized location for constants related to launch configurations, and the private constructor prevents instantiation.

bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF (1)

25-26: Verify the impact of the added package dependency.

The addition of com.espressif.idf.swt.custom may introduce new functionality or dependencies. Ensure that all components relying on this package are functioning correctly.

Run the following script to check for usage of the com.espressif.idf.swt.custom package:

Verification successful

Package Dependency Impact Verified

The com.espressif.idf.swt.custom package is actively used in the codebase, specifically in TabDebugger.java and CMakeMainTab2.java. The classes StyledInfoText and TextWithButton are utilized for UI components, confirming the package's integration and functionality. No issues were found with the added dependency.

  • TabDebugger.java: Uses StyledInfoText and TextWithButton for UI interactions.
  • CMakeMainTab2.java: Utilizes StyledInfoText and TextWithButton for argument handling and UI components.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of the newly added package dependency.

# Test: Search for the usage of the package. Expect: Occurrences of the package usage.
rg --type java 'com\.espressif\.idf\.swt\.custom'

Length of output: 1082


Script:

#!/bin/bash
# Description: Check usage of StyledInfoText and TextWithButton in TabDebugger.java and CMakeMainTab2.java

# Search for usage of StyledInfoText in TabDebugger.java
rg --type java 'StyledInfoText' -A 5 bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java

# Search for usage of TextWithButton in TabDebugger.java
rg --type java 'TextWithButton' -A 5 bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java

# Search for usage of StyledInfoText in CMakeMainTab2.java
rg --type java 'StyledInfoText' -A 5 bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java

# Search for usage of TextWithButton in CMakeMainTab2.java
rg --type java 'TextWithButton' -A 5 bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java

Length of output: 5217

bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/SerialFlashLaunchTargetProvider.java (1)

Line range hint 1-1: Verify the impact of removed constants.

The removal of ATTR_SERIAL_PORT and ATTR_IDF_TARGET may affect functionality. Ensure that any references to these constants are updated to maintain functionality.

Run the following script to check for references to the removed constants:

Verification successful

No Impact from Removed Constants

The constants ATTR_SERIAL_PORT and ATTR_IDF_TARGET have been removed and are not referenced anywhere in the codebase, indicating that their removal does not affect functionality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify references to removed constants.

# Test: Search for references to the removed constants. Expect: No occurrences.
rg --type java 'ATTR_SERIAL_PORT|ATTR_IDF_TARGET'

Length of output: 51


Script:

#!/bin/bash
# Description: Verify references to removed constants in non-Java files and configuration files.

# Test: Search for references to the removed constants in all files.
rg 'ATTR_SERIAL_PORT|ATTR_IDF_TARGET'

Length of output: 39

bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF (1)

45-46: Verify the impact of the added package dependency.

The addition of com.espressif.idf.swt.custom may introduce new functionality or dependencies. Ensure that all components relying on this package are functioning correctly.

Run the following script to check for usage of the com.espressif.idf.swt.custom package:

bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java (1)

40-43: Verify the initialization and usage of EspConfigParser.

The introduction of EspConfigParser enhances functionality. Ensure that it is correctly initialized and utilized throughout the codebase.

Run the following script to check for references to EspConfigParser and its usage:

Verification successful

EspConfigParser is correctly initialized and used across the codebase.

The EspConfigParser is initialized and its methods are invoked in various parts of the codebase, such as DefaultBoardProvider, NewSerialFlashTargetWizardPage, NewProjectCreationWizardPage, and ESPFlashUtil. The methods are used to retrieve board configurations and targets, confirming its proper utilization.

  • Files and Methods:
    • DefaultBoardProvider: getBoardsConfigs
    • NewSerialFlashTargetWizardPage: getBoardsConfigs
    • NewProjectCreationWizardPage: getTargets
    • ESPFlashUtil: hasBoardConfigJson
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify initialization and usage of `EspConfigParser`.

# Test: Search for references to `EspConfigParser`. Expect: Occurrences of initialization and usage.
rg --type java 'EspConfigParser'

Length of output: 2068


Script:

#!/bin/bash
# Description: Search for method calls on instances of `EspConfigParser`.

# Test: Find method calls on `EspConfigParser` instances.
rg --type java '\.espConfigParser\.\w+\(' -A 2
rg --type java 'EspConfigParser parser = new EspConfigParser\(\);' -A 5

Length of output: 4549

bundles/pom.xml (1)

33-33: Addition of new module approved.

The addition of com.espressif.idf.swt.custom enhances the project's modular structure. Ensure that this module is correctly integrated and tested.

bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunch.java (1)

Line range hint 29-44: Refactoring approved for constant centralization.

The refactoring to use LaunchBarTargetConstants centralizes constant definitions, enhancing maintainability without affecting functionality.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java (2)

23-25: Private constructor addition approved.

Adding a private constructor to LaunchTargetHelper prevents instantiation, aligning with best practices for utility classes.


Line range hint 15-61: Refactoring to use centralized constants approved.

Updating references to use LaunchBarTargetConstants improves maintainability and clarity.

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java (2)

29-35: Refactoring for consistency approved.

The refactoring to place braces on a new line enhances readability and adheres to a conventional coding style.


59-62: Introduction of new attributes approved.

The addition of BOARD and FLASH_VOLTAGE attributes expands configuration options, improving functionality.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1)

1-84: Implementation of JtagVariableResolver approved.

The use of modern Java features and centralized constants enhances readability and maintainability. Ensure thorough testing of the resolver functionality.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (2)

48-53: Ensure proper error handling for configuration retrieval.

The getActiveLaunchConfiguration method may return null, which could lead to a NullPointerException when used in getOpenocdBinPath. Consider adding a null check or handling this case.

Ensure that the getActiveLaunchConfiguration method is always returning a valid configuration or handle the null case appropriately.


90-95: Ensure the executable path is valid.

The getOpenocdExecutable method retrieves the executable name and constructs a path. Ensure that the path is valid and exists in the expected location.

Verify that the executable path constructed is valid and points to an existing file.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/SvdPathResolver.java (2)

48-48: Ensure the target attribute retrieval is correct.

The retrieval of the target attribute using LaunchBarTargetConstants.TARGET should be verified to ensure it aligns with the expected behavior.

Verify that the target attribute retrieval is functioning correctly and aligns with the expected behavior.


26-26: Verify the impact of the import change.

The import of IDFLaunchConstants has been replaced with LaunchBarTargetConstants. Ensure that this change is compatible with all usages of the constants.

Run the following script to verify the usage of LaunchBarTargetConstants:

Verification successful

Import Change Verified: Compatible with Usages

The import change from IDFLaunchConstants to LaunchBarTargetConstants is compatible with all usages in the codebase. The constants are used consistently across various files without any issues.

  • The constants like TARGET, SERIAL_PORT, and BOARD are used as expected in the context of launch target attributes.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `LaunchBarTargetConstants` in the codebase.

# Test: Search for the usage of `LaunchBarTargetConstants`. Expect: Compatible with the new import.
rg --type java -A 5 $'LaunchBarTargetConstants'

Length of output: 51385

tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java (3)

32-32: Clarify the constant value.

The OPENOCD_EXE_EXPECTED constant has been simplified. Ensure that this change aligns with the expected test scenarios.

Verify that the constant value change aligns with the expected test scenarios.


60-60: Ensure the expected result is correct.

The expected result in the resolveValue_on_openocd_path_dynamic_variable_returns_openocd_path test method has been adjusted. Verify that this change reflects the correct expected behavior.

Verify that the expected result change aligns with the correct expected behavior.


106-110: Ensure the new method aligns with the logic.

The new getOpenocdExecutable method encapsulates the logic for retrieving the executable path. Ensure that this method aligns with the intended logic and test scenarios.

Verify that the new method aligns with the intended logic and test scenarios.

bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java (2)

32-88: Ensure proper resource disposal.

The image resources are disposed of in the addDisposeListener. Ensure that this approach is consistently applied and that no resources are left undisposed.

The approach for disposing of image resources is appropriate.


84-87: Verify the disposal of image resources.

The addDisposeListener method disposes of image resources. Verify that this method is correctly disposing of all resources.

Verify that the addDisposeListener method is correctly disposing of all resources.

bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java (2)

71-89: Ensure proper resource management.

The addAllListeners method manages image resources. Ensure that all resources are correctly managed and disposed of.

The resource management approach in addAllListeners is appropriate.


92-99: Verify the disposal of image resources.

The addDisposeListener method disposes of image resources. Verify that this method is correctly disposing of all resources.

Verify that the addDisposeListener method is correctly disposing of all resources.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/DfuCommandsUtil.java (3)

42-44: Good practice: Private constructor for utility class.

The addition of a private constructor is a good practice for utility classes, preventing instantiation.


69-73: Use of lambda expression improves readability.

Replacing the anonymous inner class with a lambda expression in isDfuSupported enhances code readability and conciseness.


81-81: Improved maintainability with constant usage.

Using LaunchBarTargetConstants.TARGET instead of a hardcoded string improves maintainability and reduces the risk of errors.

tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java (2)

94-95: Improved clarity with constant usage.

Replacing string literals with LaunchBarTargetConstants improves clarity and reduces potential errors due to typos.


116-117: Consistency in constant usage.

The use of LaunchBarTargetConstants ensures consistency across the codebase, aligning with recent refactoring efforts.

bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/controls/SerialSettingsPage.java (2)

72-72: Simplified code by removing unnecessary variable.

Directly retrieving the port name from dialogSettings without storing it in a variable simplifies the code.


82-82: Enhanced maintainability with constant usage.

Using LaunchBarTargetConstants.SERIAL_PORT instead of a hardcoded string enhances maintainability and reduces errors.

tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java (7)

77-80: Improved clarity with constant usage.

The use of LaunchBarTargetConstants enhances clarity and consistency in the test code.


88-89: Consistency in constant usage.

The consistent use of LaunchBarTargetConstants aligns with the refactoring efforts and improves code maintainability.


100-107: Refactored for clarity and maintainability.

Refactoring to use LaunchBarTargetConstants enhances clarity and reduces the risk of errors.


115-116: Consistency in constant usage.

The consistent use of LaunchBarTargetConstants aligns with the refactoring efforts and improves code maintainability.


128-135: Refactored for clarity and maintainability.

Refactoring to use LaunchBarTargetConstants enhances clarity and reduces the risk of errors.


143-143: Consistency in constant usage.

The consistent use of LaunchBarTargetConstants aligns with the refactoring efforts and improves code maintainability.


152-152: Improved clarity with constant usage.

Using LaunchBarTargetConstants enhances clarity and consistency in the test code.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java (1)

90-90: Simplified logic with constant usage.

Using LaunchBarTargetConstants.TARGET instead of a hardcoded string simplifies the logic and enhances maintainability.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (1)

278-278: Verify the impact of changing the target identifier source.

The change from IDFLaunchConstants.ATTR_IDF_TARGET to LaunchBarTargetConstants.TARGET may affect how targets are identified. Ensure that this change is compatible with the rest of the system and does not introduce any inconsistencies.

Run the following script to verify the usage of LaunchBarTargetConstants.TARGET across the codebase:

Verification successful

Change to LaunchBarTargetConstants.TARGET is consistent and tested across the codebase.

The usage of LaunchBarTargetConstants.TARGET is consistent across various components and is covered by tests, indicating that the change is compatible with the rest of the system. No inconsistencies were found.

  • Files where LaunchBarTargetConstants.TARGET is used:
    • LaunchBarListener
    • NewSerialFlashTargetWizard
    • LaunchTargetHelper
    • IDFUtil
    • DfuCommandsUtil
    • JtagVariableResolver
    • GdbClientVariableResolver
    • ESPToolChainManager
    • SvdPathResolver
    • IDFBuildConfiguration
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `LaunchBarTargetConstants.TARGET` across the codebase.

# Test: Search for the usage of `LaunchBarTargetConstants.TARGET`. Expect: Consistent usage.
rg --type java -A 5 $'LaunchBarTargetConstants.TARGET'

Length of output: 21771

bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java (2)

95-96: Centralize serial port attribute retrieval.

The retrieval of the serialPort using LaunchBarTargetConstants.SERIAL_PORT centralizes the constant definition, improving maintainability.


99-100: Ensure DFU target support before flashing.

The logic now checks if the target supports DFU before proceeding with the flashing operation, enhancing robustness.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java (1)

22-24: Leverage dynamic variables for configurability.

The introduction of dynamic variables (GdbClientDynamicVariable, JtagDynamicVariable, OpenocdDynamicVariable) enhances configurability.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/WriteFlashDialog.java (2)

153-159: Utilize pattern matching for instanceof checks.

The use of pattern matching for instanceof checks simplifies the syntax and reduces the need for explicit casting.


176-177: Centralize serial port constant definition.

Replacing ATTR_SERIAL_PORT with LaunchBarTargetConstants.SERIAL_PORT centralizes the constant definition, improving maintainability.

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (3)

73-75: Introduce new fields for configuration management.

The new fields serialPort, fBoardCombo, and fFlashVoltage enhance the management of serial ports and board configurations.


115-127: Dynamically update board configurations.

The event handling for idfTargetCombo now dynamically updates fBoardCombo based on the selected target, improving responsiveness.


253-272: Create JTAG settings group.

The createJtagGroup method sets up UI components for JTAG configurations, enhancing user experience.

features/com.espressif.idf.feature/feature.xml (1)

164-166: Ensure the new plugin com.espressif.idf.swt.custom is properly integrated.

The new plugin com.espressif.idf.swt.custom has been added. Verify that it is correctly integrated into the build and deployment processes.

Run the following script to verify the integration of the new plugin:

Verification successful

Plugin com.espressif.idf.swt.custom is integrated into the Maven build process.

The plugin com.espressif.idf.swt.custom is referenced in several XML files, including feature.xml and pom.xml files, indicating its integration into the Maven build process. No further action is required unless additional integration is needed in other build systems.

  • features/com.espressif.idf.feature/feature.xml
  • bundles/pom.xml
  • bundles/com.espressif.idf.swt.custom/pom.xml
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of the new plugin `com.espressif.idf.swt.custom`.

# Test: Search for the plugin usage. Expect: Proper integration in build scripts and configuration files.
rg --type xml --type properties 'com.espressif.idf.swt.custom'

Length of output: 97


Script:

#!/bin/bash
# Description: Verify the integration of the new plugin `com.espressif.idf.swt.custom`.

# Test: Search for the plugin usage. Expect: Proper integration in build scripts and configuration files.
rg --type xml 'com.espressif.idf.swt.custom'
rg --type gradle 'com.espressif.idf.swt.custom'
rg --type maven 'com.espressif.idf.swt.custom'

Length of output: 680

bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (5)

418-418: Use modern Java features for list creation.

The method getAvailableEspTargetList uses stream().toList(). Ensure that this is compatible with the Java version in use.


434-434: Use modern Java features for list creation.

The method getAllEspToolchains uses stream().toList(). Ensure that this is compatible with the Java version in use.


489-491: Ensure default values are appropriate.

The attributes LaunchBarTargetConstants.FLASH_VOLTAGE and LaunchBarTargetConstants.BOARD are set with default values. Verify that these defaults are suitable for all use cases.


536-538: Ensure default values are appropriate.

The attributes LaunchBarTargetConstants.FLASH_VOLTAGE and LaunchBarTargetConstants.BOARD are set with default values. Verify that these defaults are suitable for all use cases.


45-49: Verify the impact of new imports.

The imports DefaultBoardProvider and LaunchBarTargetConstants have been added. Ensure that these are necessary and correctly used in the code.

Run the following script to verify the usage of the new imports:

Verification successful

Imports are necessary and correctly used.

The imports DefaultBoardProvider and LaunchBarTargetConstants are utilized within the ESPToolChainManager.java file and other parts of the codebase, confirming their necessity and correct usage.

  • ESPToolChainManager.java: Utilizes both imports effectively.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `DefaultBoardProvider` and `LaunchBarTargetConstants`.

# Test: Search for the usage of the new imports. Expect: Proper utilization in the code.
rg --type java 'DefaultBoardProvider|LaunchBarTargetConstants'

Length of output: 15358

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (2)

374-374: Ensure compatibility with updated logic.

The method getToolchainExePathForActiveTarget now uses LaunchBarTargetConstants.TARGET. Verify that this change aligns with the intended functionality and does not introduce any regressions.


42-42: Verify the impact of new import.

The import LaunchBarTargetConstants has been added. Ensure that it is necessary and correctly used in the code.

Run the following script to verify the usage of the new import:

Verification successful

Import LaunchBarTargetConstants is necessary and correctly used.

The import LaunchBarTargetConstants is actively utilized across multiple files, including IDFUtil.java, confirming its necessity in the codebase. The usage is consistent and appropriate.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `LaunchBarTargetConstants`.

# Test: Search for the usage of the new import. Expect: Proper utilization in the code.
rg --type java 'LaunchBarTargetConstants'

Length of output: 13391

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (8)

71-75: Imports for new UI components are appropriate.

The new imports for TextWithButton and StyledInfoText are necessary for the updated UI components.


91-93: Field type changes to TextWithButton are appropriate.

Changing the fields to TextWithButton enhances the UI by providing additional button functionality.


Line range hint 148-172: Method signature update to TextWithButton is consistent.

The method now accepts TextWithButton, aligning with the updated field types and ensuring consistent usage.


192-194: Method parameter update to TextWithButton is consistent.

Updating the parameter to TextWithButton ensures proper handling of variable insertion with the new component.


229-229: Initialization of uartAgrumentsField as TextWithButton is correct.

The initialization aligns with the field type change and ensures correct UI setup.


251-251: Initialization of jtagArgumentsField as TextWithButton is correct.

The initialization aligns with the field type change and ensures correct UI setup.


277-277: Initialization of dfuArgumentsField as TextWithButton is correct.

The initialization aligns with the field type change and ensures correct UI setup.


764-769: Default value initialization for argument fields is appropriate.

Setting default values ensures the fields are initialized with appropriate commands, enhancing usability.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3)

84-84: Import for LaunchBarTargetConstants is appropriate.

The import is necessary for the updated target name retrieval logic.


519-521: Centralized target name retrieval is an improvement.

Using LaunchBarTargetConstants.TARGET centralizes the target constant reference, enhancing maintainability.


655-656: Attribute retrieval using LaunchBarTargetConstants.TARGET is consistent.

This change aligns with the centralized target constant reference, improving consistency.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java (7)

73-74: Imports for new UI components are appropriate.

The new imports for TextWithButton and StyledInfoText are necessary for the updated UI components.


91-102: Field type changes to TextWithButton are appropriate.

Changing the fields to TextWithButton enhances the UI by providing additional button functionality.


170-174: Addition of StyledInfoText enhances user interaction.

The StyledInfoText component provides informative text with an associated action, improving user experience.


220-230: Method parameter update to TextWithButton is consistent.

Updating the parameter to TextWithButton ensures consistent usage with the new component.


233-238: Method parameter update to TextWithButton is consistent.

Updating the parameter to TextWithButton ensures proper handling of variable insertion with the new component.


Line range hint 374-443: Initialization and event handling for fGdbServerOtherOptions are appropriate.

The initialization aligns with the field type change, and the event handling improves user experience by providing dynamic tooltips.


Line range hint 1007-1028: Default value initialization for argument fields is appropriate.

Setting default values ensures the fields are initialized with appropriate commands, enhancing usability.

@alirana01
Copy link
Collaborator

Hi @sigmaaa
I am getting this error when trying to flash with JTAG
image

Just on a side note I was able to flash and debug with all the default options fine.
This occurred when I made a very minor change in the main file and compiled and tried changing the option from UART to JTAG in the launch configuration.
image

@sigmaaa
Copy link
Collaborator Author

sigmaaa commented Aug 21, 2024

Hi @sigmaaa I am getting this error when trying to flash with JTAG image

Just on a side note I was able to flash and debug with all the default options fine. This occurred when I made a very minor change in the main file and compiled and tried changing the option from UART to JTAG in the launch configuration. image

Hi @alirana01,
thanks for noticing that. I forgot to change the DEFAULT_ARGUMENT_PREFIX after refactoring. Fixed in the latest commit

@sigmaaa sigmaaa requested a review from alirana01 August 21, 2024 13:12
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 978fd0a and 3bb1d8b.

Files selected for processing (1)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/util/ESPFlashUtil.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/util/ESPFlashUtil.java

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3bb1d8b and 10d34e9.

Files selected for processing (2)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java (4 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java (19 hunks)
Files skipped from review as they are similar to previous changes (2)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java

@alirana01
Copy link
Collaborator

Hi @alirana01, thanks for noticing that. I forgot to change the DEFAULT_ARGUMENT_PREFIX after refactoring. Fixed in the latest commit

Hi @sigmaaa tested it with basic build flash and debug seems to be working fine Please see if you can verify DFU I currently dont have the board with me to verify that.

Also when switching from to this branch from an other branch's workspace the launch configs seems to be working fine.

All tests done on windows

@sigmaaa
Copy link
Collaborator Author

sigmaaa commented Aug 23, 2024

tested dfu, seems to be working fine

@kolipakakondal kolipakakondal added the needs translation:CN Chinese translation is required label Aug 26, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 10d34e9 and 178d191.

Files selected for processing (1)
  • bundles/com.espressif.idf.swt.custom/build.properties (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundles/com.espressif.idf.swt.custom/build.properties

@AndriiFilippov
Copy link
Collaborator

@sigmaaa hi !

Tested under:
OS - Windows 11
ESP-IDF: v5.3

create project -> build ESP32 target -> edit target -> change target to any -> click "Finish" -> no pop-up to delete "build" folder
image

but if you repeat actions -> go "Edit" target again -> click "Finish" -> pop-up appears

@sigmaaa
Copy link
Collaborator Author

sigmaaa commented Aug 29, 2024

@sigmaaa hi !

Tested under: OS - Windows 11 ESP-IDF: v5.3

create project -> build ESP32 target -> edit target -> change target to any -> click "Finish" -> no pop-up to delete "build" folder image

but if you repeat actions -> go "Edit" target again -> click "Finish" -> pop-up appears

Hi @AndriiFilippov,
fixed in the latest commit

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 178d191 and 7c8b8e2.

Files selected for processing (3)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/Messages.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/messages.properties (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/messages.properties
Files skipped from review as they are similar to previous changes (1)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java
Additional comments not posted (1)
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/Messages.java (1)

60-61: LGTM! Ensure proper initialization.

The addition of the new variable AddingTargetJobName is straightforward and aligns with the existing pattern in the class. Ensure that this variable is properly initialized elsewhere in the codebase.

@kolipakakondal
Copy link
Collaborator

I see the following error in the console when I try to click on the launch target gear icon and no prompt dialog appeared.

STACK 0
com.fazecast.jSerialComm.SerialPortInvalidPortException: Unable to create a serial port object from the invalid port descriptor: /dev/cu.usbmodem2101
	at com.fazecast.jSerialComm.SerialPort.getCommPort(SerialPort.java:410)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.setDefaultSerialPort(NewSerialFlashTargetWizardPage.java:238)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.setDefaults(NewSerialFlashTargetWizardPage.java:192)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.createControl(NewSerialFlashTargetWizardPage.java:181)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:180)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:637)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1092)
	at org.eclipse.jface.window.Window.open(Window.java:788)
	at org.eclipse.launchbar.ui.internal.target.LaunchTargetUIManager.editLaunchTarget(LaunchTargetUIManager.java:133)
	at org.eclipse.launchbar.ui.controls.internal.TargetSelector.handleEdit(TargetSelector.java:154)
	at org.eclipse.launchbar.ui.controls.internal.CSelector$5.lambda$0(CSelector.java:265)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4382)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4005)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
Caused by: java.io.IOException
	at com.fazecast.jSerialComm.SerialPort.getCommPort(SerialPort.java:407)

@kolipakakondal
Copy link
Collaborator

serial_port variable value has not shown

image

Copy link
Collaborator

@kolipakakondal kolipakakondal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the @sigmaaa LGTM

bundles/.classpath Outdated Show resolved Hide resolved
bundles/.settings/org.eclipse.jdt.core.prefs Outdated Show resolved Hide resolved
bundles/.settings/org.eclipse.pde.core.prefs Outdated Show resolved Hide resolved
org.eclipse.jface,
org.eclipse.core.variables,
org.eclipse.equinox.registry,
com.espressif.idf.core,
Copy link
Collaborator

@kolipakakondal kolipakakondal Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need com.espressif.idf.core for this? If possible, avoid this as both should be at the same level in the dependency hierarchy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kolipakakondal, we are using Logger from the core plugin to track the exceptions. I think it's ok, since we don't need any custom swt elements in the core plugin

@AndriiFilippov
Copy link
Collaborator

@sigmaaa hi !

Tested under:
OS - Windows 11

small UI fix:
when window is minimized - no port info visible.
image

@AndriiFilippov
Copy link
Collaborator

AndriiFilippov commented Aug 30, 2024

@sigmaaa hi !

shouldn't it be "read only" ?
image

@kolipakakondal
Copy link
Collaborator

@sigmaaa hi !

shouldn't it be "read only" ? image

This was added to support creating a new target that is not yet available in the IDE. For example, the esp32p4 target is still not available in the IDE, but users can manually add it and build projects.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7c8b8e2 and 4f4923b.

Files ignored due to path filters (2)
  • bundles/com.espressif.idf.swt.custom/icons/hide.png is excluded by !**/*.png
  • bundles/com.espressif.idf.swt.custom/icons/show.png is excluded by !**/*.png
Files selected for processing (57)
  • bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties (1 hunks)
  • bundles/com.espressif.idf.core/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (15 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/DfuCommandsUtil.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java (4 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/UartDynamicVariable.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/UartVariableResolver.java (1 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/SvdPathResolver.java (3 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java (4 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java (19 hunks)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties (1 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/SerialFlashLaunchTargetProvider.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunch.java (2 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java (3 hunks)
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/util/ESPFlashUtil.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java (20 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/Messages.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (5 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/messages.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.classpath (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.gitignore (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.project (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.jdt.core.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.pde.core.prefs (1 hunks)
  • bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.swt.custom/OSGI-INF/l10n/bundle.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/build.properties (1 hunks)
  • bundles/com.espressif.idf.swt.custom/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.swt.custom/pom.xml (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/Messages.java (1 hunks)
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/messages.properties (1 hunks)
  • bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/controls/SerialSettingsPage.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/WriteFlashDialog.java (3 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (2 hunks)
  • bundles/pom.xml (1 hunks)
  • features/com.espressif.idf.feature/feature.xml (1 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java (3 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java (3 hunks)
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java (5 hunks)
Files not reviewed due to server errors (3)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java
Files skipped from review due to trivial changes (22)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/LaunchBarTargetConstants.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFLaunchConstants.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagDynamicVariable.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdDynamicVariable.java
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/META-INF/MANIFEST.MF
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunch.java
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/util/ESPFlashUtil.java
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/Messages.java
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/messages.properties
  • bundles/com.espressif.idf.swt.custom/.classpath
  • bundles/com.espressif.idf.swt.custom/.project
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.jdt.core.prefs
  • bundles/com.espressif.idf.swt.custom/.settings/org.eclipse.pde.core.prefs
  • bundles/com.espressif.idf.swt.custom/META-INF/MANIFEST.MF
  • bundles/com.espressif.idf.swt.custom/OSGI-INF/l10n/bundle.properties
  • bundles/com.espressif.idf.swt.custom/build.properties
  • bundles/com.espressif.idf.swt.custom/plugin.xml
  • bundles/com.espressif.idf.swt.custom/pom.xml
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/messages.properties
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/LaunchBarListener.java
  • bundles/pom.xml
Files skipped from review as they are similar to previous changes (29)
  • bundles/com.espressif.idf.core/OSGI-INF/l10n/bundle.properties
  • bundles/com.espressif.idf.core/plugin.xml
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/DefaultBoardProvider.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/DfuCommandsUtil.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LaunchTargetHelper.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/GdbClientVariableResolver.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/SerialFlashLaunchTargetProvider.java
  • bundles/com.espressif.idf.launch.serial.core/src/com/espressif/idf/launch/serial/internal/SerialFlashLaunchConfigDelegate.java
  • bundles/com.espressif.idf.launch.serial.ui/META-INF/MANIFEST.MF
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/CMakeMainTab2.java
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizard.java
  • bundles/com.espressif.idf.swt.custom/.gitignore
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/Activator.java
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/StyledInfoText.java
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java
  • bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/messages/Messages.java
  • bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/controls/SerialSettingsPage.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/WriteFlashDialog.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java
  • features/com.espressif.idf.feature/feature.xml
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/actions/test/ApplyTargetJobTest.java
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/test/OpenocdVariableResolverTest.java
  • tests/com.espressif.idf.core.test/src/com/espressif/idf/core/util/test/LaunchBarNameUtilTest.java
Additional comments not posted (6)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/UartDynamicVariable.java (1)

3-18: Enum Definition Approved

The UartDynamicVariable enum is correctly implemented. It encapsulates UART-related dynamic variables effectively.

Consider adding more documentation to explain the purpose and usage of this enum, especially if it is expected to grow with more variables.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/UartVariableResolver.java (4)

20-22: Method Implementation Approved

The resolveValue method is efficiently implemented using modern Java features to ensure null safety and clean code.


25-29: Method Implementation Approved

The getAppropriateEnumVariable method effectively uses Java's stream API to filter and find the appropriate enum value.


31-37: Method Implementation Approved

The resolveForDynamicEnum method uses modern Java switch expressions effectively. It is well-prepared to handle additional cases as the enum expands.

Consider adding more cases as new UART variables are introduced.


46-58: Method Implementation Approved

The getActiveLaunchTarget method is robust, with appropriate error handling and use of Optional to manage the absence of a target.

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/SvdPathResolver.java (1)

Line range hint 26-48: Method Implementation Approved

The resolveValue method effectively uses the new LaunchBarTargetConstants to access target attributes, aligning with the PR's objectives. The method's exception handling and logging are appropriately implemented.

Consider adding more detailed logging to aid in debugging, especially given the significant changes in how target attributes are accessed.

Copy link
Collaborator

@kolipakakondal kolipakakondal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kolipakakondal
Copy link
Collaborator

@AndriiFilippov FYI

@AndriiFilippov
Copy link
Collaborator

AndriiFilippov commented Sep 2, 2024

I see the following error in the console when I try to click on the launch target gear icon and no prompt dialog appeared.

STACK 0
com.fazecast.jSerialComm.SerialPortInvalidPortException: Unable to create a serial port object from the invalid port descriptor: /dev/cu.usbmodem2101
	at com.fazecast.jSerialComm.SerialPort.getCommPort(SerialPort.java:410)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.setDefaultSerialPort(NewSerialFlashTargetWizardPage.java:238)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.setDefaults(NewSerialFlashTargetWizardPage.java:192)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.createControl(NewSerialFlashTargetWizardPage.java:181)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:180)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:637)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1092)
	at org.eclipse.jface.window.Window.open(Window.java:788)
	at org.eclipse.launchbar.ui.internal.target.LaunchTargetUIManager.editLaunchTarget(LaunchTargetUIManager.java:133)
	at org.eclipse.launchbar.ui.controls.internal.TargetSelector.handleEdit(TargetSelector.java:154)
	at org.eclipse.launchbar.ui.controls.internal.CSelector$5.lambda$0(CSelector.java:265)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4382)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4005)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
Caused by: java.io.IOException
	at com.fazecast.jSerialComm.SerialPort.getCommPort(SerialPort.java:407)

@sigmaaa hi !
able to reproduce it. MacOS

create project - connect board - go to Edit Launch Target - select port - click "Finish" - disconnect board - click Edit Launch Target -> it stuck. Error logs same as @kolipakakondal :

com.fazecast.jSerialComm.SerialPortInvalidPortException: Unable to create a serial port object from the invalid port descriptor: /dev/cu.usbserial-120
	at com.fazecast.jSerialComm.SerialPort.getCommPort(SerialPort.java:410)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.setDefaultSerialPort(NewSerialFlashTargetWizardPage.java:238)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.setDefaults(NewSerialFlashTargetWizardPage.java:192)
	at com.espressif.idf.launch.serial.ui.internal.NewSerialFlashTargetWizardPage.createControl(NewSerialFlashTargetWizardPage.java:181)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:180)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:637)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1092)
	at org.eclipse.jface.window.Window.open(Window.java:788)
	at org.eclipse.launchbar.ui.internal.target.LaunchTargetUIManager.editLaunchTarget(LaunchTargetUIManager.java:133)
	at org.eclipse.launchbar.ui.controls.internal.TargetSelector.handleEdit(TargetSelector.java:154)
	at org.eclipse.launchbar.ui.controls.internal.CSelector$5.lambda$0(CSelector.java:265)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4382)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4005)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4f4923b and 45ae17d.

Files selected for processing (1)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (5 hunks)
Additional comments not posted (6)
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (6)

44-44: LGTM!

The added import statements are necessary for the new functionality.

Also applies to: 49-50, 53-53


73-75: LGTM!

The new fields serialPort, fBoardCombo, and fFlashVoltage are necessary for managing the additional configurations.


Line range hint 100-127: LGTM!

The changes in the createControl method improve the UI functionality by:

  • Setting the default name for the launch target.
  • Dynamically updating the fBoardCombo based on the selected target using the EspConfigParser.

250-269: LGTM!

The new createJtagGroup method enhances the functionality by allowing users to specify flash voltage and board settings directly.


273-438: LGTM!

The changes in the dispose, getter methods, and TargetPortInfo class are beneficial:

  • The dispose method ensures proper cleanup of the targetPortInfo job.
  • The new getter methods provide access to the voltage and board configurations.
  • The TargetPortInfo class has improved error handling and logging.

184-248: LGTM!

The new setDefaults, setDefaultVoltage, setDefaultTargetAndBoard, and setDefaultSerialPort methods improve code organization and readability by encapsulating the logic for setting default values.

@sigmaaa
Copy link
Collaborator Author

sigmaaa commented Sep 3, 2024

Hi @AndriiFilippov,

thanks for finding a way to reproduce it. Fixed in the latest commit. Also added new icons for dynamic variables to hide and show

@kolipakakondal kolipakakondal added this to the v3.1.0 milestone Sep 3, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 45ae17d and 3f25432.

Files ignored due to path filters (2)
  • bundles/com.espressif.idf.swt.custom/icons/hide.png is excluded by !**/*.png
  • bundles/com.espressif.idf.swt.custom/icons/show.png is excluded by !**/*.png
Files selected for processing (1)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (5 hunks)
Additional comments not posted (7)
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (7)

44-53: LGTM!

The newly imported classes are used appropriately in the code changes.


73-75: LGTM!

The new fields are used appropriately to manage the selection of serial ports and board configurations.


Line range hint 100-134: LGTM!

The changes enhance the UI to reflect the current state of the launch target and provide options for JTAG settings.


156-174: LGTM!

The changes improve the handling of serial ports and provide more information to the user.


184-248: LGTM!

The new methods encapsulate the logic for setting default values, improving code organization and readability.


250-269: LGTM!

The new method provides a dedicated section for JTAG settings, enhancing the user experience and functionality.


371-439: LGTM!

The changes improve the retrieval and display of chip information, providing more details to the user.

@AndriiFilippov
Copy link
Collaborator

@sigmaaa hi !

Tested under:
OS - Windows 11 / MacOS / Linux Ubuntu

able to create new target ✅
able to delete target ✅
able to flash / monitor ✅
able to debug ✅
able to erase flash ✅
switch from old workspace without problems ✅

LGTM 👍

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (1)

Line range hint 57-75: Refactor: Consolidate field initialization.

The fields serialPort, fBoardCombo, and fFlashVoltage are initialized separately in the constructor. Consider initializing these fields directly where they are declared to improve code cleanliness and reduce the constructor's complexity.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3f25432 and 331935e.

Files selected for processing (3)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/Messages.java (1 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (5 hunks)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/messages.properties (1 hunks)
Files skipped from review due to trivial changes (1)
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/messages.properties
Additional comments not posted (11)
bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/Messages.java (2)

54-54: New variable jtagGroupLbl added for JTAG group labeling.

This variable is intended to store a label for JTAG groups in the UI. Ensure that the corresponding message is properly defined in the properties file and that it is used consistently across the UI where JTAG settings are displayed.


61-61: New variable AddingTargetJobName added for job naming.

This variable is likely used to provide a user-friendly name for background jobs that add targets. As with jtagGroupLbl, ensure that the message is defined in the properties file and used consistently wherever relevant.

bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java (9)

77-78: Initialization of targetPortMap and targetPortInfo.

The constructor initializes targetPortMap and targetPortInfo. Ensure that these are always appropriately used throughout the class to avoid potential null pointer exceptions or logic errors.


Line range hint 88-101: Enhancement: Optimize UI component creation and event handling.

The method createControl is quite lengthy and handles multiple UI components and their event listeners. Consider breaking this method into smaller, more focused methods to improve readability and maintainability. Additionally, verify that all UI components are disposed of correctly to avoid memory leaks.

Also applies to: 115-127, 129-130, 134-134, 140-151, 156-174, 181-182


250-269: Creation of JTAG Group UI Components.

The method createJtagGroup effectively sets up the JTAG configuration UI. Ensure that all new UI components introduced here are integrated with the rest of the system, particularly in terms of event handling and state synchronization.


273-276: Proper Disposal of Resources.

The dispose method correctly checks if targetPortInfo is running before canceling it. This is crucial for preventing resource leaks. Confirm that all other dynamically created resources within this class are also disposed of properly.


282-332: Getter Methods Consistency.

The getter methods (getTargetName, getOS, getVoltage, getBoard, getIDFTarget, getSerialPortName) are straightforward. However, ensure that they are consistently used across the application to prevent discrepancies in data handling, especially with the new fields added.


336-343: Utility Methods: getIDFTargetList and getToolchains.

These utility methods provide essential data for the UI components. It's important to ensure that the data they return is always up-to-date and accurate, considering the dynamic nature of toolchains and targets in development environments.


347-363: Event Handling in TargetComboSelectionAdapter.

This adapter handles the selection of targets and updates the serial port combo box accordingly. Verify that the logic here correctly reflects the current state of the system and that it handles all possible user interactions without error.


184-248: Method Review: setDefaults and related methods.

The setDefaults method and its related methods (setDefaultVoltage, setDefaultTargetAndBoard, setDefaultSerialPort) are well-organized. However, ensure that these methods handle all edge cases, such as null values and unexpected attributes. Adding more robust error handling and logging could improve reliability.


371-438: Background Job: TargetPortInfo.

This job handles asynchronous updates of port information. It's crucial to ensure that this job does not cause any unhandled exceptions or UI freezes. Consider adding more comprehensive error handling and possibly a timeout mechanism to prevent it from running indefinitely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs translation:CN Chinese translation is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants