-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
WalkthroughThis 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
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
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 theJTAG_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
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 requiredstart
andstop
methods, which are implemented appropriately.
start(BundleContext bundleContext)
: Sets thecontext
to the providedBundleContext
.stop(BundleContext bundleContext)
: Sets thecontext
tonull
.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 10Length 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 ofcom.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 theImport-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 variableespConfigParser
.The
espConfigParser
instance variable is added to hold an instance ofEspConfigParser
. Ensure that this variable is correctly utilized in the class.
40-43
: Initialization ofespConfigParser
in the constructor.The
espConfigParser
is initialized in the constructor. Ensure that theEspConfigParser
class has a default constructor and does not throw exceptions during initialization.
11-11
: New dependency onEspConfigParser
.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.javaLength of output: 3832
55-60
: New methodgetDefaultBoard
.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 thebundles/pom.xml
file and has corresponding Java package declarations in multiple files within thebundles/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 theJtagDynamicVariable
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 newgetOpenocdExecutable
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 replacesIDFLaunchConstants
.
48-48
: LGTM!The
resolveValue
method correctly uses the new constantLaunchBarTargetConstants.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
andinfoButtonImage
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 theisTargetSupportDfu
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 thegetLastUsedSerialPort
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 forLaunchBarTargetConstants
.This import is necessary for the updated references in the test functions.
77-77
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
80-80
: Updated attribute retrieval to useLaunchBarTargetConstants.SERIAL_PORT
.This change ensures consistency with the updated constants.
88-88
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
89-89
: Updated attribute retrieval to useLaunchBarTargetConstants.SERIAL_PORT
.This change ensures consistency with the updated constants.
100-107
: Updated attribute retrievals to useLaunchBarTargetConstants.TARGET
andLaunchBarTargetConstants.SERIAL_PORT
.These changes ensure consistency with the updated constants.
115-116
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
128-128
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
130-130
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
133-133
: Updated attribute retrieval to useLaunchBarTargetConstants.SERIAL_PORT
.This change ensures consistency with the updated constants.
135-135
: Updated attribute retrieval to useLaunchBarTargetConstants.SERIAL_PORT
.This change ensures consistency with the updated constants.
143-143
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
152-152
: Updated attribute retrieval to useLaunchBarTargetConstants.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 forLaunchBarTargetConstants
.This import is necessary for the updated references in the class.
90-90
: Updated attribute retrieval to useLaunchBarTargetConstants.TARGET
.This change ensures consistency with the updated constants.
90-90
: RemovedjtagIgnored
variable andsetIgnoreJtagTargetChange
method.This change simplifies the control flow by removing unnecessary complexity.
90-90
: Updated attribute retrieval to useLaunchBarTargetConstants.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 forLaunchBarTargetConstants
.This import is necessary for the updated references in the class.
90-91
: Updated attribute retrieval to useLaunchBarTargetConstants.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 ofIDFLaunchConstants.ATTR_IDF_TARGET
is approved.However, ensure that all references to
IDFLaunchConstants.ATTR_IDF_TARGET
have been updated toLaunchBarTargetConstants.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 ofIDFLaunchConstants.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
, andGDB_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
, andGDB_CLIENT_EXECUTABLE_DEFAULT
are used correctly across the codebase.
- The constants are correctly referenced in
DefaultPreferences
to provide default values.- The
Configuration
class correctly referencesGDB_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
, andOpenocdDynamicVariable
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
, andOpenocdDynamicVariable
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 ofATTR_SERIAL_PORT
is approved.However, ensure that all references to
ATTR_SERIAL_PORT
have been updated toLaunchBarTargetConstants.SERIAL_PORT
across the codebase.Verification successful
Verification Successful
All references to
ATTR_SERIAL_PORT
have been updated toLaunchBarTargetConstants.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 insetDefaults
.The
setDefaults
method initializes UI components with values from thelaunchTarget
. 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 thelaunchTarget
. 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 thelaunchTarget
. 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 thelaunchTarget
. 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 thetargetPortInfo
job if it is running and then calls the superclass'sdispose
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 theTargetPortInfo
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 toopenocd_executable
, and new variablesJTAG_FLASH_ARGS
andGDB_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
, andDebuggerTab.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
, andTextWithButton
are appropriate and align with the changes in the code.
85-87
: Field type changes approved.The fields
uartAgrumentsField
,jtagArgumentsField
, anddfuArgumentsField
have been correctly changed fromText
toTextWithButton
to enhance UI functionality.
110-114
: Introduction ofStyledInfoText
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 acceptsTextWithButton
instead ofText
, aligning with the new UI component and enhancing functionality.
220-220
: Field initialization change approved.The
uartAgrumentsField
is now correctly initialized asTextWithButton
, aligning with the new UI component.
Line range hint
242-268
:
Field initialization changes approved.The
jtagArgumentsField
anddfuArgumentsField
are now correctly initialized asTextWithButton
, aligning with the new UI component.
662-666
: Default value initialization approved.The
initializeFromDefaults
method correctly sets default values foruartAgrumentsField
,jtagArgumentsField
, anddfuArgumentsField
.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 referencesLaunchBarTargetConstants.TARGET
instead ofIDFLaunchConstants.ATTR_IDF_TARGET
, improving clarity and aligning with the new structure.
Line range hint
675-697
:
New utility methods approved.The
getProjectFromActiveLaunchConfig
andgetGitExecutablePathFromSystem
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
andLaunchBarTargetConstants
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
andgetAllEspToolchains
methods now use thetoList()
method directly on streams, enhancing clarity and conciseness.
Line range hint
441-456
:
Modern Java feature usage approved.The
addToolchainBasedTargets
method now uses thetoList()
method directly on streams, enhancing clarity and conciseness.
Line range hint
489-538
:
Refactoring of constant usage approved.The
addLaunchTargets
method now sets attributes usingLaunchBarTargetConstants
, 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
withLaunchBarTargetConstants.TARGET
improves maintainability.
644-645
: LGTM! Centralize launch target constants.Replacing
IDFLaunchConstants.ATTR_IDF_TARGET
withLaunchBarTargetConstants.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
andMouseTrackAdapter
are necessary for handling mouse events.
73-74
: Import statements look good.The import statements for
StyledInfoText
andTextWithButton
are necessary for the custom UI components.
91-96
: LGTM! Enhance UI withTextWithButton
.Replacing
Text
fields withTextWithButton
for GDB server and client executables and options improves user interaction.Also applies to: 102-102
170-174
: LGTM! Enhance UI withStyledInfoText
.Adding
StyledInfoText
with a mouse listener action improves dynamic updates in the UI.
220-230
: LGTM! Update methods forTextWithButton
.Updating
browseButtonSelected
andvariablesButtonSelected
methods to supportTextWithButton
is necessary.Also applies to: 233-238
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); | ||
} |
There was a problem hiding this comment.
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.
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); | |
} |
bundles/com.espressif.idf.swt.custom/src/com/espressif/idf/swt/custom/TextWithButton.java
Show resolved
Hide resolved
bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java
Outdated
Show resolved
Hide resolved
bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java
Show resolved
Hide resolved
bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/OpenocdVariableResolver.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
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 methodgetToolchainExePathForActiveTarget
.
374-374
: Method change approved.The method now uses
LaunchBarTargetConstants.TARGET
instead ofIDFLaunchConstants.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
, andTextWithButton
are necessary for the new UI components and dynamic variables used in the class.
91-93
: Class variable changes approved.The variables
uartAgrumentsField
,jtagArgumentsField
, anddfuArgumentsField
have been changed fromText
toTextWithButton
, enhancing the UI.
Line range hint
148-172
:
Method change approved.The method
createArgumentComponent
now acceptsTextWithButton
instead ofText
, aligning with the updated class variables and enhancing the UI.
192-192
: Method change approved.The method
handleVariablesButtonSelected
now usesTextWithButton
instead ofText
, aligning with the updated class variables and the new UI components.
229-229
: Method change approved.The method
createUartComposite
now usesTextWithButton
foruartAgrumentsField
, aligning with the updated class variables and enhancing the UI.
251-251
: Method change approved.The method
createJtagflashComposite
now usesTextWithButton
forjtagArgumentsField
, aligning with the updated class variables and enhancing the UI.
277-277
: Method change approved.The method
createDfuArgumentField
now usesTextWithButton
fordfuArgumentsField
, aligning with the updated class variables and enhancing the UI.
621-622
: Method change approved.The method
updateArgumentsWithDefaultFlashCommand
now sets the text forjtagArgumentsField
usingDEFAULT_JTAG_CONFIG_OPTIONS
, simplifying the logic.
685-687
: Method change approved.The method
initializeFromDefaults
now sets the text foruartAgrumentsField
,jtagArgumentsField
, anddfuArgumentsField
using default values, enhancing usability.
There was a problem hiding this 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
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
There was a problem hiding this 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
There was a problem hiding this comment.
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?
There was a problem hiding this 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 forgetDefaultBoard
methodThe
getDefaultBoard
method inDefaultBoardProvider
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
inDefaultBoardProvider
.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 pathThe 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
inOpenocdVariableResolverTest.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 variableJTAG_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 variableGDB_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 DetectedThe variable name
openocd_exe
has not been fully replaced withopenocd_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 toopenocd_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
, andDebuggerTab.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 inremoveMatchedToolChain
.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
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 thecontext
.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 inTabDebugger.java
andCMakeMainTab2.java
. The classesStyledInfoText
andTextWithButton
are utilized for UI components, confirming the package's integration and functionality. No issues were found with the added dependency.
TabDebugger.java
: UsesStyledInfoText
andTextWithButton
for UI interactions.CMakeMainTab2.java
: UtilizesStyledInfoText
andTextWithButton
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.javaLength 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
andATTR_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
andATTR_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 ofEspConfigParser
.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 asDefaultBoardProvider
,NewSerialFlashTargetWizardPage
,NewProjectCreationWizardPage
, andESPFlashUtil
. 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 5Length 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
andFLASH_VOLTAGE
attributes expands configuration options, improving functionality.bundles/com.espressif.idf.core/src/com/espressif/idf/core/variable/JtagVariableResolver.java (1)
1-84
: Implementation ofJtagVariableResolver
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 aNullPointerException
when used ingetOpenocdBinPath
. 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 withLaunchBarTargetConstants
. 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
toLaunchBarTargetConstants
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
, andBOARD
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
toLaunchBarTargetConstants.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
usingLaunchBarTargetConstants.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
withLaunchBarTargetConstants.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
, andfFlashVoltage
enhance the management of serial ports and board configurations.
115-127
: Dynamically update board configurations.The event handling for
idfTargetCombo
now dynamically updatesfBoardCombo
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 plugincom.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, includingfeature.xml
andpom.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
usesstream().toList()
. Ensure that this is compatible with the Java version in use.
434-434
: Use modern Java features for list creation.The method
getAllEspToolchains
usesstream().toList()
. Ensure that this is compatible with the Java version in use.
489-491
: Ensure default values are appropriate.The attributes
LaunchBarTargetConstants.FLASH_VOLTAGE
andLaunchBarTargetConstants.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
andLaunchBarTargetConstants.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
andLaunchBarTargetConstants
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
andLaunchBarTargetConstants
are utilized within theESPToolChainManager.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 usesLaunchBarTargetConstants.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, includingIDFUtil.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
andStyledInfoText
are necessary for the updated UI components.
91-93
: Field type changes toTextWithButton
are appropriate.Changing the fields to
TextWithButton
enhances the UI by providing additional button functionality.
Line range hint
148-172
: Method signature update toTextWithButton
is consistent.The method now accepts
TextWithButton
, aligning with the updated field types and ensuring consistent usage.
192-194
: Method parameter update toTextWithButton
is consistent.Updating the parameter to
TextWithButton
ensures proper handling of variable insertion with the new component.
229-229
: Initialization ofuartAgrumentsField
asTextWithButton
is correct.The initialization aligns with the field type change and ensures correct UI setup.
251-251
: Initialization ofjtagArgumentsField
asTextWithButton
is correct.The initialization aligns with the field type change and ensures correct UI setup.
277-277
: Initialization ofdfuArgumentsField
asTextWithButton
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 forLaunchBarTargetConstants
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 usingLaunchBarTargetConstants.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
andStyledInfoText
are necessary for the updated UI components.
91-102
: Field type changes toTextWithButton
are appropriate.Changing the fields to
TextWithButton
enhances the UI by providing additional button functionality.
170-174
: Addition ofStyledInfoText
enhances user interaction.The
StyledInfoText
component provides informative text with an associated action, improving user experience.
220-230
: Method parameter update toTextWithButton
is consistent.Updating the parameter to
TextWithButton
ensures consistent usage with the new component.
233-238
: Method parameter update toTextWithButton
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 forfGdbServerOtherOptions
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.
...jtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/preferences/DefaultPreferences.java
Outdated
Show resolved
Hide resolved
Hi @sigmaaa Just on a side note I was able to flash and debug with all the default options fine. |
Hi @alirana01, |
There was a problem hiding this 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
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
There was a problem hiding this 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
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
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 |
tested dfu, seems to be working fine |
There was a problem hiding this 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
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
@sigmaaa hi ! Tested under: create project -> build ESP32 target -> edit target -> change target to any -> click "Finish" -> no pop-up to delete "build" folder but if you repeat actions -> go "Edit" target again -> click "Finish" -> pop-up appears |
Hi @AndriiFilippov, |
There was a problem hiding this 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
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.
I see the following error in the console when I try to click on the launch target gear icon and no prompt dialog appeared.
|
There was a problem hiding this 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
org.eclipse.jface, | ||
org.eclipse.core.variables, | ||
org.eclipse.equinox.registry, | ||
com.espressif.idf.core, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@sigmaaa hi ! Tested under: small UI fix: |
@sigmaaa hi ! |
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. |
There was a problem hiding this 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
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 ApprovedThe
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 ApprovedThe
resolveValue
method is efficiently implemented using modern Java features to ensure null safety and clean code.
25-29
: Method Implementation ApprovedThe
getAppropriateEnumVariable
method effectively uses Java's stream API to filter and find the appropriate enum value.
31-37
: Method Implementation ApprovedThe
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 ApprovedThe
getActiveLaunchTarget
method is robust, with appropriate error handling and use ofOptional
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 ApprovedThe
resolveValue
method effectively uses the newLaunchBarTargetConstants
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@AndriiFilippov FYI |
@sigmaaa hi ! 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 :
|
There was a problem hiding this 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
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
, andfFlashVoltage
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 theEspConfigParser
.
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, andTargetPortInfo
class are beneficial:
- The
dispose
method ensures proper cleanup of thetargetPortInfo
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
, andsetDefaultSerialPort
methods improve code organization and readability by encapsulating the logic for setting default values.
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 |
There was a problem hiding this 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
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.
@sigmaaa hi ! Tested under: able to create new target ✅ LGTM 👍 |
There was a problem hiding this 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
, andfFlashVoltage
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
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 variablejtagGroupLbl
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 variableAddingTargetJobName
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 oftargetPortMap
andtargetPortInfo
.The constructor initializes
targetPortMap
andtargetPortInfo
. 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 iftargetPortInfo
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
andgetToolchains
.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 inTargetComboSelectionAdapter
.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.
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.
How has this been tested?
Test Configuration:
Dependent components impacted by this PR:
Checklist
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores