SmallSense__EditSupport.st
changeset 205 43bee6463c53
parent 186 27c501b1c44c
child 213 360f02a38ae9
--- a/SmallSense__EditSupport.st	Fri May 09 17:29:26 2014 +0100
+++ b/SmallSense__EditSupport.st	Tue May 13 16:34:38 2014 +0100
@@ -4,7 +4,8 @@
 
 Object subclass:#EditSupport
 	instanceVariableNames:'service codeView textView backspaceIsUndo completionController
-		snippets ignoreKeystrokes ignoreKeystrokesPosition'
+		completionEnvironment snippets ignoreKeystrokes
+		ignoreKeystrokesPosition'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Services'
@@ -59,6 +60,14 @@
 
 !EditSupport methodsFor:'accessing-classes'!
 
+completionControllerClass
+    "raise an error: this method should be implemented (TODO)"
+
+    ^ CompletionController
+
+    "Created: / 13-05-2014 / 16:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 completionEngineClass
     "Returns a code completion engine class or nil, of 
      no completion is supported"
@@ -286,15 +295,15 @@
 
 initializeCompletion
     UserPreferences current smallSenseCompletionEnabled ifTrue:[
-        self completionEngineClass  notNil ifTrue:[
-            completionController := CompletionController for: service textView.
+        self completionEngineClass notNil ifTrue:[
+            completionController := self completionControllerClass for: service textView.
             completionController support: self.
             service textView completionSupport: completionController.
         ].
     ].
 
     "Created: / 27-09-2013 / 13:20:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-02-2014 / 09:30:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-05-2014 / 16:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializeForService:aSmallSenseService
@@ -356,28 +365,29 @@
 !EditSupport methodsFor:'private-completion'!
 
 computeCompletion
-    | completionEngineClass codeView result |
+    | completionEngineClass view result |
 
     completionEngineClass := self completionEngineClass.
     completionEngineClass isNil ifTrue: [ ^ nil ].
 
-    codeView := service codeView.
+    view := service codeView.
     UserInformation 
         handle: [:ex | 
-            codeView showInfo: (ex messageText).
+            view showInfo: (ex messageText).
             ex proceed.
         ]
         do: [
             | context |
 
             context := CompletionContext new.
+            context environment: service environment.
             context support: self.
             result := completionEngineClass new complete: context
         ].
     ^ result.
 
     "Created: / 27-09-2013 / 13:21:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-01-2014 / 23:17:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-05-2014 / 12:02:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditSupport methodsFor:'private-scanning'!