-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
ClyTextEditor.extension.st
89 lines (69 loc) · 2.87 KB
/
ClyTextEditor.extension.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Extension { #name : #ClyTextEditor }
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> classCommentsContainingIt [
"Open a browser class comments which contain the current selection somewhere in them."
| query |
self lineSelectAndEmptyCheck: [^ self].
query := ClyClassCommentsQuery withString: self selection string.
self browser spawnQueryBrowserOn: query
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> classNamesContainingIt [
"Open a browser on classes whose names contain the selected string"
| query |
self lineSelectAndEmptyCheck: [^self].
query := ClyAllClassesQuery new filteredBy: (ClyItemNameFilter substringPattern: self selection string).
self browser spawnQueryBrowserOn: query
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> implementorsOf: selectedSelector [
self browser browseImplementorsOf: selectedSelector
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> implementorsOfIt [
| selector |
"self lineSelectAndEmptyCheck: [^ self]."
(selector := self selectedSelector) == nil ifTrue: [^ textArea flash].
selector isCharacter ifTrue: [ ^ textArea flash ].
self browser browseImplementorsOf: selector
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> methodSourceContainingIt [
"Open a browser class comments which contain the current selection somewhere in them."
| query pattern |
self lineSelectAndEmptyCheck: [^ self].
pattern := self selection string.
query := (ClyMethodSourcesQuery withString: pattern), (ClyClassCommentsQuery withString: pattern).
self browser spawnQueryBrowserOn: query
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> referencesTo: aVariableName [
"Open a references browser on the given symbol"
| class var |
" ugly dispatch, but current Browser protocol names aren't really cool "
class := self modelCurrentSelectedClass.
class isBehavior ifTrue: [
class slotNamed: aVariableName ifFound: [:slot |
var := ClyInstanceVariable on: slot visibleFrom: class.
^self browser spawnQueryBrowserOn: (ClyVariableReferencesQuery of: var)]].
self browser browseReferencesTo: aVariableName asSymbol from: class
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> referencesToIt [
| selector |
"self lineSelectAndEmptyCheck: [^ self]."
(selector := self selectedSelector) == nil ifTrue: [^ textArea flash].
self referencesTo: selector
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> sendersOf: selectedSelector [
selectedSelector isCharacter ifTrue: [ ^ self ].
self browser browseReferencesTo: selectedSelector
]
{ #category : #'*Calypso-SystemTools-QueryBrowser' }
ClyTextEditor >> sendersOfIt [
| selector |
"self lineSelectAndEmptyCheck: [^ self]."
(selector := self selectedSelector) == nil ifTrue: [^ textArea flash].
self sendersOf: selector
]