#DOCUMENTATION by exept
authorClaus Gittinger <cg@exept.de>
Sun, 13 Oct 2019 23:30:42 +0200
changeset 19212 82eeb0340fac
parent 19211 46183169364d
child 19213 47209b411140
#DOCUMENTATION by exept class: Tools::SearchDialog comment/format in: #updateListOfMatchingSelectorsFor:
Tools__SearchDialog.st
--- a/Tools__SearchDialog.st	Thu Oct 10 12:36:02 2019 +0200
+++ b/Tools__SearchDialog.st	Sun Oct 13 23:30:42 2019 +0200
@@ -372,7 +372,7 @@
     HTMLDocumentView openFullOnHelpFile:'Browser/RBSearchPatterns.html'
 !
 
-updateListOfMatchingSelectorsFor:s
+updateListOfMatchingSelectorsFor:aPartialName
     |p|
 
     (p := matchProcess) notNil ifTrue:[
@@ -382,17 +382,41 @@
 
     matchProcess := 
         [
-            |what matching|
+            |what matching whatWithGLOB matchingWithGLOB|
 
             [
                 searchWhat == #globalName ifFalse:[ 
-                    what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:Smalltalk match:(matchHolder value) ignoreCase:(caseHolder value not)
+                    what := DoWhatIMeanSupport selectorCompletion:aPartialName inEnvironment:Smalltalk match:(matchHolder value) ignoreCase:(caseHolder value not)
                 ] ifTrue:[ 
-                    what := DoWhatIMeanSupport globalNameCompletion:s inEnvironment:Smalltalk match:(matchHolder value).
+                    what := DoWhatIMeanSupport globalNameCompletion:aPartialName inEnvironment:Smalltalk match:(matchHolder value).
                 ].
                 "/ best := what first.
                 matching := what second.
                 self sensor pushAction:[ listHolder contents:matching ].
+
+"/              "/ disabled; not a good idea:
+"/
+"/                "/ if nothing found AND a corresponding match-searhc would find something,
+"/                "/ then ADD a '*' at the end and auto-enable match-search
+"/                (matching isEmptyOrNil 
+"/                  and:[ aPartialName includesMatchCharacters not
+"/                  and:[ matchHolder value not ]]
+"/                ) ifTrue:[
+"/                    searchWhat == #globalName ifFalse:[ 
+"/                        whatWithGLOB := DoWhatIMeanSupport selectorCompletion:'*',aPartialName,'*' inEnvironment:Smalltalk match:true ignoreCase:(caseHolder value not)
+"/                    ] ifTrue:[ 
+"/                        whatWithGLOB := DoWhatIMeanSupport globalNameCompletion:'*',aPartialName,'*' inEnvironment:Smalltalk match:true.
+"/                    ].
+"/                    matchingWithGLOB := whatWithGLOB second.
+"/                    matchingWithGLOB notEmptyOrNil ifTrue:[
+"/                        self sensor pushAction:[ 
+"/                            inputField contents:('*',aPartialName,'*').
+"/                            selectorHolder value:('*',aPartialName,'*').
+"/                            matchHolder value:true.
+"/                            listHolder contents:matchingWithGLOB 
+"/                        ].
+"/                    ].
+"/                ].
             ] ensure:[
                 matchProcess := nil.
             ].