Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
*******************************************************************************/
package com.espressif.idf.ui.wizard;

import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;

import com.espressif.idf.core.logging.Logger;
import com.espressif.idf.ui.tools.ManageEspIdfVersionsHandler;

public class ToolsMissingWizardPage extends WizardPage
{


protected ToolsMissingWizardPage(String errorMsg)
{
super(Messages.ToolsMissingWizardPage_PagaName);
Expand All @@ -28,15 +33,35 @@ public void createControl(Composite parent)
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new GridLayout(1, false));


Label label = new Label(container, SWT.WRAP);
label.setText(Messages.ToolsMissingWizardPage_MainText);
Link link = new Link(container, SWT.WRAP);
link.setText(Messages.ToolsMissingWizardPage_MainText);
link.addSelectionListener(new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
openEspIdfManagerAndCloseWizard();
}
});

GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
label.setLayoutData(gd);
link.setLayoutData(gd);

setControl(container);

setPageComplete(false);
}

private void openEspIdfManagerAndCloseWizard()
{
try
{
new ManageEspIdfVersionsHandler().execute(null);
}
catch (ExecutionException ex)
{
Logger.log(ex);
}
getShell().close();
}
Comment on lines +55 to +66

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -A25 -B5 'class ManageEspIdfVersionsHandler|asyncExec|IDE\.openEditor' bundles/com.espressif.idf.ui/src

Repository: espressif/idf-eclipse-plugin

Length of output: 50385


🏁 Script executed:

#!/bin/bash
fd -a 'ToolsMissingWizardPage.java|ManageEspIdfVersionsHandler.java' bundles/com.espressif.idf.ui/src | while read -r f; do
  echo "===== $f ====="
  wc -l "$f"
  sed -n '1,130p' "$f" | cat -n
done

Repository: espressif/idf-eclipse-plugin

Length of output: 4371


Do not close the wizard before the manager editor launch succeeds.

ManageEspIdfVersionsHandler.execute(null) returns immediately after scheduling the editor launch asynchronously; failures inside that async runnable are only logged. Closing the wizard at line 65 can leave the user without ESP-IDF Manager even when editor launch fails. Keep the wizard visible and signal launch completion/failure through the handler instead, closing only after a successful launch or showing an actionable error on failure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/ToolsMissingWizardPage.java`
around lines 55 - 66, The openEspIdfManagerAndCloseWizard flow must not
unconditionally close the wizard after
ManageEspIdfVersionsHandler.execute(null), since the editor launch completes
asynchronously. Update the handler or its completion mechanism to report launch
success or failure, close the wizard only on success, and keep it open while
presenting an actionable error when the launch fails.

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ NewComponentWizardPage_CantCreateCompErr=Can not create a component without a pr
NewComponentWizardPage_ProjectDoesntExistErr=Project doesn't exist
NewComponentWizardPage_ProjectNameLbl=Project name:
IdfReconfigureJobName=Running idf.py reconfigure command...
ToolsMissingWizardPage_MainText=Install or configure the ESP-IDF tools before continuing. Open the ESP-IDF Manager to resolve the issue, then restart this wizard.
ToolsMissingWizardPage_MainText=Install or configure the ESP-IDF tools before continuing. Open the <a>ESP-IDF Manager</a> to resolve the issue, then restart this wizard.
ToolsMissingWizardPage_PagaName=ToolsMissingPage
ToolsMissingWizardPage_Title=ESP-IDF Tools Required
Loading