Allow highlighting instructions in ClassFileEditor#2708
Allow highlighting instructions in ClassFileEditor#2708trancexpress merged 1 commit intoeclipse-jdt:masterfrom
Conversation
|
Screenshot? |
I plan to add one but I currently have issues with my development setup after rebasing it. |
Added. |
8a8c2b6 to
a9a1346
Compare
a9a1346 to
3916a18
Compare
3916a18 to
3a392f4
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
91c83df to
fe024b9
Compare
|
(push is just rebasing) @iloveeclipse Would you like to review this? |
fe024b9 to
fa5d0af
Compare
|
Alternatively, would you be interested in reviewing this/share your thoughts? @jjohnstn |
fa5d0af to
c3aabfc
Compare
|
Sorry to ping random committers but I didn't get a review until now and I think something along the lines of this could be useful for anyone wanting to view what is going on in some library where the source could not be resolved. |
|
I'll try to take a look on Sunday, I hope that isn't too late? |
9d1384a to
6fb6fa3
Compare
322cef3 to
adfe332
Compare
adfe332 to
b9a9b57
Compare
|
Just two small things from me, I'll let Copilot also do a review here. |
There was a problem hiding this comment.
Pull request overview
This PR adds support in the JDT ClassFileEditor (no-source/disassembly view) to programmatically highlight a specific bytecode instruction by method + signature + code index, enabling external tooling (e.g., debugging) to show the current instruction pointer when source isn’t available.
Changes:
- Added instruction highlighting/unhighlighting API to
ClassFileEditor, including lightweight parsing/caching of disassembly text to locate instructions. - Introduced a new internal preference key constant intended to source the instruction-pointer highlight color.
- Added JUnit tests for highlighting behavior and wired them into the automated test suite.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java |
Adds highlight/unhighlight logic, disassembly parsing + caching, and preference-based color initialization. |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/IUIConstants.java |
Adds a constant for the instruction-pointer color preference key. |
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/editor/ClassFileEditorTests.java |
New tests validating instruction highlighting behavior in the disassembly widget. |
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/AutomatedSuite.java |
Includes the new test class in the automated suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b9a9b57 to
960b2fd
Compare
960b2fd to
0152036
Compare
What it does
This PR allows selecting/highlighting instructions in the class file editor using:
This is used to view the current instruction pointer when debugging class files without attached sources (the debugging part is implemented in eclipse-jdt/eclipse.jdt.debug#831.
video:
Screencast_20260402_144851.webm
Ideally, this would be done without needing to "parse"/search through the disassembly text but I don't think there is a good way to do that
How to test
See eclipse-jdt/eclipse.jdt.debug#831
Author checklist