Skip to content

IEP-1721 Refactor Tab Groups to declare tabs in plugin.xml#1407

Open
sigmaaa wants to merge 3 commits intomasterfrom
IEP-1721
Open

IEP-1721 Refactor Tab Groups to declare tabs in plugin.xml#1407
sigmaaa wants to merge 3 commits intomasterfrom
IEP-1721

Conversation

@sigmaaa
Copy link
Collaborator

@sigmaaa sigmaaa commented Mar 4, 2026

Description

Migrated the tab declarations from the Java class to plugin.xml using the org.eclipse.debug.ui.launchConfigurationTabs extension point. This aligns with modern Eclipse declarative UI patterns and makes the process of merging Launch and Debug configurations easier in the future.

Fixes # (IEP-1721)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this been tested?

  • check if all tabs are present during launch and debug configurations creation/editing, and work as expected

Test Configuration:

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

Dependent components impacted by this PR:

  • Launch Configuration
  • Debug Configuration

Checklist

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

Summary by CodeRabbit

  • New Features

    • Expanded launch-configuration UI: additional debug, startup, source lookup and target tabs with adjusted tab ordering.
  • Refactor

    • Simplified and unified tab initialization for launch configurations, improving consistency across debugging and flashing dialogs.
  • Tests

    • Updated UI tests to use a more reliable tab-activation method when interacting with the Main tab.

@sigmaaa sigmaaa self-assigned this Mar 4, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b7637a94-2f91-46dd-8b66-a8b4e7485e86

📥 Commits

Reviewing files that changed from the base of the PR and between 3b90ed0 and daac928.

📒 Files selected for processing (2)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/IDFProjectJTAGFlashTest.java
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectFlashProcessTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/IDFProjectJTAGFlashTest.java

📝 Walkthrough

Walkthrough

Moves launch-configuration tab wiring from Java into plugin.xml extensions, simplifies tab-group initialization by delegating tab setup to the framework, makes a TabDebugger constructor public, and updates SWTBot tests to activate the Main tab differently.

Changes

Cohort / File(s) Summary
OpenOCD plugin xml
bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml
Adds an org.eclipse.debug.ui.launchConfigurationTabs extension declaring Main, Debugger, Startup, SourceLookupTab, CommonTab, and TabSvdTarget entries with placement rules.
OpenOCD UI classes
bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java, bundles/com.espressif.idf.debug.gdbjtag.openocd/src/.../TabGroupLaunchConfiguration.java
Makes TabDebugger() public (removed TabStartup parameter) and replaces explicit tab array construction in TabGroupLaunchConfiguration#createTabs with a single setTabs() call. Check instantiation sites and lifecycle assumptions for TabDebugger.
Serial UI plugin xml
bundles/com.espressif.idf.launch.serial.ui/plugin.xml
Removes a buildTabGroup launchBar contribution and adds org.eclipse.debug.ui.launchConfigurationTabs entries for Core Build, Main (CMakeMainTab2), Environment, and Common tabs with placement directives.
Serial UI tab group
bundles/com.espressif.idf.launch.serial.ui/src/.../SerialFlashLaunchConfigTabGroup.java
Replaces conditional/tab-array construction with a single setTabs() call; removes imports and suppression tied to previous branching.
SWTBot tests
tests/.../IDFProjectJTAGFlashTest.java, tests/.../NewEspressifIDFProjectFlashProcessTest.java
Replaces cTabItem("Main").show()/setFocus() calls with tabItem("Main").activate() to select the Main tab in dialogs; minor formatting tweaks.
Manifest changes
bundles/com.espressif.idf.debug.gdbjtag.openocd/MANIFEST.MF
Lines changed (+63/-1) to reflect new extension declarations and related exports.

Sequence Diagram(s)

(omitted — changes are configuration and small control-flow adjustments not requiring a multi-component sequence diagram)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • kolipakakondal
  • AndriiFilippov
  • alirana01

Poem

🐰 I hopped through XML and code today,
Tabs rearranged in a tidy way,
Constructor opened, tests took a leap,
Plugins leaner, changes neat and deep,
A rabbit's nibble, quick and gay. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring tab group declarations from Java code to plugin.xml using the Eclipse extension mechanism.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch IEP-1721

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml`:
- Around line 231-239: There is a duplicate launch-tab contribution for
TabDebugger (class "com.espressif.idf.debug.gdbjtag.openocd.ui.TabDebugger" with
id "com.espressif.idf.debug.gdbjtag.openocd.ui.debuggertab") which causes
duplicate/misordered tabs at runtime; remove the redundant <tab> element so the
plugin.xml contains only a single declaration of TabDebugger (keep the correct
one and delete the other duplicate), ensuring the remaining entry preserves its
group and placement attributes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: add778f6-8dbd-4e24-b301-24c88989ca67

📥 Commits

Reviewing files that changed from the base of the PR and between 2261868 and 0567ece.

📒 Files selected for processing (5)
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabDebugger.java
  • bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/TabGroupLaunchConfiguration.java
  • bundles/com.espressif.idf.launch.serial.ui/plugin.xml
  • bundles/com.espressif.idf.launch.serial.ui/src/com/espressif/idf/launch/serial/ui/internal/SerialFlashLaunchConfigTabGroup.java

Comment on lines +231 to +239
<tab
class="com.espressif.idf.debug.gdbjtag.openocd.ui.TabDebugger"
group="com.espressif.idf.debug.gdbjtag.openocd.launchConfigurationTabGroup"
id="com.espressif.idf.debug.gdbjtag.openocd.ui.debuggertab"
name="Debugger">
<placement
after="org.eclipse.cdt.cdi.launch.mainTab">
</placement>
</tab>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml"

python - <<'PY'
import xml.etree.ElementTree as ET
from collections import Counter

file = "bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml"
root = ET.parse(file).getroot()

tab_ids = []
for ext in root.findall("extension"):
    if ext.attrib.get("point") == "org.eclipse.debug.ui.launchConfigurationTabs":
        for tab in ext.findall("tab"):
            tab_ids.append(tab.attrib.get("id"))

dups = {k: v for k, v in Counter(tab_ids).items() if k and v > 1}
print("Duplicate tab ids:", dups)
PY

rg -n 'com\.espressif\.idf\.debug\.gdbjtag\.openocd\.ui\.debuggertab|class="com\.espressif\.idf\.debug\.gdbjtag\.openocd\.ui\.TabDebugger"' "$FILE"

Repository: espressif/idf-eclipse-plugin

Length of output: 535


Remove duplicated TabDebugger tab contribution.

TabDebugger is declared twice with the same id (com.espressif.idf.debug.gdbjtag.openocd.ui.debuggertab) at lines 187–189 and lines 232–234. This duplicate registry entry can produce duplicate or misordered tabs at runtime.

🛠️ Proposed fix
-    <tab
-          class="com.espressif.idf.debug.gdbjtag.openocd.ui.TabDebugger"
-          group="com.espressif.idf.debug.gdbjtag.openocd.launchConfigurationTabGroup"
-          id="com.espressif.idf.debug.gdbjtag.openocd.ui.debuggertab"
-          name="Debugger">
-       <placement
-             after="org.eclipse.cdt.cdi.launch.mainTab">
-       </placement>
-    </tab>
📝 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
<tab
class="com.espressif.idf.debug.gdbjtag.openocd.ui.TabDebugger"
group="com.espressif.idf.debug.gdbjtag.openocd.launchConfigurationTabGroup"
id="com.espressif.idf.debug.gdbjtag.openocd.ui.debuggertab"
name="Debugger">
<placement
after="org.eclipse.cdt.cdi.launch.mainTab">
</placement>
</tab>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml` around lines 231
- 239, There is a duplicate launch-tab contribution for TabDebugger (class
"com.espressif.idf.debug.gdbjtag.openocd.ui.TabDebugger" with id
"com.espressif.idf.debug.gdbjtag.openocd.ui.debuggertab") which causes
duplicate/misordered tabs at runtime; remove the redundant <tab> element so the
plugin.xml contains only a single declaration of TabDebugger (keep the correct
one and delete the other duplicate), ensuring the remaining entry preserves its
group and placement attributes.

Copy link
Collaborator

@kolipakakondal kolipakakondal left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @sigmaaa LGTM.

How do you ensure (in an automated way) that this does not create any regression issues? Do we already have tests for this? If not, can you think of how we could implement them?

@AndriiFilippov
Copy link
Collaborator

@sigmaaa hi !

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

Launch / Debug config: all expected tabs are visible, tab order is correct, tab titles are correct, no tab is missing, no duplicate tabs appear ✅
Able to create and launch new Launch and Debug Configs ✅
LGTM 👍

@sigmaaa sigmaaa added this to the v4.2.0 milestone Mar 20, 2026
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.

3 participants