Fix for completion of partially typed globals with namespace prefix.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sun, 28 Jul 2013 14:20:34 +0100
changeset 43 d0cec4abccd4
parent 42 48307f46ff8e
child 44 efc9d79a287f
Fix for completion of partially typed globals with namespace prefix.
SmallSenseParser.st
--- a/SmallSenseParser.st	Sun Jul 28 10:22:36 2013 +0100
+++ b/SmallSenseParser.st	Sun Jul 28 14:20:34 2013 +0100
@@ -213,6 +213,29 @@
     "Modified: / 27-11-2011 / 16:11:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SmallSenseParser methodsFor:'private'!
+
+findNameSpaceWith:varName
+    | ns |
+
+    "The super #findNameSpaceWith: checks whether the the gloval named 'varName' exists,
+     if not, returns the current namespace which is then prepended to 'varName'.
+
+     Here we have to deal with uncomplete global names, so trick the caller by returning
+     nil if the partially typed global name starts with current namespace prefix."
+
+    classToCompileFor notNil ifTrue:[
+        ns := classToCompileFor topNameSpace.
+        (varName = ns name) ifTrue:[
+            ^ nil
+        ]
+    ].
+
+    ^ super findNameSpaceWith:varName
+
+    "Created: / 28-07-2013 / 13:49:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !SmallSenseParser methodsFor:'syntax coloring'!
 
 markBracketAt:pos