-
Notifications
You must be signed in to change notification settings - Fork 52
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
New debugger extension model to display dynamic extensions #739
Merged
StevenCostiou
merged 29 commits into
pharo-spec:Pharo13
from
adri09070:new-debugger-extension-model
May 3, 2024
Merged
New debugger extension model to display dynamic extensions #739
StevenCostiou
merged 29 commits into
pharo-spec:Pharo13
from
adri09070:new-debugger-extension-model
May 3, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nstances can override if they should be shown in a debugger depending of the selected context
…is no extension registered then there is no extension pane.
…for the MNU exception
…ated in the debugger and should not be manually configureable.
…hould be displayed (by default: in any context)
… displayed at the moment, taking into account the current context predicate
…n is (de)activated (via StDebuggerExtensionActivationToggle) + doing nothing if the context predicate does not allow to display the extension anyway
…king into account the new context predicate to update debugger extensions after each step
…tension instead of a presenter owned by a debugger extension
… check that it is displayed/hidden when it should be
The failing test seem unrelated? |
The test fails in a fresh Pharo 13 image so it is unrelated |
StevenCostiou
requested changes
May 3, 2024
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.
Good for merge.
Just one minor change that would be great ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New Dynamic Debugger Extension System
This PR introduces a new debugger extension model to display extensions dynamically. These "dynamic" extensions are displayed only if they are activated (that goes without saying) and only if we are in a specific context.
Description of the New Debugger Extension System
The debugger extension determines if it can be displayed in a debugger via the method:
This method uses the debugger's context predicate to determine if the extension should be displayed or not. We could discuss: Should the method use a debugger as parameter instead of a context predicate? The extension would have more parameters to decide if it should display itself or not, but is it necessary ?
This induces two big changes in the update of extensions:
StDebuggerExtensionToggleAnnouncement
to the debugger, the debugger now should consider the current context predicate, because if it is refused by the toggled extension, the extension toggle should be ignored: it has no effectThis can be summed up by the two following boolean tables.
Boolean table describing the action to take according to the current debugger context predicate when a debugger extension has been (de)activated, resulting in a
StDebuggerExtensionToggle
announcement:showInDebugger
state changefalse
false
->true
true
true
->false
true
Boolean table describing the action to take according to the current
showInDebugger
state of an extension, when an action has been performed in the debugger, resulting in a potential change of status in the debugger context predicate:showInDebugger
statefalse
true
false
->false
true
true
->true
true
false
->true
true
true
->false
Introducing a New Dynamic Debugger Extension: Creating Method Extension
This debugger extension is displayed by default in the system settings:
This extension only appears if a DNU is raised and opens a debugger:
It has the exact same function as the "Create" button in the debugger toolbar, except that this extension allows the user to create the missing method while choosing the class or trait in the class hierarchy in which it should be installed, as well as the protocol under which it should be installed.
Whereas the "Create" button creates the missing class in the class of the receiver of the missing message, under a protocol chosen by the system.
With this extension, once you create the method by clicking the "Add method" button, the method has been created, the extension is not displayed anymore, and you can then proceed the execution (or debug it, of course):