#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Fri, 11 May 2018 13:09:27 +0200
changeset 6319 beb48f66edf1
parent 6318 8cf42e7015f5
child 6320 d52325b32f05
#FEATURE by cg class: Workspace added: #browseMethodsContainingInName #browseMethodsContainingInName: #browseMethodsContainingItInName changed: #editMenu
Workspace.st
--- a/Workspace.st	Thu May 10 21:06:39 2018 +0200
+++ b/Workspace.st	Fri May 11 13:09:27 2018 +0200
@@ -1848,6 +1848,29 @@
     "Modified: / 26.9.2001 / 17:38:06 / cg"
 !
 
+browseMethodsContainingInName
+    "ask for a piece of text and 
+     open a browser on all methods where that piece is contained in the selector"
+
+    |pieceOfText|
+
+    pieceOfText := Dialog request:'Browse methods containing in name:'.
+    pieceOfText isEmptyOrNil ifTrue:[^ self].
+
+    self browseMethodsContainingInName:pieceOfText
+!
+
+browseMethodsContainingInName:pieceOfText
+    "open a browser on all methods where that piece is contained in the selector"
+
+    (SystemBrowser default
+        browseMethodsForWhich:[:m | 
+            (m selector ? '') includesString:pieceOfText caseSensitive:false 
+        ]
+        title:('Methods with "%1" in name' bindWith:pieceOfText)
+    ) autoSearch:pieceOfText ignoreCase:true 
+!
+
 browseMethodsContainingInSource
     "ask for a piece of text and 
      open a browser on all methods where that piece is contained in the source"
@@ -1871,6 +1894,20 @@
     ) autoSearch:pieceOfText ignoreCase:true 
 !
 
+browseMethodsContainingItInName
+    "open a browser on all methods where the selected text is part of the selector"
+
+    |selectedText|
+
+    selectedText := self selectedTextOrSyntaxElement.
+    selectedText notEmptyOrNil ifTrue:[
+        selectedText := selectedText withoutSeparators.
+        selectedText notEmpty ifTrue:[
+            self browseMethodsContainingInName:selectedText.
+        ]
+    ].
+!
+
 browseMethodsContainingItInSource
     "open a browser on all methods where the selected text is contained in the source"
 
@@ -2068,6 +2105,7 @@
                     ('Implementors of It'               browseImplementorsOfIt  ImplementorsOfIt    )
                     ('References to It'                 browseReferencesToIt                        )
                     ('Classes Containing It in Name'    browseClassesContainingItInName           )
+                    ('Methods Containing It in Name'    browseMethodsContainingItInName         )
                     ('Methods Containing It in Source'  browseMethodsContainingItInSource         )
                     ('-'                                                                )
                     ('TimeIt'               timeIt                                      )
@@ -2083,7 +2121,8 @@
                     ('Senders of...'                    browseSendersOf                           )
                     ('Implementors of...'               browseImplementorsOf   ImplementorsOf       )
                     ('References to...'                 browseReferencesTo                          )
-                    ('Classes Containing in Name...'    browseClassesContainingInName           )
+                    ('Classes Containing in Name...'    browseClassesContainingInName   )
+                    ('Methods Containing in Name...'    browseMethodsContainingInName   )
                     ('Methods Containing in Source...'  browseMethodsWithString         )
                     ('-'                                                                )
                     ('TimeIt'               timeIt                                      )