Skip to content

Commit

Permalink
Merge 26c6c1c
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Jan 31, 2020
2 parents 6812b8d + 26c6c1c commit 390a773
Show file tree
Hide file tree
Showing 19 changed files with 223 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/Spec2-Commands/SpBrowseClassCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Class {
}

{ #category : #default }
SpBrowseClassCommand class >> defaultIconName [
^#smallSystemBrowser
SpBrowseClassCommand class >> defaultDescription [
^ 'Browse the selected class'
]

{ #category : #default }
Expand Down
7 changes: 3 additions & 4 deletions src/Spec2-Commands/SpBrowseClassHierarchyCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseClassHierarchyCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseClassHierarchyCommand class >> defaultDescription [
^ 'Browse the class hierarchy of the selected class'
]

{ #category : #default }
Expand All @@ -20,6 +20,5 @@ SpBrowseClassHierarchyCommand class >> shortName [

{ #category : #executing }
SpBrowseClassHierarchyCommand >> execute [
self flag: 'Wrong: should be either method inheritance tree or class hierarchy...'.
self systemNavigation browseHierarchy: self context
]
28 changes: 28 additions & 0 deletions src/Spec2-Commands/SpBrowseClassReferencesCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"
Browse all references to the class returned by the evaluation of the context.
"
Class {
#name : #SpBrowseClassReferencesCommand,
#superclass : #SpSystemNavigationCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowseClassReferencesCommand class >> defaultDescription [
^ 'Browse all references to the receiver''s class'
]

{ #category : #default }
SpBrowseClassReferencesCommand class >> shortName [

^ 'class references'
]

{ #category : #execution }
SpBrowseClassReferencesCommand >> execute [
| class |
class := self context instanceSide.
class isTrait
ifTrue: [ self systemNavigation browseAllUsersOfTrait: class ]
ifFalse: [ self systemNavigation browseAllCallsOnClass: class ]
]
6 changes: 3 additions & 3 deletions src/Spec2-Commands/SpBrowseClassVarRefsCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseClassVarRefsCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseClassVarRefsCommand class >> defaultDescription [
^ 'Browse the references to class variables'
]

{ #category : #default }
Expand Down
6 changes: 3 additions & 3 deletions src/Spec2-Commands/SpBrowseClassVariablesCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseClassVariablesCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseClassVariablesCommand class >> defaultDescription [
^ 'Browse the class variables'
]

{ #category : #default }
Expand Down
6 changes: 3 additions & 3 deletions src/Spec2-Commands/SpBrowseImplementorsCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseImplementorsCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseImplementorsCommand class >> defaultDescription [
^ 'Browse all implementors of the selected method or message'
]

{ #category : #default }
Expand Down
25 changes: 25 additions & 0 deletions src/Spec2-Commands/SpBrowseInstVarRefsCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"
My context is a class, I browse the inst var refs of that class.
The system navigation is in charge of executing, and will ask the user to select a variable.
"
Class {
#name : #SpBrowseInstVarRefsCommand,
#superclass : #SpSystemNavigationCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowseInstVarRefsCommand class >> defaultDescription [
^ 'Browse the references to instance variables'
]

{ #category : #default }
SpBrowseInstVarRefsCommand class >> shortName [

^ 'instance variables reference'
]

{ #category : #executing }
SpBrowseInstVarRefsCommand >> execute [
self systemNavigation browseInstVarRefs: self context
]
24 changes: 24 additions & 0 deletions src/Spec2-Commands/SpBrowseInstancesCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"
I browse all instances of the class returned by the evaluation of my context
"
Class {
#name : #SpBrowseInstancesCommand,
#superclass : #SpSystemDiscoveryCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowseInstancesCommand class >> defaultDescription [
^ 'Browse all instances of the selected class'
]

{ #category : #accessing }
SpBrowseInstancesCommand class >> shortName [

^ 'all instances'
]

{ #category : #executing }
SpBrowseInstancesCommand >> execute [
self context instanceSide inspectAllInstances
]
26 changes: 26 additions & 0 deletions src/Spec2-Commands/SpBrowseMethodInheritanceCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"
I browse the inheritance of a method - my context must evaluate to a method.
"
Class {
#name : #SpBrowseMethodInheritanceCommand,
#superclass : #SpSystemNavigationCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowseMethodInheritanceCommand class >> defaultDescription [
^ 'Browse the hierarchy implementors of the selected method'
]

{ #category : #default }
SpBrowseMethodInheritanceCommand class >> shortName [

^ 'method inheritance'
]

{ #category : #executing }
SpBrowseMethodInheritanceCommand >> execute [
self systemNavigation
methodHierarchyBrowserForClass: self context methodClass
selector: self context selector
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
I browse all references to the computed context that is transformed to a symbol.
"
Class {
#name : #SpBrowseReferencesCommand,
#name : #SpBrowseMethodReferencesCommand,
#superclass : #SpSystemNavigationCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseReferencesCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseMethodReferencesCommand class >> defaultDescription [
^ 'Browse all references to the selected method or selector'
]

{ #category : #default }
SpBrowseReferencesCommand class >> shortName [
SpBrowseMethodReferencesCommand class >> shortName [

^ 'references'
]

{ #category : #executing }
SpBrowseReferencesCommand >> execute [
SpBrowseMethodReferencesCommand >> execute [
self systemNavigation browseAllReferencesTo: self selector
]
26 changes: 26 additions & 0 deletions src/Spec2-Commands/SpBrowseMethodVersionsCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"
Create and schedule a message set browser on all versions of the method returned by the evaluation of the context.
"
Class {
#name : #SpBrowseMethodVersionsCommand,
#superclass : #SpSystemNavigationCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowseMethodVersionsCommand class >> defaultDescription [
'Browse history of the method'
]

{ #category : #default }
SpBrowseMethodVersionsCommand class >> shortName [

^ 'method versions'
]

{ #category : #executing }
SpBrowseMethodVersionsCommand >> execute [
Smalltalk tools versionBrowser
browseVersionsForClass: self context methodClass
selector: self context selector
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseMethodsContainingStringCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseMethodsContainingStringCommand class >> defaultDescription [
^ 'Browse all methods containing the selected string'
]

{ #category : #default }
Expand Down
24 changes: 24 additions & 0 deletions src/Spec2-Commands/SpBrowsePointersToCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"
I inspect all pointers to the object returned by the evaluation of my context
"
Class {
#name : #SpBrowsePointersToCommand,
#superclass : #SpSystemDiscoveryCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowsePointersToCommand class >> defaultDescription [
^ 'Browse all objects referencing the selected object'
]

{ #category : #accessing }
SpBrowsePointersToCommand class >> shortName [

^ 'pointers to'
]

{ #category : #executing }
SpBrowsePointersToCommand >> execute [
self context pointersTo inspect
]
6 changes: 3 additions & 3 deletions src/Spec2-Commands/SpBrowseSendersCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpBrowseSendersCommand class >> defaultIconName [
^#smallSystemBrowser
{ #category : #default }
SpBrowseSendersCommand class >> defaultDescription [
^ 'Browse all senders of the selected method or message'
]

{ #category : #default }
Expand Down
24 changes: 24 additions & 0 deletions src/Spec2-Commands/SpBrowseSubInstancesCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"
I browse all instances of the class (and all its subclasses) returned by the evaluation of my context
"
Class {
#name : #SpBrowseSubInstancesCommand,
#superclass : #SpSystemDiscoveryCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #default }
SpBrowseSubInstancesCommand class >> defaultDescription [
^ 'Browse all instances of the selected class and all its subclasses'
]

{ #category : #accessing }
SpBrowseSubInstancesCommand class >> shortName [

^ 'all subinstances'
]

{ #category : #executing }
SpBrowseSubInstancesCommand >> execute [
self context instanceSide inspectSubInstances
]
2 changes: 1 addition & 1 deletion src/Spec2-Commands/SpCodeSelectionCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ SpCodeSelectionCommand >> evaluateSelectionAndDo: aBlock [
If no selection is present select the current line."

| selection |
selection := context selectionInterval ifEmpty: [ ^ '' ].
selection := context selectedText ifEmpty: [ ^ '' ].
^ self evaluate: selection andDo: aBlock
]
13 changes: 13 additions & 0 deletions src/Spec2-Commands/SpSystemDiscoveryCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"
My subclasses implement commands related to the live system discovery and exploration.
"
Class {
#name : #SpSystemDiscoveryCommand,
#superclass : #SpSystemNavigationCommand,
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpSystemDiscoveryCommand class >> defaultIconName [
^ #smallObjects
]
5 changes: 5 additions & 0 deletions src/Spec2-Commands/SpSystemNavigationCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Class {
#category : #'Spec2-Commands-Navigation'
}

{ #category : #defaults }
SpSystemNavigationCommand class >> defaultIconName [
^#smallSystemBrowser
]

{ #category : #default }
SpSystemNavigationCommand class >> defaultName [
^'Browse ', self shortName
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpCodePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SpCodePresenter class >> codeNavigationCommandsGroupWith: presenter [
{
SpBrowseImplementorsCommand.
SpBrowseSendersCommand.
SpBrowseReferencesCommand.
SpBrowseMethodReferencesCommand.
SpBrowseMethodsContainingStringCommand.
}
do:[:navCmdClass| group register: (navCmdClass forSpecContext: [presenter selectedText])].
Expand Down

0 comments on commit 390a773

Please sign in to comment.