-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement grouping of the stack frames #583
base: master
Are you sure you want to change the base?
Conversation
c4172ac
to
a1db2c3
Compare
@jukzi : Could you please have a look on this when you have time and check what needs to be done to be merged? |
unfortunately i am very limited in time. @SougandhS can you test/review this PR? |
will check this |
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
Show resolved
Hide resolved
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
Show resolved
Hide resolved
...clipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StackFramePresentationProvider.java
Show resolved
Hide resolved
...clipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StackFramePresentationProvider.java
Outdated
Show resolved
Hide resolved
...clipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StackFramePresentationProvider.java
Outdated
Show resolved
Hide resolved
...se.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java
Outdated
Show resolved
Hide resolved
...se.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java
Show resolved
Hide resolved
...se.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java
Show resolved
Hide resolved
@@ -40,7 +41,7 @@ public class MonitorsAdapterFactory implements IAdapterFactory { | |||
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { | |||
|
|||
if (IElementContentProvider.class.equals(adapterType)) { | |||
if (adaptableObject instanceof IJavaThread) { | |||
if (adaptableObject instanceof IJavaThread || adaptableObject instanceof GroupedStackFrame) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional space was added here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry. Files with mixed tabs and spaces are very confusing and it is easy to mess up them even more!
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/GroupedStackFrame.java
Show resolved
Hide resolved
store.setDefault(IJDIPreferencesConstants.PREF_ACTIVE_CUSTOM_FRAME_FILTER_LIST, ""); //$NON-NLS-1$ | ||
store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_CUSTOM_FRAME_FILTER_LIST, ""); //$NON-NLS-1$ | ||
store.setDefault(IJDIPreferencesConstants.PREF_COLLAPSE_STACK_FRAMES, true); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try using org.eclipse.jface.util.Util.ZERO_LENGTH_STRING
for empty string declarations, so you can avoid NON-NLS
comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't know about this class!
Hi @gzsombor , could pls take the latest pull and squash everything to one commit only and push, so we can get rid of the build errors |
7d7e88a
to
3eed15a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@gzsombor can you please update the pr description to include before/after screenshot to fatsly see what to expect? |
} catch (DebugException e) { | ||
JDIDebugUIPlugin.log(e); | ||
} | ||
frame.setCategory(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does a getter getCategory set something? that is unexpected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add more description to the javadoc, but essentially, we don't want to always re-evaluate the rules, so we store the calculated category in that frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if setCategory is only used as cache please move the caching implementation into the getter to avoid the setter. However it feels like the implementation is wrong in means of it will not update the cached value if the options change.
...clipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StackFramePresentationProvider.java
Outdated
Show resolved
Hide resolved
* @param category | ||
* the new category of the stack frame. | ||
*/ | ||
public void setCategory(Category category); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it somehow avoided to have such setter? it is not obvious to me if such setter should fireChangeEvent(DebugEvent.STATE);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow we need to store the information how that frame was categorized - even if the process is not slow, it needs to lookup the source, and check which classpath entry contains that, etc.
In theory, we could have a map from IJavaStackFrame -> Category in some singleton, but it's unclear how we can detect, if that stack frame was not accessible anymore, so maybe a WeakHashMap could work, but it felt too complicated and error prone.
This setter is only called once - when we first want to display the frame, so firing a change event should not needed - at least it seems to work fine without it.
...clipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StackFramePresentationProvider.java
Show resolved
Hide resolved
The rules how the frames are categorized are not editable as of now, just a single action is visible to switch on-off the behaviour, with enough javadocs
3eed15a
to
2fcfe4c
Compare
The rules how the frames are categorized are not editable as of now, just a single action is visible to switch on-off the behaviour
What it does
Groups - and hides - the supposedly not relevant stack frames from the debug views.
After
Expanding the group:
How to test
Start debugging, and notice that instead of having hundreds of frames only a couple are visible
Author checklist