Skip to content

Restore highlight visited nodes preference - #1605

Open
PrakarshSrivastav wants to merge 1 commit into
eclipse-windowbuilder:masterfrom
PrakarshSrivastav:master
Open

Restore highlight visited nodes preference#1605
PrakarshSrivastav wants to merge 1 commit into
eclipse-windowbuilder:masterfrom
PrakarshSrivastav:master

Conversation

@PrakarshSrivastav

Copy link
Copy Markdown

The highlight visited lines preference was disabled because the wiring between JavaInfo and the editor was commented out. It had been cut because DesignPageSite lives in org.eclipse.wb.core, which must not depend on JDT, while the visited nodes were represented as org.eclipse.jdt.core.dom.ASTNode.

Convert the visited ASTNodes to plain line numbers in JavaInfo before handing them to the site, using the existing AstEditor.getLineNumber helper. This keeps org.eclipse.wb.core free of JDT types while restoring the call chain from JavaInfo through DesignPageSite and DesignPage down to DesignerEditor and VisitedLinesHighlighter, which already knew how to paint the highlighted lines.

Fixes #1590

@ptziegler ptziegler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the idea of using the visited lines as method parameter, rather than the AST nodes. That makes things a lot more flexible!

Comment on lines +50 to +54
/**
* Highlight in editor the given lines, which were visited while evaluating the components.
*/
void highlightVisitedLines(Collection<Integer> lines);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This interface is API, so adding a new method breaks binary compatibility. I don't think it would be that big of a deal, but I'd like to avoid it if possible. As far as I can tell, it's not needed here, so I would just keep the method in DesignPageSite.

@ptziegler

Copy link
Copy Markdown
Contributor

@PrakarshSrivastav Can you rebase on master and squash your commits? I fear a merge conflict snuck into the DesignEditor class.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Test Results

     4 files  ±0       4 suites  ±0   2h 23m 44s ⏱️ -14s
 7 025 tests ±0   6 995 ✅ ±0  30 💤 ±0  0 ❌ ±0 
23 696 runs  ±0  23 602 ✅ ±0  94 💤 ±0  0 ❌ ±0 

Results for commit 1eb82fb. ± Comparison against base commit 980ff73.

♻️ This comment has been updated with latest results.

The highlight visited lines preference was disabled because the wiring
between JavaInfo and the editor was commented out. It had been cut
because DesignPageSite lives in org.eclipse.wb.core, which must not
depend on JDT, while the visited nodes were represented as
org.eclipse.jdt.core.dom.ASTNode.

Convert the visited ASTNodes to plain line numbers in JavaInfo before
handing them to the site, using the existing AstEditor.getLineNumber
helper. This keeps org.eclipse.wb.core free of JDT types while
restoring the call chain from JavaInfo through DesignPageSite and
DesignPage down to DesignerEditor and VisitedLinesHighlighter, which
already knew how to paint the highlighted lines.

Fixes eclipse-windowbuilder#1590

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@PrakarshSrivastav

Copy link
Copy Markdown
Author

@PrakarshSrivastav Can you rebase on master and squash your commits? I fear a merge conflict snuck into the DesignEditor class.

Good catch, thanks. Moved highlightVisitedLines so it's only declared on the internal DesignPageSite class, not on IDesignPageSite. The interface is now untouched.

@ptziegler ptziegler added this to the 1.26.0 milestone Sep 9, 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.

Restore "highlight visited nodes" preference

2 participants