-
Notifications
You must be signed in to change notification settings - Fork 133
EIM Path discovery improvements #1446
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,15 +115,11 @@ else if (toolInitializer.isEimIdfJsonPresent() && !toolInitializer.isEspIdfSet() | |
| promptUserToOpenToolManager(eimJson); | ||
| } | ||
|
|
||
| // Set EimPath on every startup to ensure proper path in configurations | ||
| if (eimJson != null) | ||
| // Set EimPath on every startup: system PATH first, then eim_idf.json, then default locations | ||
| String resolvedEimPath = toolInitializer.resolveEimExecutablePath(eimJson); | ||
| if (!StringUtil.isEmpty(resolvedEimPath)) | ||
| { | ||
| idfEnvironmentVariables.addEnvVariable(IDFEnvironmentVariables.EIM_PATH, eimJson.getEimPath()); | ||
| } | ||
| else | ||
| { | ||
| // Fail-safe call to ensure if the eim is in Applications or user.home it is setup in env vars | ||
| toolInitializer.findAndSetEimPath(); | ||
| idfEnvironmentVariables.addEnvVariable(IDFEnvironmentVariables.EIM_PATH, resolvedEimPath); | ||
| } | ||
|
Comment on lines
+118
to
123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because The root-cause fix belongs in 🤖 Prompt for AI Agents |
||
|
|
||
| } | ||
|
|
@@ -163,22 +159,15 @@ private void startExportOldConfig() | |
| { | ||
| try | ||
| { | ||
| // if eim json is present it means that it contains the updated path and we use that else we fallback to | ||
| // finding eim in default paths | ||
| Path eimPath; | ||
| String eimPathEnvVar = idfEnvironmentVariables.getEnvValue(IDFEnvironmentVariables.EIM_PATH); | ||
| if (eimJson != null) | ||
| // Same resolution order as workspace EIM_PATH: PATH, then eim_idf.json, then defaults | ||
| String resolved = toolInitializer.resolveEimExecutablePath(eimJson); | ||
| if (StringUtil.isEmpty(resolved)) | ||
| { | ||
| eimPath = Paths.get(eimJson.getEimPath()); | ||
| } | ||
| else if (!StringUtil.isEmpty(eimPathEnvVar)) | ||
| { | ||
| eimPath = Paths.get(eimPathEnvVar); | ||
| } | ||
| else | ||
| { | ||
| eimPath = toolInitializer.getDefaultEimPath(); | ||
| Logger.log("Cannot export old config: EIM executable path could not be resolved."); //$NON-NLS-1$ | ||
| writeToErrorConsoleStream(Messages.OldConfigExportCompleteFailMsg); | ||
| return; | ||
| } | ||
| Path eimPath = Paths.get(resolved); | ||
|
|
||
| IStatus status = toolInitializer.exportOldConfig(eimPath); | ||
| Logger.log("Tools Conversion Process Message: "); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: espressif/idf-eclipse-plugin
Length of output: 1898
🏁 Script executed:
Repository: espressif/idf-eclipse-plugin
Length of output: 1248
🏁 Script executed:
Repository: espressif/idf-eclipse-plugin
Length of output: 404
🏁 Script executed:
Repository: espressif/idf-eclipse-plugin
Length of output: 836
🏁 Script executed:
Repository: espressif/idf-eclipse-plugin
Length of output: 465
🏁 Script executed:
Repository: espressif/idf-eclipse-plugin
Length of output: 220
isEimInstalled()returns false when EIM exists only ineim_idf.json, triggering unnecessary downloads.Passing
nulltoresolveEimExecutablePath()skips the JSON-path branch (lines 83–90). If EIM is located only at a custom path recorded ineim_idf.json— not on the systemPATH, not inEIM_PATH, and not at the default location —isEimInstalled()returnsfalse. This causesEimButtonLaunchListener.java:72to unconditionally trigger a download job even though EIM is already installed.The simplest fix is to load the JSON locally and pass it through:
🔧 Proposed fix
public boolean isEimInstalled() { - return !StringUtil.isEmpty(resolveEimExecutablePath(null)); + EimJson eimJson = null; + try + { + eimJson = loadEimJson(); + } + catch (EimVersionMismatchException e) + { + Logger.log(e); + } + return !StringUtil.isEmpty(resolveEimExecutablePath(eimJson)); }📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alirana01 please check this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.