Restore highlight visited nodes preference - #1605
Conversation
ptziegler
left a comment
There was a problem hiding this comment.
I like the idea of using the visited lines as method parameter, rather than the AST nodes. That makes things a lot more flexible!
| /** | ||
| * Highlight in editor the given lines, which were visited while evaluating the components. | ||
| */ | ||
| void highlightVisitedLines(Collection<Integer> lines); | ||
|
|
There was a problem hiding this comment.
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.
|
@PrakarshSrivastav Can you rebase on master and squash your commits? I fear a merge conflict snuck into the DesignEditor class. |
f725515 to
95ec9e9
Compare
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>
95ec9e9 to
1eb82fb
Compare
Good catch, thanks. Moved highlightVisitedLines so it's only declared on the internal DesignPageSite class, not on IDesignPageSite. The interface is now untouched. |
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