Skip to content

[WIP] Release/v4.0.0 This is just to have the release 4.0 builds for testing (Please dont merge it yet #1217

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

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

Conversation

alirana01
Copy link
Collaborator

@alirana01 alirana01 commented May 7, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new Espressif IDF Manager for managing ESP-IDF installations directly within the IDE.
    • Added automatic detection, setup, and monitoring of ESP-IDF installations using a JSON-based configuration.
    • Enhanced user notifications for missing or changed ESP-IDF configurations, with guided prompts and links.
  • Improvements

    • Simplified and streamlined the ESP-IDF tools setup and activation process.
    • Updated UI with a new ESP-IDF Manager editor and improved table view for installed versions.
    • Reduced and clarified user-facing messages for easier navigation and understanding.
    • Improved environment variable handling for better compatibility.
  • Bug Fixes

    • Fixed issues with environment variable propagation in several tools and dialogs.
    • Increased timeouts and improved reliability in test automation for project and SDK configuration.
  • Removals

    • Removed legacy tools installation wizards, handlers, and related UI elements.
    • Deleted outdated commands, menu items, and preference settings for ESP-IDF tool management.
    • Eliminated obsolete code, tests, and resource files related to previous tools management flows.
  • Tests

    • Updated and streamlined test cases to align with the new ESP-IDF Manager workflow.
    • Adjusted timeouts and removed redundant or outdated test steps.

alirana01 and others added 2 commits May 6, 2025 13:37
* Initial integration

Initial integration for the eim starting from the start to handle the empty workspace. Tools activation is still to be done along with code cleanup. Just the basic display is working which will also be enhanced.

* Initial first flow with successful installation and loading of env in IDE with EIM

* constants moved to single place and added refresh function

* minor cleanup and logging for user

* IEP-1334: code cleanup (Active Review) (#1125)

* cleanup of unused classes and code

* String internalization

* update to ci file

* ci error fixed

* ci error fix

* ci fix

* fixing ci error

* ci error fix

* ci error fix

* ci syntax fix

* ci syntax indentation fix

* ci syntax fix

* ci syntax fix

* ci fixed

* ci fixed2

* ci trigger

* workflow trigger fix

* cleanup

* ci deps isntalled

* eim fix

* using eim action to install

* using Petr's fork

* switched back to official action repo

* Revert "switched back to official action repo"

This reverts commit f8cd7a7.

* trying to fix action for eim

* trying with petrs fork again

* ci fix

* back to espressif

* name fixed

* updated url for eim

* old config export handling

* fixing tests env setup

* logging to verify skip tests

* fixing POSIX path resolution

* activation script properly sourced

* added test run variable in test pom directly

* adding cache option for the maven

* file name updated

* increasing timeout for tests

* test fixes and removing redundant and outdated tests

* cleanup and update for user messages

* updated to handle activation of single esp-idf from eim

* removing unwanted test for fixing failures

* increased timeout for tests

* ci updated for the release branch trigger as well

* ci error fix

* fix for sdkconfig server

* cleaning up the idf_tools_path configuration in the IDE

* added the option to include homebrew paths on macos

* changes for guide link

* Guidance link added to NLS

* fix: Launch ESP-IDF Manager view even there is no eim_idf.json file found

* fix: Don't launch multiple ESP-IDF Manager editors

* fix: Update the msg and convert it to MessageDialog

* fix: notify IDF not found while opening Manager view

* fix: java.lang.UnsupportedOperationException

* fix: File Not found issue and others

* updated code for eim watcher added

Next commits will do some refactoring and then implement the logic to handle these changes

* refactored startup classes

* initial base level logic for file watcher

So this is very basic first level of file watcher service that watches the file and then also takes care that the file is wasnt changes since last startup. Initial changes only take that the file last modified is verified and just any change in file simply will give you a message box telling that something changed. More advanced and robust checks in upcoming commits

* missing copyright added

---------

Co-authored-by: Kondal Kolipaka <[email protected]>
Copy link

coderabbitai bot commented May 7, 2025

Walkthrough

This update refactors the Espressif IDF Eclipse plugin's tool management and installation system. It removes legacy tool installation wizards, UI dialogs, and JSON-based toolset management, replacing them with a new EIM (Espressif Integration Manager) JSON-driven configuration and setup workflow. The environment variable handling is standardized, and new classes are introduced for EIM state tracking, file watching, and UI integration. UI components and tests are updated to align with the new EIM-centric workflow.

Changes

Files/Paths (Grouped) Change Summary
.github/workflows/ci.yml, .github/workflows/ci_windows.yml Updated CI workflows: added release/** branch triggers, upgraded actions, and improved job naming and environment setup.
bundles/com.espressif.idf.core/META-INF/MANIFEST.MF Added export of com.espressif.idf.core.tools.watcher package.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePreferenceConstants.java Removed public constants for GitHub assets, Python index URLs, and IDF tools path.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java Added ESP_IDF_EIM_ID constant; refactored environment map logic to use System.getenv().
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java Removed setting of IDF_TOOLS_PATH environment variable in build commands.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java,
messages.properties
Added new message keys for EIM tool initialization, workspace state, and old config export dialogs.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java Improved directory filtering and switched environment sourcing to System.getenv().
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimConstants.java Introduced new interface with EIM-related constants.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimIdfConfiguratinParser.java Added class for parsing EIM JSON configuration.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/Messages.java,
messages.properties
Added class and resource file for OpenOCD rules copy messages.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/SetupToolsInIde.java Added class to manage ESP-IDF tool setup in the IDE, including environment and toolchain configuration.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java Added class for EIM state checking, legacy config export, and tool install status.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java,
IdfInstalled.java
Added data classes for EIM JSON structure and installed IDF entries.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonChangeListener.java,
EimJsonStateChecker.java,
EimJsonWatchService.java
Added interfaces and classes for EIM JSON file change monitoring and state tracking.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java Removed custom env methods, added Python env path utility, and standardized env handling.
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/EspToolCommands.java Switched to System.getenv() for subprocess environment variables.
bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java Refactored environment setup and process launching for server start.
bundles/com.espressif.idf.serial.monitor/src/com/espressif/idf/serial/monitor/core/IDFMonitor.java Removed dependency check method; standardized env variable handling.
bundles/com.espressif.idf.ui/OSGI-INF/l10n/bundle.properties,
plugin.xml
Removed update/install commands, menu items, and startup extensions; updated startup classes.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/EspressifGeneralStartup.java Added startup class for UI dialog/listener registration and build hints dialog.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/SbomCommandDialog.java,
help/ProductInformationHandler.java,
size/IDFSizeDataManager.java,
tracing/AppLvlTracingDialog.java,
update/AbstractToolsHandler.java
Standardized all subprocesses to use System.getenv() for environment variables.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/NewProjectHandlerUtil.java Switched preference key for tools installed flag to new EIM constant.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/EspressifToolStartup.java Added startup class for EIM tool state checking, user prompts, and JSON change notifications.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/SetupToolsJobListener.java Renamed and refactored job listener for new setup job; added rollback on failure.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/ESPIDFManagerEditor.java,
manager/EimEditorInput.java,
manager/pages/ESPIDFMainTablePage.java
Refactored ESP-IDF Manager: switched to EIM JSON model, updated UI, removed add/remove logic, and added guide link.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/messages.properties Replaced with a minimal set of ESP-IDF Manager UI and state messages.
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/watcher/EimJsonUiChangeHandler.java Added UI handler for EIM JSON file change events.
Removed legacy tool management and installation classes and resources:
IDFNewToolsWizard.java, IDFDownloadPage.java, InstallToolsHandler.java, ToolsJob.java, ToolsInstallationJob.java, ToolsActivationJob.java, ExportIDFTools.java, GitRepositoryBuilder.java, LogMessagesThread.java, GitWizardRepProgressMonitor.java, Messages.java (install), messages.properties (install), messages_zh.properties (install), InitializeToolsStartup.java, UpdateEspIdfHandler.java, ToolSetConfigurationManager.java, ToolsJsonParser.java, ToolsPlatformMapping.java, ToolsSystemWrapper.java, IToolsInstallationWizardConstants.java, IToolsJsonKeys.java, JsonKey.java, IDFToolSet.java, ToolsVO.java, VersionsVO.java, VersionDetailsVO.java
Deleted all legacy tool installation, management, and wizard classes, value objects, and related resources.
tests/com.espressif.idf.ui.test/configs/default-test-linux.properties Updated default ESP-IDF path to a more specific versioned subdirectory.
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectSDKconfigTest.java,
NewEspressifIDFProjectTest.java
Increased timeouts for SDK config tab and removed some project build/clean tests.
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/EnvSetupOperations.java Streamlined environment setup to use ESP-IDF Manager editor and console.
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/ProjectTestOperations.java Increased console text wait timeout.
tests/pom.xml Added -DtestRun=true JVM system property for test execution.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EclipseIDE
    participant EspressifToolStartup
    participant ToolInitializer
    participant EimJsonParser
    participant ESPIDFManagerEditor
    participant SetupToolsInIde

    User->>EclipseIDE: Start IDE
    EclipseIDE->>EspressifToolStartup: earlyStartup()
    EspressifToolStartup->>ToolInitializer: isEimInstalled()
    alt EIM not installed
        EspressifToolStartup->>User: Show warning dialog with EIM download link
    else EIM installed
        EspressifToolStartup->>EimJsonParser: loadEimJson()
        EimJsonParser-->>EspressifToolStartup: EimJson
        EspressifToolStartup->>ToolInitializer: isEspIdfSet()
        alt ESP-IDF not set
            EspressifToolStartup->>User: Prompt to open ESP-IDF Manager
            User->>EspressifToolStartup: Accept
            EspressifToolStartup->>ESP IDFManagerEditor: Open with EimJson
        end
        EspressifToolStartup->>EimJsonStateChecker: wasModifiedSinceLastRun()
        alt Modified
            EspressifToolStartup->>User: Show info dialog about change
        end
        EspressifToolStartup->>EimJsonWatchService: Register UI change listener
    end

    User->>ESP IDFManagerEditor: Activate IDF version
    ESPIDFManagerEditor->>SetupToolsInIde: Schedule setup job
    SetupToolsInIde->>EclipseIDE: Configure env, toolchains, Python, OpenOCD rules
    SetupToolsInIde->>User: Show progress, prompt as needed
    SetupToolsInIde-->>ESP IDFManagerEditor: Notify setup complete
Loading

Possibly related PRs

Poem

In the warren of code, a new path we tread,
Old wizards and toolsets now gently put to bed.
EIM JSON guides us, with watchers on the prowl,
Setup hops ahead—no more legacy growl!
With fresh carrots of config, our IDE is bright,
Rabbits rejoice: clean, nimble, and light! 🥕
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 28

🧹 Nitpick comments (24)
.github/workflows/ci.yml (1)

43-45: Remove trailing spaces
There are trailing spaces on the distribution and cache lines. Cleaning these up improves file hygiene.

-        distribution: 'temurin'    
-        cache: 'maven'
+        distribution: 'temurin'
+        cache: 'maven'
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 43-43: trailing spaces

(trailing-spaces)

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/messages.properties (1)

1-7: Message keys naming may need adjustment.

The message keys have the prefix "InstallToolsHandler_" but according to the PR summary, the InstallToolsHandler class has been replaced with a new SetupToolsInIde class. Consider renaming the message keys to reflect the new class name for better maintainability.

-InstallToolsHandler_CopyingOpenOCDRules=Copying OpenOCD Rules
-InstallToolsHandler_OpenOCDRulesCopyPaths=Copying File: %s to destination: %s
-InstallToolsHandler_OpenOCDRulesCopyWarning=Warning
-InstallToolsHandler_OpenOCDRulesCopyWarningMessage=The rules file is already present in the /etc/udev/rules.d/ directory, Do you want to replace the file with the file from OpenOCD directory
-InstallToolsHandler_OpenOCDRulesNotCopied=Rules Not Copied to system
-InstallToolsHandler_OpenOCDRulesCopyError=Unable to copy rules for OpenOCD to system directory, try running the eclipse with sudo command
-InstallToolsHandler_OpenOCDRulesCopied=Rules Copied to system
+SetupToolsInIde_CopyingOpenOCDRules=Copying OpenOCD Rules
+SetupToolsInIde_OpenOCDRulesCopyPaths=Copying File: %s to destination: %s
+SetupToolsInIde_OpenOCDRulesCopyWarning=Warning
+SetupToolsInIde_OpenOCDRulesCopyWarningMessage=The rules file is already present in the /etc/udev/rules.d/ directory, Do you want to replace the file with the file from OpenOCD directory
+SetupToolsInIde_OpenOCDRulesNotCopied=Rules Not Copied to system
+SetupToolsInIde_OpenOCDRulesCopyError=Unable to copy rules for OpenOCD to system directory, try running the eclipse with sudo command
+SetupToolsInIde_OpenOCDRulesCopied=Rules Copied to system
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/ESPIDFManagerEditor.java (1)

56-62: Integration with new EIM JSON-based configuration model.

The changes correctly integrate the editor with the new JSON-driven configuration workflow by passing the EimJson object to the ESPIDFMainTablePage singleton and triggering initial setup when appropriate.

Consider adding null checks for the editor input to prevent potential NullPointerExceptions:

-ESPIDFMainTablePage espidfMainTablePage = ESPIDFMainTablePage
-        .getInstance(((EimEditorInput) getEditorInput()).getEimJson());
+IEditorInput input = getEditorInput();
+if (input instanceof EimEditorInput) {
+    EimEditorInput eimInput = (EimEditorInput) input;
+    ESPIDFMainTablePage espidfMainTablePage = ESPIDFMainTablePage
+            .getInstance(eimInput.getEimJson());
+    espidfMainTablePage.createPage(parent);
+    if (eimInput.isFirstStartup()) {
+        espidfMainTablePage.setupInitialEspIdf();
+    }
+}
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/EnvSetupOperations.java (1)

31-41: Test refactored to use the new ESP-IDF Manager editor workflow

The test has been updated to use the new EIM-centric workflow, which aligns with the broader refactoring of the tool management system. Instead of manually interacting with installation dialogs, it now works with the ESP-IDF Manager editor directly.

However, the timeout value set for waiting is extremely large (99000000 ms ≈ 27.5 hours).

Consider using a more reasonable timeout value or making it configurable:

-TestWidgetWaitUtility.waitUntilViewContains(bot, "Tools Setup complete", consoleView, 99000000);
+TestWidgetWaitUtility.waitUntilViewContains(bot, "Tools Setup complete", consoleView, 300000); // 5 minute timeout

Alternatively, you could define the timeout as a constant with a descriptive name:

+private static final int TOOLS_SETUP_TIMEOUT_MS = 300000; // 5 minute timeout

-TestWidgetWaitUtility.waitUntilViewContains(bot, "Tools Setup complete", consoleView, 99000000);
+TestWidgetWaitUtility.waitUntilViewContains(bot, "Tools Setup complete", consoleView, TOOLS_SETUP_TIMEOUT_MS);
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (2)

15-15: Consider using a mutable list for initialization

The field is initialized with an immutable list via Collections.emptyList(). This could cause UnsupportedOperationException if any code attempts to directly modify this list without first replacing it through the setter.

-	private List<IdfInstalled> idfInstalled = Collections.emptyList();
+	private List<IdfInstalled> idfInstalled = new ArrayList<>();

37-40: Consider returning a defensive copy of the list

Returning the list reference directly allows external code to modify the internal state of this object, which could lead to unexpected behavior in a multi-threaded environment or when the object needs to maintain invariants.

	public List<IdfInstalled> getIdfInstalled()
	{
-		return idfInstalled;
+		return new ArrayList<>(idfInstalled);
	}
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimConstants.java (2)

7-7: Use Path API for file path handling

String concatenation for path construction may not handle path separators correctly across all systems. Consider using the java.nio.file.Path API which provides better cross-platform path handling.

-	String EIM_POSIX_DIR = System.getProperty("user.home").concat("/.espressif/tools/");  //$NON-NLS-1$//$NON-NLS-2$
+	String EIM_POSIX_DIR = Paths.get(System.getProperty("user.home"), ".espressif", "tools").toString() + File.separator;  //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$

3-21: Add documentation for constants

The interface lacks documentation explaining the purpose and usage of each constant. This makes maintenance more difficult and can lead to misuse of these constants.

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

12-12: Fix spelling in class name

There is a typo in the class name: "Configuratin" should be "Configuration".

-public class EimIdfConfiguratinParser
+public class EimIdfConfigurationParser
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/watcher/EimJsonUiChangeHandler.java (1)

1-4: Update copyright year

The copyright statement shows year 2025, which is in the future. Update to the current year (2024).

-/*******************************************************************************
- * Copyright 2025 Espressif Systems (Shanghai) PTE LTD. All rights reserved.
- * Use is subject to license terms.
- *******************************************************************************/
+/*******************************************************************************
+ * Copyright 2024 Espressif Systems (Shanghai) PTE LTD. All rights reserved.
+ * Use is subject to license terms.
+ *******************************************************************************/
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonStateChecker.java (3)

1-3: Update copyright year to match current year.

The copyright year is set to 2025, which is in the future. It should be updated to the current year 2024.

-/*******************************************************************************
- * Copyright 2025 Espressif Systems (Shanghai) PTE LTD. All rights reserved.
- * Use is subject to license terms.
+/*******************************************************************************
+ * Copyright 2024 Espressif Systems (Shanghai) PTE LTD. All rights reserved.
+ * Use is subject to license terms.

33-52: Add preference flushing when detecting first run.

When no last seen timestamp is found (first run), the method should update the timestamp to avoid repeatedly detecting it as a first run if Eclipse crashes before properly updating the timestamp later.

if (lastSeen == 0L)
{
    // First run ever, don't treat as changed
    Logger.log("eim_idf.json detected, but no last seen timestamp — assuming first run."); //$NON-NLS-1$
+   // Set initial timestamp to avoid repeatedly detecting first run
+   preferences.putLong(LAST_MODIFIED_PREF_KEY, lastModified);
+   try {
+       preferences.flush();
+   } catch (BackingStoreException e) {
+       Logger.log(e);
+   }
    return false;
}

47-47: Consider using message constants for logging messages.

The hardcoded log message should ideally use a message constant from a Messages class for proper internationalization.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ManageEspIdfVersionsHandler.java (3)

5-5: Remove unused import.

The ArrayList import is not used anywhere in the code and should be removed.

-import java.text.MessageFormat;
-import java.util.ArrayList;
+import java.text.MessageFormat;

17-17: Typo in class name EimIdfConfiguratinParser.

There's a spelling error in the class name (missing 'o' in 'Configuration').

-import com.espressif.idf.core.tools.EimIdfConfiguratinParser;
+import com.espressif.idf.core.tools.EimIdfConfigurationParser;

This should be fixed in the class name itself and all references to it.


46-57: Simplify EimJson initialization and improve error handling.

The initialization of the empty EimJson object is redundant since you immediately try to populate it. Also, you should log more information about the error when JSON parsing fails.

-EimJson eimJson = new EimJson();
+EimJson eimJson;

try
{
    EimIdfConfiguratinParser eimIdfConfiguratinParser = new EimIdfConfiguratinParser();
    eimJson = eimIdfConfiguratinParser.getEimJson(true);
}
catch (IOException e)
{
-   Logger.log(e);
+   Logger.log("Failed to parse EIM JSON configuration: " + e.getMessage(), e);
    // Proceed with an empty EimJson object
+   eimJson = new EimJson();
}
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/EimEditorInput.java (2)

72-85: Enhance equals method to consider EimJson content.

The current implementation only compares the FILE_NAME constant, which means all instances of EimEditorInput will be equal regardless of their EimJson content. This could lead to unexpected behavior when multiple editors are open.

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if (obj == null || getClass() != obj.getClass())
		{
			return false;
		}
		EimEditorInput that = (EimEditorInput) obj;
-		return FILE_NAME.equals(that.FILE_NAME);
+		// Since FILE_NAME is constant, also compare EimJson content if available
+		if (this.eimJson == null && that.eimJson == null) {
+			return true;
+		}
+		return (this.eimJson != null && that.eimJson != null && 
+			this.eimJson.getIdfSelectedId() != null && 
+			this.eimJson.getIdfSelectedId().equals(that.eimJson.getIdfSelectedId()));

87-91: Update hashCode to be consistent with equals.

If you update the equals method to consider EimJson content, the hashCode method should also be updated to maintain the contract that equal objects have equal hash codes.

	@Override
	public int hashCode()
	{
-		return FILE_NAME.hashCode();
+		final int prime = 31;
+		int result = FILE_NAME.hashCode();
+		result = prime * result + ((eimJson == null || eimJson.getIdfSelectedId() == null) ? 0 : 
+			eimJson.getIdfSelectedId().hashCode());
+		return result;
	}
bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java (1)

164-170: Consider using Map.Entry for enhanced type safety.

Instead of using the raw Entry type, consider using Map.Entry for better type safety.

-		for (Entry<String, String> entry : idfEnvironmentVariables.getEnvMap().entrySet())
+		for (Map.Entry<String, String> entry : idfEnvironmentVariables.getEnvMap().entrySet())
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java (1)

89-92: Consider providing a method to update the ESP-IDF set flag.

The class provides a method to check if ESP-IDF is set, but no method to update this flag. This would be useful for classes that need to modify this state.

	public boolean isEspIdfSet()
	{
		return preferences.getBoolean(EimConstants.INSTALL_TOOLS_FLAG, false);
	}
+
+	public void setEspIdfSet(boolean value)
+	{
+		preferences.putBoolean(EimConstants.INSTALL_TOOLS_FLAG, value);
+	}
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/EspressifGeneralStartup.java (1)

83-92: Null-check listener & remove redundant @SuppressWarnings

launchBarListener can be null if events are fired before hookLaunchBarListeners() finishes registering – rare, but possible during early start-up.
Also, the static-access suppression is unnecessary; we are calling an instance method.

-@SuppressWarnings("static-access")
-private void disableLaunchBarEvents()
-{
-    launchBarListener.setIgnoreTargetChange(true);
-}
+private void disableLaunchBarEvents()
+{
+    if (launchBarListener != null)
+        launchBarListener.setIgnoreTargetChange(true);
+}

Apply the same pattern to enableLaunchBarEvents() and drop the @SuppressWarnings.

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

148-151: Typo in progress message

"Installing pyhton dependency web-socket""Installing Python dependency websocket-client".

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java (1)

106-122: Blocking browser launch on UI thread
java.awt.Desktop.getDesktop().browse() may block while the platform launches the external browser.
Triggering this directly inside the SWT selection listener freezes the UI if the operation takes noticeable time, especially on Linux/Wayland.
Wrap the call in Display.getDefault().asyncExec() or, better, run it in a background job and use Program.launch() from SWT which is non-blocking.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java (1)

95-100: Possible NPE when comparing installation IDs
isIdfInstalledActive does
idfInstalled.getId().equals(espIdfIdEim).
When getId() returns null, this throws.
Use Objects.equals(idfInstalled.getId(), espIdfIdEim) to be safe.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e7c679 and b0f9305.

⛔ Files ignored due to path filters (1)
  • bundles/com.espressif.idf.ui/icons/tools/delete.png is excluded by !**/*.png
📒 Files selected for processing (76)
  • .github/workflows/ci.yml (2 hunks)
  • .github/workflows/ci_windows.yml (1 hunks)
  • bundles/com.espressif.idf.core/META-INF/MANIFEST.MF (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePreferenceConstants.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimConstants.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimIdfConfiguratinParser.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/IToolsInstallationWizardConstants.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/IToolsJsonKeys.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/JsonKey.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/Messages.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/SetupToolsInIde.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolSetConfigurationManager.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolsJsonParser.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolsPlatformMapping.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolsSystemWrapper.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/messages.properties (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java (2 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/IDFToolSet.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/IdfInstalled.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/ToolsVO.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/VersionDetailsVO.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/VersionsVO.java (0 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonChangeListener.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonStateChecker.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonWatchService.java (1 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/EspToolCommands.java (3 hunks)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (3 hunks)
  • bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java (3 hunks)
  • bundles/com.espressif.idf.serial.monitor/src/com/espressif/idf/serial/monitor/core/IDFMonitor.java (1 hunks)
  • bundles/com.espressif.idf.ui/OSGI-INF/l10n/bundle.properties (0 hunks)
  • bundles/com.espressif.idf.ui/plugin.xml (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/EspressifGeneralStartup.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InitializeToolsStartup.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/SbomCommandDialog.java (3 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/NewProjectHandlerUtil.java (2 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/UpdateEspIdfHandler.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/help/ProductInformationHandler.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/GitRepositoryBuilder.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/IDFDownloadPage.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/IDFNewToolsWizard.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/Messages.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/messages.properties (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/messages_zh.properties (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/preferences/EspresssifPreferencesPage.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/size/IDFSizeDataManager.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/EspressifToolStartup.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/GitWizardRepProgressMonitor.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/LogMessagesThread.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ManageEspIdfVersionsHandler.java (2 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/Messages.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/SetupToolsJobListener.java (4 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsActivationJob.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsInstallationJob.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsJob.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/ESPIDFManagerEditor.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/EimEditorInput.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java (13 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/messages.properties (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/watcher/EimJsonUiChangeHandler.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tracing/AppLvlTracingDialog.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/AbstractToolsHandler.java (1 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/ExportIDFTools.java (0 hunks)
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/InstallToolsHandler.java (0 hunks)
  • tests/com.espressif.idf.ui.test/configs/default-test-linux.properties (1 hunks)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectSDKconfigTest.java (1 hunks)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java (0 hunks)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/EnvSetupOperations.java (2 hunks)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/ProjectTestOperations.java (1 hunks)
  • tests/pom.xml (1 hunks)
💤 Files with no reviewable changes (30)
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/IToolsJsonKeys.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/IToolsInstallationWizardConstants.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/messages.properties
  • bundles/com.espressif.idf.ui/OSGI-INF/l10n/bundle.properties
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/JsonKey.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolsJsonParser.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/messages_zh.properties
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/GitWizardRepProgressMonitor.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/LogMessagesThread.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/VersionDetailsVO.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/GitRepositoryBuilder.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolsSystemWrapper.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/IDFToolSet.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolSetConfigurationManager.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/preferences/EspresssifPreferencesPage.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/ToolsVO.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/IDFDownloadPage.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/VersionsVO.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/Messages.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePreferenceConstants.java
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java
  • bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolsPlatformMapping.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsInstallationJob.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsActivationJob.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/UpdateEspIdfHandler.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/InstallToolsHandler.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/update/ExportIDFTools.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InitializeToolsStartup.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/ToolsJob.java
  • bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/install/IDFNewToolsWizard.java
🧰 Additional context used
🧬 Code Graph Analysis (14)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/ESPIDFManagerEditor.java (1)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java (1)
  • ESPIDFMainTablePage (56-557)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectSDKconfigTest.java (1)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/ProjectTestOperations.java (1)
  • ProjectTestOperations (50-656)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonWatchService.java (1)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/logging/Logger.java (1)
  • Logger (21-137)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/EspressifToolStartup.java (13)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/Messages.java (1)
  • Messages (15-42)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/logging/Logger.java (1)
  • Logger (21-137)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java (1)
  • ToolInitializer (26-93)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (1)
  • EimJson (8-47)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonStateChecker.java (1)
  • EimJsonStateChecker (22-67)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonWatchService.java (1)
  • EimJsonWatchService (23-152)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (1)
  • IDFUtil (58-889)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/StringUtil.java (1)
  • StringUtil (11-25)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/MessageLinkDialog.java (1)
  • MessageLinkDialog (40-135)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/EclipseHandler.java (1)
  • EclipseHandler (21-79)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/ESPIDFManagerEditor.java (1)
  • ESPIDFManagerEditor (22-78)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/EimEditorInput.java (1)
  • EimEditorInput (9-93)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/watcher/EimJsonUiChangeHandler.java (1)
  • EimJsonUiChangeHandler (23-44)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimIdfConfiguratinParser.java (1)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (1)
  • EimJson (8-47)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonStateChecker.java (1)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/logging/Logger.java (1)
  • Logger (21-137)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/EimEditorInput.java (1)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (1)
  • EimJson (8-47)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/SetupToolsJobListener.java (3)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/SetupToolsInIde.java (1)
  • SetupToolsInIde (53-564)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java (1)
  • ESPIDFMainTablePage (56-557)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/resources/OpenDialogListenerSupport.java (1)
  • OpenDialogListenerSupport (9-22)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/Messages.java (2)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java (1)
  • Messages (9-63)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/Messages.java (1)
  • Messages (15-42)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (1)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/StringUtil.java (1)
  • StringUtil (11-25)
bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java (4)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/ProcessBuilderFactory.java (1)
  • ProcessBuilderFactory (16-163)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.java (1)
  • IDFUtil (58-889)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/logging/Logger.java (1)
  • Logger (21-137)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/StringUtil.java (1)
  • StringUtil (11-25)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java (2)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/logging/Logger.java (1)
  • Logger (21-137)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (1)
  • EimJson (8-47)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java (7)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimIdfConfiguratinParser.java (1)
  • EimIdfConfiguratinParser (12-47)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/SetupToolsInIde.java (1)
  • SetupToolsInIde (53-564)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java (1)
  • ToolsUtility (25-101)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/EimJson.java (1)
  • EimJson (8-47)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/IdfInstalled.java (1)
  • IdfInstalled (5-80)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/IDFConsole.java (1)
  • IDFConsole (27-100)
bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/SetupToolsJobListener.java (1)
  • SetupToolsJobListener (28-88)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/util/ToolsUtility.java (2)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/logging/Logger.java (1)
  • Logger (21-137)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/IdfInstalled.java (1)
  • IdfInstalled (5-80)
🪛 YAMLlint (1.35.1)
.github/workflows/ci_windows.yml

[warning] 9-9: wrong indentation: expected 6 but found 5

(indentation)


[warning] 13-13: wrong indentation: expected 6 but found 5

(indentation)

.github/workflows/ci.yml

[warning] 9-9: wrong indentation: expected 6 but found 5

(indentation)


[warning] 13-13: wrong indentation: expected 6 but found 5

(indentation)


[warning] 22-22: wrong indentation: expected 6 but found 4

(indentation)


[error] 29-29: syntax error: found character '\t' that cannot start any token

(syntax)


[error] 43-43: trailing spaces

(trailing-spaces)

🪛 actionlint (1.7.4)
.github/workflows/ci.yml

19-19: label "eclipse" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


19-19: label "BrnoUBU0004" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


25-25: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build_macos
  • GitHub Check: build_macos
  • GitHub Check: build_linux
🔇 Additional comments (55)
.github/workflows/ci_windows.yml (1)

8-14: Approve expansion of CI triggers
Adding release/** alongside master for both push and pull_request ensures CI runs on release branches as intended.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 9-9: wrong indentation: expected 6 but found 5

(indentation)


[warning] 13-13: wrong indentation: expected 6 but found 5

(indentation)

.github/workflows/ci.yml (3)

17-20: Job renamed to build_linux and custom runners
The job name change from build to build_linux is clear and descriptive. Confirm that the self-hosted runner labels eclipse and BrnoUBU0004 are defined in your Actionlint configuration or consider replacing them with standard labels to avoid runner-label validation errors.

🧰 Tools
🪛 actionlint (1.7.4)

19-19: label "eclipse" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


19-19: label "BrnoUBU0004" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


29-33: Approve use of espressif/install-esp-idf-action@v1
Switching from manual checkout of ESP-IDF to the official install-esp-idf-action@v1 streamlines environment setup and aligns with the new EIM-based tool management.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 29-29: syntax error: found character '\t' that cannot start any token

(syntax)


8-14: Approve trigger expansion for release branches
Including release/** in the trigger patterns matches the Windows workflow and ensures consistent CI coverage for release branches.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 9-9: wrong indentation: expected 6 but found 5

(indentation)


[warning] 13-13: wrong indentation: expected 6 but found 5

(indentation)

tests/com.espressif.idf.ui.test/configs/default-test-linux.properties (1)

10-10:

❓ Verification inconclusive

Verify updated ESP-IDF test path
The path for default.env.esp.idf.path now points to dependencies/idf-tools/v5.3/esp-idf. Ensure that the install-esp-idf-action@v1 step installs ESP-IDF to this exact location. You can add a CI check:


🏁 Script executed:

#!/bin/bash
if [ ! -d "$GITHUB_WORKSPACE/dependencies/idf-tools/v5.3/esp-idf" ]; then
  echo "ERROR: ESP-IDF path not found at expected location"
  exit 1
fi

Length of output: 173


Confirm ESP-IDF installation path in CI
We’ve updated default.env.esp.idf.path to point at dependencies/idf-tools/v5.3/esp-idf. Make sure your install-esp-idf-action@v1 step installs ESP-IDF into exactly that directory under $GITHUB_WORKSPACE. For example, add a CI check:

#!/bin/bash
ESP_IDF_DIR="${GITHUB_WORKSPACE}/dependencies/idf-tools/v5.3/esp-idf"
if [ ! -d "$ESP_IDF_DIR" ]; then
  echo "ERROR: ESP-IDF not found at $ESP_IDF_DIR"
  exit 1
fi

• File: tests/com.espressif.idf.ui.test/configs/default-test-linux.properties
• Line: 10 (default.env.esp.idf.path)

Please verify this path in your workflow and adjust if needed.

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

54-54: Addition of ESP_IDF_EIM_ID constant looks good.

This new environment variable constant is consistent with the naming pattern and will support the EIM-based configuration approach.


133-133: Simplified environment map initialization.

The code now uses System.getenv() directly instead of a utility method, which aligns with the broader environment variable handling refactoring in the codebase. This approach is more straightforward and maintains consistency with the changes made in related classes.

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

1-27: Class structure follows NLS pattern correctly.

The Messages class follows the standard Eclipse NLS pattern with proper static initialization. If you update the message keys in the properties file as suggested in the previous comment, remember to update the constant names here as well.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/NewProjectHandlerUtil.java (2)

19-19: Import updated to reflect architectural changes.

Replacing the import of InstallToolsHandler with EimConstants aligns with the broader refactoring of the tool management system.


38-38: Preference key updated for tool installation flag.

The change from using InstallToolsHandler.INSTALL_TOOLS_FLAG to EimConstants.INSTALL_TOOLS_FLAG aligns with the new EIM-based tool management approach. This ensures consistency with the new setup infrastructure.

tests/pom.xml (1)

33-33: System property added for test automation

Adding the -DtestRun=true flag to the JVM arguments enables conditional behavior in the IDE during automated tests. This is a well-structured approach for controlling UI behavior during test runs.

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

48-48: Properly exposing new watcher package

The addition of com.espressif.idf.core.tools.watcher to the exported packages list correctly makes the new EIM JSON file monitoring functionality accessible to other bundles in the plugin system.

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

208-208: Environment variable handling standardization

Switching to System.getenv() standardizes environment variable handling across the codebase, aligning with similar changes made throughout the PR. This simplifies the codebase by using Java's standard API directly instead of custom utility methods.

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

301-301: Consistent environment variable management

Using System.getenv() here maintains consistency with similar changes throughout the PR. The approach of creating a HashMap copy still allows for potential environment customization before passing to the process builder if needed.

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

134-134: Consistent environment variable sourcing approach.

The change from custom environment map to using System.getenv() aligns with the broader standardization of environment variable handling across the codebase. This simplifies the code and reduces maintenance overhead.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/dialogs/SbomCommandDialog.java (3)

286-287: Standardized environment variable handling.

Good change to use the standard Java system environment variables instead of a custom environment map. Creating a mutable HashMap copy is the correct approach since System.getenv() returns an unmodifiable map.


438-439: Consistent environment variable approach across methods.

This change maintains consistency with the previous method by using the same standardized approach to environment variables.


453-454: Completed standardization of environment variable handling.

This completes the standardization of environment variable handling in all three methods of this class. The consistent approach improves maintainability.

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

29-29: Standardized environment handling for process builders.

Good approach using putAll on the ProcessBuilder's environment map, which is already mutable. This directly incorporates the system environment variables without needing to create an intermediate HashMap.


38-38: Consistent process environment handling.

Maintains the same standardized approach used in the previous method. The consistency across related methods is good for maintainability.


47-47: Completed environment standardization for all process methods.

This completes the standardization across all three process creation methods in the class. Using System.getenv() directly is more straightforward than the previous approach.

tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/ProjectTestOperations.java (1)

582-582: Increased timeout for console output verification.

The timeout was increased from 3 seconds to 30 seconds. This change is likely necessary due to the new EIM-based workflow which might take longer to complete operations.

Consider adding a comment explaining why the timeout needed to be increased to help future maintainers understand the rationale behind this change.

tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectSDKconfigTest.java (2)

185-185: Same 15-minute timeout applied to context menu method.

This method also has the timeout increased to 15 minutes for the same operation, suggesting a systematic change in how SDK configuration loading works in the new architecture.

Are there any plans to improve the performance in future releases so that these extreme timeouts won't be necessary?


178-178:

❓ Verification inconclusive

The timeout value has been significantly increased to 15 minutes.

The timeout for waiting for the SDK Configuration tab to appear has been increased from what appears to be 5 seconds to 15 minutes (900,000ms). While this might be necessary for the new EIM-based workflow, such a long timeout could potentially mask underlying performance issues.

Could you:

  1. Explain why such a long timeout is necessary?
  2. Confirm whether there's any user feedback during this potentially lengthy wait?
  3. Consider if there might be a better approach, such as waiting for a specific event rather than using a fixed timeout?

🏁 Script executed:

#!/bin/bash
# Check for any logging or feedback mechanism during the wait period

grep -r "waitForSDKConfigurationTab" --include="*.java" .
grep -r "TestWidgetWaitUtility" --include="*.java" .

Length of output: 8896


🏁 Script executed:

#!/bin/bash
# Show implementation and any logging inside waitForSDKConfigurationTab
grep -R -n -C5 "waitForSDKConfigurationTab" tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/common/utility/TestWidgetWaitUtility.java

Length of output: 492


🏁 Script executed:

#!/bin/bash
# Retrieve full implementation of waitForSDKConfigurationTab
sed -n '273,330p' tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/common/utility/TestWidgetWaitUtility.java

Length of output: 931


Excessive maximum timeout in SDK Configuration test

The two calls to

TestWidgetWaitUtility.waitForSDKConfigurationTab(bot, 900_000);

raise the max wait from a few seconds to 15 minutes. While waitUntil is reactive (it ends as soon as the tab is active), a 15-minute ceiling can mask hangs or environment issues and there’s no intermediate feedback during that period.

Could you:

  • Explain why a 15-minute maximum is required under the new EIM workflow?
  • Confirm how the test runner or user sees progress (any logs or UI cues) while waiting?
  • Consider reducing the ceiling, adding interim logging, or surfacing a “loading…” indicator so failures don’t stall pipelines for so long?
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (1)

480-481:

❓ Verification inconclusive

Removal of IDF_TOOLS_PATH from environment variables.

The code no longer explicitly passes the IDF_TOOLS_PATH environment variable to the build process. This aligns with the broader changes in environment variable handling where standard system environment variables are used instead of custom environment maps.

Can you confirm that the build process will still correctly access the IDF_TOOLS_PATH through the system environment? This change seems to be part of a larger refactoring effort, but it's important to ensure the build functionality remains intact.


🏁 Script executed:

#!/bin/bash
# Check for other uses of IDF_TOOLS_PATH in the codebase
grep -r "IDF_TOOLS_PATH" --include="*.java" .
# Check how environment variables are now handled
grep -r "System.getenv" --include="*.java" . | grep -i "idf"

Length of output: 5874


I want to confirm how startBuildProcess constructs the process environment—whether it merges the full system environment or only uses the provided vars. Let’s inspect its implementation:


🏁 Script executed:

#!/bin/bash
grep -n -C3 "startBuildProcess" bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

Length of output: 1031


Let’s inspect how startBuildProcess is implemented—in particular, whether it merges the full system environment with the supplied vars or only uses the latter.


🏁 Script executed:

#!/bin/bash
grep -n -C5 "startBuildProcess" bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/CMakeBuildConfiguration.java

Length of output: 250


I need to inspect the startBuildProcess implementation in IDFBuildConfiguration.java to confirm how it handles environment variables:


🏁 Script executed:

#!/bin/bash
grep -n -C10 "startBuildProcess" bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

Length of output: 2925


I need to locate the startBuildProcess method definition to verify how it merges (or replaces) environment variables:


🏁 Script executed:

#!/bin/bash
# Find the method signature for startBuildProcess in IDFBuildConfiguration.java
grep -R -n "Process startBuildProcess" bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

Length of output: 131


Let’s search the entire repo for the startBuildProcess definition to locate its implementation:


🏁 Script executed:

#!/bin/bash
grep -R -n "startBuildProcess" .

Length of output: 598


I need to identify the class hierarchy to locate startBuildProcess. Let’s list the build package and inspect the IDFBuildConfiguration declaration:


🏁 Script executed:

#!/bin/bash
echo "Build package files:"
ls bundles/com.espressif.idf.core/src/com/espressif/idf/core/build

echo
echo "IDFBuildConfiguration declaration:"
grep -n "class IDFBuildConfiguration" bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

Length of output: 769


Confirmation needed: ensure IDF_TOOLS_PATH is picked up from the system environment

We’ve removed the explicit passing of IDF_TOOLS_PATH to the build process—now only PYTHONUNBUFFERED (and any other vars) are passed to startBuildProcess. Since startBuildProcess is inherited from CBuildConfiguration, please verify that:

  • CBuildConfiguration.startBuildProcess(...) merges System.getenv() into the child process’s environment rather than replacing it.
  • Under normal usage, IDF_TOOLS_PATH is present in System.getenv() when the build runs.
  • No code path calls startBuildProcess(...) with an empty or minimal env array without first seeding it with system vars.

Without this confirmation, builds may lose access to the tools in IDF_TOOLS_PATH.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonChangeListener.java (1)

7-17: Well-designed interface for the new EIM architecture.

This interface follows good design principles with a focused single responsibility, clear method signature, and descriptive naming. It will serve as an important component in the new EIM JSON-driven workflow, allowing components to react to configuration changes.

bundles/com.espressif.idf.serial.monitor/src/com/espressif/idf/serial/monitor/core/IDFMonitor.java (1)

158-158: Environment variable handling standardized to use System.getenv()

This change aligns with the broader refactoring across the codebase to use System.getenv() directly instead of custom environment maps via IDFUtil.getSystemEnv(). This simplifies environment handling and creates more consistent behavior.

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

180-181: Improved directory filtering to prevent potential issues

The refactored method now properly filters out non-existent paths and non-directory entries, which is a good defensive programming practice. This will prevent potential issues when these paths are used to find toolchains later in the code.


319-319: Environment variable handling standardized to use System.getenv()

This change aligns with the broader refactoring across the codebase to use System.getenv() directly instead of custom environment maps from IDFUtil. This creates more consistent behavior in environment variable handling.

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

144-147: Environment variable handling standardized

The code now uses System.getenv() directly instead of a custom environment map from IDFUtil.getSystemEnv(). This aligns with the broader refactoring of environment variable handling across the codebase.

Also note that the removal of the IDF_GITHUB_ASSETS and PIP_EXTRA_INDEX_URL environment variables (which were previously set from preferences) is part of the cleanup of deprecated or unused environment configuration related to tool installation URLs.

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

37-39: Appropriate message constants added for EIM-related notifications.

These new message constants properly support the EIM-based workflow by providing standardized messages for notifying users when EIM tooling is missing.


42-44: LGTM - Clear notification messages for ESP-IDF workspace state.

These message constants appropriately inform users when there's no active ESP-IDF in the workspace, which is essential for the new EIM-centric workflow.


45-52: Well-structured message constants for configuration migration.

These constants provide a complete set of messages for guiding users through the old configuration export process, covering all necessary dialog states (title, selection, success, and failure messages).

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

28-37: Class correctly refactored to work with SetupToolsInIde.

The class has been properly renamed and updated to store a reference to the SetupToolsInIde job it's listening to. The constructor parameters and member initialization align with the new architecture.


53-60: Good addition of rollback mechanism for error handling.

The listener now correctly checks the job result severity and invokes rollback on the SetupToolsInIde job if it failed, which provides a clean recovery mechanism for installation failures.


61-68: Successfully updated preference flag to use EimConstants.

The code correctly uses the new EimConstants.INSTALL_TOOLS_FLAG instead of the removed InstallToolsHandler constant, properly aligning with the refactored architecture.


79-86: Improved UI thread handling with async execution.

Moving the UI refresh operations to run asynchronously on the UI thread is a good practice that prevents blocking the job thread and improves responsiveness.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/IdfInstalled.java (1)

1-80: Well-structured POJO for ESP-IDF installation representation.

This is a clean, well-structured value object class that represents an installed ESP-IDF instance. The Gson @Expose annotations properly mark fields for JSON serialization/deserialization, which aligns with the JSON-driven configuration approach mentioned in the PR summary.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties (1)

22-41: Good user guidance messages for ESP-IDF installation and configuration.

These new message keys provide clear guidance to users about ESP-IDF installation status, configuration migration, and actions needed. The messages are well-structured with placeholders for dynamic content and include HTML formatting for hyperlinks where appropriate.

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

546-550: Updated startup classes to match new architecture.

The change replaces the previous startup classes with new EspressifGeneralStartup and EspressifToolStartup classes. This aligns with the PR's objective to refactor the tool management system and move to a JSON-driven configuration approach.

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/messages.properties (1)

5-12: Simplified UI messages focused on ESP-IDF Manager.

The changes streamline the message keys to focus on the ESP-IDF Manager UI elements and notifications, replacing the previous detailed installation messages. This reflects the architectural shift from wizard-driven tool installation to a JSON-based configuration model.

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

212-235: Good addition of overloaded method for Python environment path resolution.

This new overloaded method for resolving Python environment paths is well-implemented and supports the new EIM-based workflow. It properly handles platform-specific subdirectories and has appropriate fallback logic.


802-803: Updated to use standard system environment.

The change to use System.getenv() directly instead of a custom environment map is consistent with the PR's goal of standardizing environment variable handling across the codebase.

bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java (2)

95-127: Well-refactored process launching with improved error handling.

The process launching code has been nicely refactored to use a more modular approach with better encapsulation:

  1. Environment setup is extracted to dedicated methods
  2. Arguments are built incrementally for better readability
  3. The ProcessBuilderFactory encapsulates process creation
  4. Exception handling is broadened to catch all exceptions

These changes improve maintainability and make the code more robust.


134-139: Good method extraction for environment preparation.

Extracting environment setup into a dedicated method improves code organization and reusability.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/watcher/EimJsonWatchService.java (6)

1-44: Well-designed file watcher implementation with proper threading.

The EimJsonWatchService is well implemented with:

  1. Proper daemon thread setup
  2. Platform-specific directory path detection
  3. Appropriate watch event registration
  4. Clean initialization with logging

46-67: Good singleton pattern implementation.

The singleton pattern is implemented using the thread-safe initialization-on-demand holder idiom, which is a best practice for singleton creation in Java.


69-80: Thread-safe listener collection implemented correctly.

Using CopyOnWriteArrayList for listeners and null-checking before adding listeners is a good practice for concurrent access patterns.


82-127: Well-implemented event processing with proper error handling.

The run method contains proper exception handling for:

  1. InterruptedException with thread interruption
  2. ClosedWatchServiceException
  3. OVERFLOW event filtering
  4. Watch key validity checking

The pattern matching syntax for context objects is modern and clean.


128-138: Good resource cleanup in the watch service.

The code properly closes the WatchService in a try-catch block, which is essential for resource management.


140-151: Well-designed thread termination methods.

The interrupt and shutdown methods properly set the running flag to false before calling super.interrupt(), ensuring clean thread termination.

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/ToolInitializer.java (3)

1-36: Well-structured initialization class with clear responsibilities.

The ToolInitializer class is well-designed with appropriate field declarations, constructor, and clear purpose as indicated in the class javadoc.


60-69: Good file operation handling with exception propagation.

The exportOldConfigIfNeeded method correctly:

  1. Checks for file existence before attempting to copy
  2. Uses Files.copy with appropriate StandardCopyOption
  3. Propagates IOException to caller for proper handling
  4. Updates preferences to track the export operation

82-87:

❓ Verification inconclusive

Consider more robust path handling for cross-platform compatibility.

The isEimIdfJsonPresent method relies on platform-specific path constants. Consider adding a unit test to verify this works correctly across different operating systems.


🏁 Script executed:

#!/bin/bash
# Check if the platform-specific path constants are defined correctly
echo "Checking EimConstants path definitions..."
ast-grep --pattern $'String EIM_WIN_PATH = $_;$\nString EIM_POSIX_PATH = $_;'

Length of output: 170


🏁 Script executed:

#!/bin/bash
# Locate the EimConstants class and inspect the path constants
echo "Finding EimConstants class file..."
EC_FILE=$(rg -l "class EimConstants")
if [ -z "$EC_FILE" ]; then
  echo "EimConstants class not found."
  exit 1
fi
echo "Found EimConstants at: $EC_FILE"
echo
echo "EIM_WIN_PATH definition:"
grep -n "EIM_WIN_PATH" "$EC_FILE"
echo
echo "EIM_POSIX_PATH definition:"
grep -n "EIM_POSIX_PATH" "$EC_FILE"

Length of output: 213


Strengthen cross-platform path resolution and add tests

I wasn’t able to locate the EimConstants definitions in the repo, so please confirm that EIM_WIN_PATH and EIM_POSIX_PATH are defined correctly (and cover all supported OS variants). In addition:

  • Consider using java.nio.file.Path/Paths and Files.exists(...) instead of hard-coded string constants to build the path (e.g.,

    Path eimJson = Paths.get(System.getProperty("user.home"), ".espressif", "idf.json");
    return Files.exists(eimJson);
    

    ).

  • Add a lightweight unit test (e.g. with JUnit and System rules or Mockito) to simulate different Platform.getOS() values and verify that the detection logic resolves the expected file locations on both Windows and POSIX.

This will make maintenance easier and ensure consistent behavior across environments.

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

23-31: Remember to add the new keys to the properties bundle
EspIdfManagerNameCol, IDFGuideLinkLabel_Text, and the new EIM-JSON messages must exist in com.espressif.idf.ui.tools.messages.properties; otherwise NLS will log missing-key errors at runtime.

Comment on lines +8 to +14
branches:
- master
- release/**
pull_request:
branches: [ master ]
branches:
- master
- release/**
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix YAML indentation under triggers
Indentation of list items under both push.branches and pull_request.branches is off by one space (5 vs. 6), which can lead to malformed YAML or unexpected behavior.

Proposed patch:

   on:
     push:
-    branches:
-     - master
-     - release/**
+    branches:
+      - master
+      - release/**
     pull_request:
-    branches:
-     - master
-     - release/**
+    branches:
+      - master
+      - release/**
📝 Committable suggestion

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

Suggested change
branches:
- master
- release/**
pull_request:
branches: [ master ]
branches:
- master
- release/**
on:
push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 9-9: wrong indentation: expected 6 but found 5

(indentation)


[warning] 13-13: wrong indentation: expected 6 but found 5

(indentation)

Comment on lines 24 to +27
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.10'
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update Python setup action to latest version
The workflow uses actions/setup-python@v2, which is outdated. Align with other workflows and benefit from bug fixes by upgrading to:

-    uses: actions/setup-python@v2
+    uses: actions/setup-python@v4
📝 Committable suggestion

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

Suggested change
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.10'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
🧰 Tools
🪛 actionlint (1.7.4)

25-25: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

Comment on lines +29 to 33
- name: Install ESP-IDF via eim
uses: espressif/install-esp-idf-action@v1
with:
version: 'v5.3'

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove tab characters to fix YAML syntax error
Line 29 contains tab characters, which YAML does not allow. Replace tabs with spaces:

-      uses: espressif/install-esp-idf-action@v1		# contains tabs
+      uses: espressif/install-esp-idf-action@v1    # tabs → spaces
📝 Committable suggestion

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

Suggested change
- name: Install ESP-IDF via eim
uses: espressif/install-esp-idf-action@v1
with:
version: 'v5.3'
- name: Install ESP-IDF via eim
uses: espressif/install-esp-idf-action@v1
with:
version: 'v5.3'
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 29-29: syntax error: found character '\t' that cannot start any token

(syntax)

Comment on lines +8 to +14
branches:
- master
- release/**
pull_request:
branches: [ master ]
branches:
- master
- release/**
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix YAML indentation under triggers
The list items for push.branches and pull_request.branches are mis-indented (5 spaces instead of 6). Correcting this will prevent YAML parsing issues.

   on:
     push:
-    branches:
-     - master
-     - release/**
+    branches:
+      - master
+      - release/**
     pull_request:
-    branches:
-     - master
-     - release/**
+    branches:
+      - master
+      - release/**
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 9-9: wrong indentation: expected 6 but found 5

(indentation)


[warning] 13-13: wrong indentation: expected 6 but found 5

(indentation)


String EIM_POSIX_DIR = System.getProperty("user.home").concat("/.espressif/tools/"); //$NON-NLS-1$//$NON-NLS-2$

String EIM_WIN_DIR = "C:\\Espressif\\tools\\"; //$NON-NLS-1$
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid hardcoding installation paths

The Windows installation directory is hardcoded, which may not respect user customizations or non-standard installation locations. Consider using environment variables or configuration settings to allow for customization.

Comment on lines 248 to 256
{
removeColumn.getColumn().dispose();
}

if (nameColumn != null && nameColumn.getColumn() != null)
{
nameColumn.getColumn().dispose();
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Potential Colour leak when columns are recreated
setupColumns() disposes TableViewerColumns but the associated ColumnLabelProvider (which owns an SWT Color) is not disposed until the viewer is disposed.
Because setupColumns() can be invoked repeatedly (refreshEditorUI()), many Color objects can accumulate.
Add labelProvider.dispose() before the column is disposed, or cache/re-use a single label-provider instance.

Comment on lines 378 to +396
case 1:
cell.setText(idfToolSet.getIdfVersion());
cell.setText(getIdfVersion(idfInstalled));
break;
case 2:
cell.setText(idfToolSet.getIdfLocation());
cell.setText(idfInstalled.getName());
break;
case 3:
cell.setText(idfInstalled.getPath());
break;
case 4:
break;
}
}

private String getIdfVersion(IdfInstalled idfInstalled)
{
String version = ToolsUtility.getIdfVersion(idfInstalled, eimJson.getGitPath());
return version;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Heavy external process executed on UI thread for every cell refresh
getIdfVersion() launches a shell, executes the activation script and waits for completion.
Because update() runs in the SWT UI thread, the table freezes while every row (and every repaint) spawns a new process – catastrophic for responsiveness on large lists.
Cache the version once per IdfInstalled (e.g., in a Map<IdfInstalled,String>), and/or compute it in a background Job then update the viewer asynchronously.

Comment on lines +83 to 92
public static ESPIDFMainTablePage getInstance(EimJson eimJson)
{
if (espidfMainTablePage == null)
{
espidfMainTablePage = new ESPIDFMainTablePage();
}

ESPIDFMainTablePage.eimJson = eimJson;
return espidfMainTablePage;
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Singleton keeps mutable global state – risk of stale data & race-conditions
eimJson is held in a static field that is overwritten every time getInstance() is called.
Because the method is not synchronized, concurrent calls from UI thread / background jobs can race, and previously opened editors might suddenly see a different JSON instance than they were created with.
Consider either

  • removing the static field and passing the current EimJson through explicit method parameters, or
  • synchronising access and cloning the model to avoid unexpected mutation.

Comment on lines +274 to 279
nameColumn = new TableViewerColumn(tableViewer, SWT.NONE);
nameColumn.getColumn().setText(Messages.EspIdfManagerNameCol);
nameColumn.setLabelProvider(new IdfManagerTableColumnLabelProvider());
setComparatorForCols(nameColumn, colIndex++);
tableColumnLayout.setColumnData(nameColumn.getColumn(), new ColumnWeightData(3, 50, true));

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Comparator index/order mismatch leads to wrong sorting
The comparator is told that versionColumn is index 0, nameColumn is index 1 and locationColumn is index 2, but the compare() implementation (lines 530-545) assumes 0 → name, 1 → path, 2 → active‐state.
Clicking “Version” currently sorts by name, etc.
Patch either the index assignment or the switch logic.
A minimal fix is shown below.

@@
-            switch (propertyIndex)
+            switch (propertyIndex)
             {
-            case 0:                              // Version column
-                rc = ToolsUtility.getIdfVersion(p1, eimJson.getGitPath())
-                         .compareTo(
-                     ToolsUtility.getIdfVersion(p2, eimJson.getGitPath()));
+            case 0:                              // Version column
+                rc = ToolsUtility
+                        .getIdfVersion(p1, eimJson.getGitPath())
+                        .compareTo(
+                          ToolsUtility.getIdfVersion(p2, eimJson.getGitPath()));
                 break;
-            case 1:
-                rc = p1.getPath().compareTo(p2.getPath());      // Name column
+            case 1:                              // Name column
+                rc = p1.getName().compareTo(p2.getName());
                 break;
-            case 2:
-                Boolean p1State = ToolsUtility.isIdfInstalledActive(p1); // Location column
-                Boolean p2State = ToolsUtility.isIdfInstalledActive(p2);
-                rc = p1State.compareTo(p2State);
+            case 2:                              // Location column
+                rc = p1.getPath().compareTo(p2.getPath());
                 break;
             }
📝 Committable suggestion

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

Suggested change
nameColumn = new TableViewerColumn(tableViewer, SWT.NONE);
nameColumn.getColumn().setText(Messages.EspIdfManagerNameCol);
nameColumn.setLabelProvider(new IdfManagerTableColumnLabelProvider());
setComparatorForCols(nameColumn, colIndex++);
tableColumnLayout.setColumnData(nameColumn.getColumn(), new ColumnWeightData(3, 50, true));
// … somewhere inside your compare(p1, p2, propertyIndex) method …
switch (propertyIndex)
{
case 0: // Version column
rc = ToolsUtility
.getIdfVersion(p1, eimJson.getGitPath())
.compareTo(
ToolsUtility.getIdfVersion(p2, eimJson.getGitPath()));
break;
case 1: // Name column
rc = p1.getName().compareTo(p2.getName());
break;
case 2: // Location column
rc = p1.getPath().compareTo(p2.getPath());
break;
}

Comment on lines +27 to 66
Files.copy(tararchiveinputstream, pathEntryOutput, StandardCopyOption.REPLACE_EXISTING);
Runtime.getRuntime().exec("/bin/chmod 755 ".concat(pathEntryOutput.toString())); //$NON-NLS-1$
}

}

tararchiveinputstream.close();
process.waitFor();
}
catch (Exception e)
{
Logger.log(e);
}
}

public static void extractTarXz(String tarFile, String outputDir)
{
Path pathOutput = Paths.get(outputDir);
Map<Path, Path> symLinks = new HashMap<>();
Map<Path, Path> hardLinks = new HashMap<>();
try
{
FileInputStream fileInputStream = new FileInputStream(tarFile);
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
XZInputStream xzInputStream = new XZInputStream(bufferedInputStream);
TarArchiveInputStream tararchiveinputstream = new TarArchiveInputStream(xzInputStream);
TarArchiveEntry archiveentry = null;
while ((archiveentry = tararchiveinputstream.getNextTarEntry()) != null)
{
Path pathEntryOutput = pathOutput.resolve(archiveentry.getName());
if (archiveentry.isSymbolicLink())
{
symLinks.put(pathEntryOutput,
pathOutput.resolve(archiveentry.getName()).getParent().resolve(archiveentry.getLinkName()));
continue;
}
else if (archiveentry.isLink())
{
hardLinks.put(pathEntryOutput,
pathOutput.resolve(archiveentry.getLinkName()));
continue;
}
else if (archiveentry.isDirectory())
{
if (!Files.exists(pathEntryOutput))
Files.createDirectories(pathEntryOutput);
}
else
{
System.out.println(pathEntryOutput.toString() + " " + archiveentry.getSize()); //$NON-NLS-1$
Files.copy(tararchiveinputstream, pathEntryOutput, StandardCopyOption.REPLACE_EXISTING);
Runtime.getRuntime().exec("/bin/chmod 755 ".concat(pathEntryOutput.toString())); //$NON-NLS-1$
}
}
tararchiveinputstream.close();
xzInputStream.close();
fileInputStream.close();
hardLinks.forEach(ToolsUtility::createHardLinks);
symLinks.forEach(ToolsUtility::createSymLinks);
}
catch (Exception e)
{
Logger.log(e);
}
}

private static void createHardLinks(Path link, Path target)
{
try
{
Files.deleteIfExists(link);
Files.createLink(link, target);
}
catch (Exception e)
{
Logger.log(e);
}
}

private static void createSymLinks(Path link, Path target)
{
try
{
Files.deleteIfExists(link);
Files.createSymbolicLink(link, target.toRealPath());
}
catch (Exception e)
{
Logger.log(e);
}
}

public static String getReadableSizeMB(double size)
{
size /= 1024; // KB
size /= 1024; // MB
DecimalFormat df = new DecimalFormat("0.00"); //$NON-NLS-1$
return String.valueOf(df.format(size)).concat(" MB"); //$NON-NLS-1$
return espIdfVersion;
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Null-safety & early-exit checks missing
activationScript and idfInstalled fields are assumed non-null. If the JSON is malformed, activationScript can be null, causing NPEs in new File(...) or ProcessBuilder.
Guard with:

if (idfInstalled == null || idfInstalled.getActivationScript() == null) {
    return null;
}

Copy link
Collaborator

@sigmaaa sigmaaa left a comment

Choose a reason for hiding this comment

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

Hi @alirana01,

Thanks for the PR! It looks good overall. I’ve left a few comments with suggestions we can check together.

private void prepEnvMap(Map<String, String> env)
{
env.put("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$
env.put("IDF_CCACHE_ENABLE", "false"); //$NON-NLS-1$ //$NON-NLS-2$
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to set IDF_CCACHE_ENABLE to false here? I believe it will cause a redundant build if IDF_CCACHE_ENABLE is set to true in the environment variables.

}
catch (CoreException e)
catch (Exception e)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think throwing a generic Exception is not a good practice. It's better to be as specific as possible with exception handling to make the code more robust and maintainable.

@@ -162,7 +155,7 @@ public Process start() throws Exception
idfEnvMap.put("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$

// Update with the CDT build environment variables
Map<String, String> environment = new HashMap<>(IDFUtil.getSystemEnv());
Map<String, String> environment = new HashMap<>(System.getenv());
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should verify whether this is still necessary. If the ESP-IDF environment variables are already present in the system environment, we likely don’t need to pass them explicitly — the local terminal should inherit them automatically. The same applies to the IDF terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants