Skip to content

Commit

Permalink
Restructuring contextual menu splitting contents from the Debugging m…
Browse files Browse the repository at this point in the history
…enu in two: Breakpoints and Advanced Debugging. Placing 'counter' command in the root menu.
  • Loading branch information
carolahp committed Jan 25, 2022
1 parent a1b3b78 commit 2ab2644
Show file tree
Hide file tree
Showing 21 changed files with 164 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ClyAddConditionalBreakpointCommand >> conditionBlockProducerMethodAST: condition

{ #category : #accessing }
ClyAddConditionalBreakpointCommand >> defaultMenuItemName [
^'Break with condition on ', sourceNode displaySourceCode, ' ...'
^'Break on ', sourceNode displaySourceCode, ' when ...'
]

{ #category : #'block generation' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ ClyAddExecutionCounterCommand class >> contextMenuOrder [
^2
]

{ #category : #activation }
ClyAddExecutionCounterCommand class >> sourceCodeMenuActivation [
<classAnnotation>

^CmdContextMenuActivation byRootGroupItemOrder: -0.5 for: ClySourceCodeContext
]

{ #category : #accessing }
ClyAddExecutionCounterCommand >> defaultMenuIconName [
^#classIcon
Expand All @@ -29,8 +36,18 @@ ClyAddExecutionCounterCommand >> defaultMenuItemName [
^'Add Counter'
]

{ #category : #accessing }
ClyAddExecutionCounterCommand >> description [
^ self defaultMenuItemName, ' to ', sourceNode displaySourceCode
]

{ #category : #execution }
ClyAddExecutionCounterCommand >> execute [

ExecutionCounter installOn: sourceNode
]

{ #category : #execution }
ClyAddExecutionCounterCommand >> information [
self defaultMenuItemName, ' to ', sourceNode displaySourceCode
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ ClyAddOnceBreakpointCommand >> applyBreakpointCondition: aBreakpoint [

{ #category : #accessing }
ClyAddOnceBreakpointCommand >> defaultMenuItemName [
^'Break once on ', sourceNode displaySourceCode
^'Break on ', sourceNode displaySourceCode, ' once'
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ ClyAddStaticBreakpointCommand >> applyBreakpointCondition: aBreakpoint [

{ #category : #accessing }
ClyAddStaticBreakpointCommand >> defaultMenuItemName [
^'Break on ', sourceNode displaySourceCode
^'Break on ', sourceNode displaySourceCode
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ I am a command to install watchpoint into the given method or source node
"
Class {
#name : #ClyAddWatchCommand,
#superclass : #ClyDebuggingCommand,
#superclass : #ClyAdvancedDebuggingCommand,
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Watchpoints'
}

Expand All @@ -26,7 +26,7 @@ ClyAddWatchCommand >> defaultMenuIconName [

{ #category : #accessing }
ClyAddWatchCommand >> defaultMenuItemName [
^'Add Watchpoint'
^' Add Watchpoint to ', sourceNode displaySourceCode
]

{ #category : #execution }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"
I am a base class for commands which add/remove metalinks, watchpoints, and counters into given method or source node
"
Class {
#name : #ClyAdvancedDebuggingCommand,
#superclass : #ClyDebuggingCommand,
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Commands'
}

{ #category : #testing }
ClyAdvancedDebuggingCommand class >> isAbstract [
^self == ClyAdvancedDebuggingCommand
]

{ #category : #activation }
ClyAdvancedDebuggingCommand class >> methodContextMenuActivation [

<classAnnotation>
^ CmdContextMenuActivation
byItemOf: ClyAdvancedDebuggingMenuGroup
order: self contextMenuOrder
for: ClyMethod asCalypsoItemContext
]

{ #category : #activation }
ClyAdvancedDebuggingCommand class >> methodEditorLeftBarMenuActivation [

<classAnnotation>
^ CmdTextLeftBarMenuActivation
byItemOf: ClyAdvancedDebuggingMenuGroup
order: self contextMenuOrder
for: ClyMethodSourceCodeContext
]

{ #category : #activation }
ClyAdvancedDebuggingCommand class >> sourceCodeMenuActivation [

<classAnnotation>
^ SycAdvancedDebuggingMenuActivation
byItemOf: ClyAdvancedDebuggingMenuGroup
order: self contextMenuOrder
for: ClyMethodSourceCodeContext
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"
I am menu group to arrange together metalink and watchpoint commands
"
Class {
#name : #ClyAdvancedDebuggingMenuGroup,
#superclass : #CmdMenuGroup,
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Commands'
}

{ #category : #testing }
ClyAdvancedDebuggingMenuGroup >> isInlined [
^true
]

{ #category : #accessing }
ClyAdvancedDebuggingMenuGroup >> order [
^1.8
]
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ClyBreakOnVarAccessCommand class >> canBeExecutedInContext: aSourceCodeContext [
{ #category : #accessing }
ClyBreakOnVarAccessCommand >> defaultMenuItemName [
sourceNode isVariable ifFalse:[^'(unvalid node)'].
^'Break on accesses to ', sourceNode name
^'Break on accesses to ', sourceNode name
]

{ #category : #execution }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {
{ #category : #accessing }
ClyBreakOnVarReadsCommand >> defaultMenuItemName [
sourceNode isVariable ifFalse:[^'(unvalid node)'].
^'Break on reads to ', sourceNode name
^'Break on reads to ', sourceNode name
]

{ #category : #execution }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ClyBreakOnVarWritesCommand class >> canBeExecutedInContext: aSourceCodeContext [
{ #category : #accessing }
ClyBreakOnVarWritesCommand >> defaultMenuItemName [
sourceNode isVariable ifFalse:[^'(unvalid node)'].
^'Break on writes to ', sourceNode name
^'Break on writes to ', sourceNode name
]

{ #category : #execution }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"
I am a base class for commands which add/remove metalinks into given method or source node
I am a base class for commands which add/remove watchpoints, metalinks, breakpoints, and counters into given method or source node
"
Class {
#name : #ClyDebuggingCommand,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"
I am menu group to arrange together all metalink related commands (breakpoints, counters, watchpoints)
I am menu group to arrange together breakpoint commands
"
Class {
#name : #ClyDebuggingMenuGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ I open a small browser to choose which metalink to install among existing metali
"
Class {
#name : #ClyInstallMetaLinkCommand,
#superclass : #ClyDebuggingCommand,
#superclass : #ClyAdvancedDebuggingCommand,
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Metalinks'
}

Expand All @@ -20,7 +20,7 @@ ClyInstallMetaLinkCommand >> defaultMenuIconName [

{ #category : #accessing }
ClyInstallMetaLinkCommand >> defaultMenuItemName [
^'Install MetaLink...'
^' Install MetaLink to ', sourceNode displaySourceCode , ' ...'
]

{ #category : #execution }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ ClyRemoveExecutionCounterCommand class >> contextMenuOrder [
^2
]

{ #category : #activation }
ClyRemoveExecutionCounterCommand class >> sourceCodeMenuActivation [
<classAnnotation>

^CmdContextMenuActivation byRootGroupItemOrder: -0.5 for: ClySourceCodeContext
]

{ #category : #accessing }
ClyRemoveExecutionCounterCommand >> createTableCellButtonWith: anIcon using: aCommandActivator [
| button |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ ClyRemoveWatchCommand class >> contextMenuOrder [
^3
]

{ #category : #activation }
ClyRemoveWatchCommand class >> sourceCodeMenuActivation [
<classAnnotation>

^SycAdvancedDebuggingMenuActivation
byItemOf: ClyAdvancedDebuggingMenuGroup order: self contextMenuOrder for: ClyMethodSourceCodeContext
]

{ #category : #execution }
ClyRemoveWatchCommand >> debuggingToolClass [
^Watch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ ClyUninstallMetaLinkCommand class >> contextMenuOrder [
^101
]

{ #category : #activation }
ClyUninstallMetaLinkCommand class >> sourceCodeMenuActivation [
<classAnnotation>

^SycAdvancedDebuggingMenuActivation
byItemOf: ClyAdvancedDebuggingMenuGroup order: self contextMenuOrder for: ClyMethodSourceCodeContext
]

{ #category : #accessing }
ClyUninstallMetaLinkCommand >> defaultMenuIconName [
^#smallObjects
]

{ #category : #accessing }
ClyUninstallMetaLinkCommand >> defaultMenuItemName [
^'Uninstall MetaLink...'
^ 'Uninstall MetaLink from ' , sourceNode displaySourceCode, ' ...'
]

{ #category : #execution }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Extension { #name : #SycOpenAdvancedDebuggingMenuCommand }

{ #category : #'*Calypso-SystemTools-Core' }
SycOpenAdvancedDebuggingMenuCommand class >> methodEditorShortcutActivation [
<classAnnotation>

^CmdShortcutActivation by: $h meta shift for: ClySourceCodeContext
]

{ #category : #'*Calypso-SystemTools-Core' }
SycOpenAdvancedDebuggingMenuCommand class >> sourceCodeMenuActivation [
<classAnnotation>

^CmdContextMenuActivation byRootGroupItemOrder: 8 for: ClySourceCodeContext
]
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ RBBlockNode >> displaySourceCode [
nextPutAll: arg name asString;
nextPutAll: ' ' ] ]).
code := code , '| ' ].
code := code , '... ]'.
code := code , ' ]'.
^ code
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"
I represent an activation of advanced debugging commands using a separate debugging menu.
"
Class {
#name : #SycAdvancedDebuggingMenuActivation,
#superclass : #CmdMenuCommandActivationStrategy,
#category : #'SystemCommands-SourceCodeCommands'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"
I am a command to open the advanced debugging menu after a right click on the source code.
I show in the menu all commands annotated by SycAdvancedDebuggingMenuActivation
"
Class {
#name : #SycOpenAdvancedDebuggingMenuCommand,
#superclass : #SycOpenSourceCodeMenuCommand,
#category : #'SystemCommands-SourceCodeCommands'
}

{ #category : #execution }
SycOpenAdvancedDebuggingMenuCommand >> activationStrategy [
^SycAdvancedDebuggingMenuActivation
]

{ #category : #accessing }
SycOpenAdvancedDebuggingMenuCommand >> defaultMenuIconName [
^ #smallDebug
]

{ #category : #accessing }
SycOpenAdvancedDebuggingMenuCommand >> defaultMenuItemName [

^ 'Advanced Debugging'
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"
I am a command to open the debugging menu after a right click on the source code.
I am a command to open the breakpoint menu after a right click on the source code.
I show in the menu all commands annotated by SycDebuggingMenuActivation
"
Class {
Expand Down

0 comments on commit 2ab2644

Please sign in to comment.