Completion support refactored to make it more pluggable/extendable.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 02 Oct 2013 13:37:01 +0100
changeset 117 441529422c2f
parent 116 8374ecd10237
child 118 88e6fd734a11
Completion support refactored to make it more pluggable/extendable.
Make.proto
Make.spec
SmallSense__CompletionController.st
SmallSense__CompletionEngine.st
SmallSense__EditSupport.st
SmallSense__SmalltalkCompletion.st
SmallSense__SmalltalkCompletionEngine.st
SmallSense__SmalltalkEditSupport.st
abbrev.stc
bc.mak
jv_smallsense.st
libInit.cc
smallsense.rc
--- a/Make.proto	Wed Oct 02 12:29:25 2013 +0100
+++ b/Make.proto	Wed Oct 02 13:37:01 2013 +0100
@@ -34,7 +34,7 @@
 # add the path(es) here:,
 # ********** OPTIONAL: MODIFY the next lines ***
 # LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libhtml -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg2
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libhtml -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg2
 
 
 # if you need any additional defines for embedded C code,
@@ -137,7 +137,6 @@
 	cd $(TOP)/libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/goodies/refactoryBrowser/browser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
-	cd $(TOP)/goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/goodies/refactoryBrowser/lint && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/libhtml && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
@@ -165,12 +164,14 @@
 $(OUTDIR)SmallSense__CodeHighlightingService.$(O) SmallSense__CodeHighlightingService.$(H): SmallSense__CodeHighlightingService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CodeNavigationService.$(O) SmallSense__CodeNavigationService.$(H): SmallSense__CodeNavigationService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionContext.$(O) SmallSense__CompletionContext.$(H): SmallSense__CompletionContext.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__CompletionController.$(O) SmallSense__CompletionController.$(H): SmallSense__CompletionController.st $(INCLUDE_TOP)/stx/libwidg/EditTextViewCompletionSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__CompletionEngine.$(O) SmallSense__CompletionEngine.$(H): SmallSense__CompletionEngine.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionResult.$(O) SmallSense__CompletionResult.$(H): SmallSense__CompletionResult.st $(INCLUDE_TOP)/stx/libbasic/SortedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionView.$(O) SmallSense__CompletionView.$(H): SmallSense__CompletionView.st $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionWindow.$(O) SmallSense__CompletionWindow.$(H): SmallSense__CompletionWindow.st $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CriticsWindow.$(O) SmallSense__CriticsWindow.$(H): SmallSense__CriticsWindow.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__EditService.$(O) SmallSense__EditService.$(H): SmallSense__EditService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__EditSupport.$(O) SmallSense__EditSupport.$(H): SmallSense__EditSupport.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextViewCompletionSupport.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__EditSupport.$(O) SmallSense__EditSupport.$(H): SmallSense__EditSupport.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__Info.$(O) SmallSense__Info.$(H): SmallSense__Info.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__Manager.$(O) SmallSense__Manager.$(H): SmallSense__Manager.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__PO.$(O) SmallSense__PO.$(H): SmallSense__PO.st $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -180,7 +181,6 @@
 $(OUTDIR)SmallSense__SelectorNode.$(O) SmallSense__SelectorNode.$(H): SmallSense__SelectorNode.st $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SettingsAppl.$(O) SmallSense__SettingsAppl.$(H): SmallSense__SettingsAppl.st $(INCLUDE_TOP)/stx/libtool/AbstractSettingsApplication.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkChecker.$(O) SmallSense__SmalltalkChecker.$(H): SmallSense__SmalltalkChecker.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/SmalllintChecker.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__SmalltalkCompletion.$(O) SmallSense__SmalltalkCompletion.$(H): SmallSense__SmalltalkCompletion.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkLintAnnotation.$(O) SmallSense__SmalltalkLintAnnotation.$(H): SmallSense__SmalltalkLintAnnotation.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkLintHighlighter.$(O) SmallSense__SmalltalkLintHighlighter.$(H): SmallSense__SmalltalkLintHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkLintService.$(O) SmallSense__SmalltalkLintService.$(H): SmallSense__SmalltalkLintService.st $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -200,6 +200,7 @@
 $(OUTDIR)SmallSense__JavaEditSupport.$(O) SmallSense__JavaEditSupport.$(H): SmallSense__JavaEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodInfo.$(O) SmallSense__MethodInfo.$(H): SmallSense__MethodInfo.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Info.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodPO.$(O) SmallSense__MethodPO.$(H): SmallSense__MethodPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkCompletionEngine.$(O) SmallSense__SmalltalkCompletionEngine.$(H): SmallSense__SmalltalkCompletionEngine.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkEditSupport.$(O) SmallSense__SmalltalkEditSupport.$(H): SmallSense__SmalltalkEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkInferencer.$(O) SmallSense__SmalltalkInferencer.$(H): SmallSense__SmalltalkInferencer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__SmalltalkParseNodeVisitor.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkParseNodeFinder.$(O) SmallSense__SmalltalkParseNodeFinder.$(H): SmallSense__SmalltalkParseNodeFinder.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__SmalltalkParseNodeVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/Make.spec	Wed Oct 02 12:29:25 2013 +0100
+++ b/Make.spec	Wed Oct 02 13:37:01 2013 +0100
@@ -53,6 +53,8 @@
 	SmallSense::CodeHighlightingService \
 	SmallSense::CodeNavigationService \
 	SmallSense::CompletionContext \
+	SmallSense::CompletionController \
+	SmallSense::CompletionEngine \
 	SmallSense::CompletionResult \
 	SmallSense::CompletionView \
 	SmallSense::CompletionWindow \
@@ -68,7 +70,6 @@
 	SmallSense::SelectorNode \
 	SmallSense::SettingsAppl \
 	SmallSense::SmalltalkChecker \
-	SmallSense::SmalltalkCompletion \
 	SmallSense::SmalltalkLintAnnotation \
 	SmallSense::SmalltalkLintHighlighter \
 	SmallSense::SmalltalkLintService \
@@ -88,6 +89,7 @@
 	SmallSense::JavaEditSupport \
 	SmallSense::MethodInfo \
 	SmallSense::MethodPO \
+	SmallSense::SmalltalkCompletionEngine \
 	SmallSense::SmalltalkEditSupport \
 	SmallSense::SmalltalkInferencer \
 	SmallSense::SmalltalkParseNodeFinder \
@@ -103,6 +105,8 @@
     $(OUTDIR_SLASH)SmallSense__CodeHighlightingService.$(O) \
     $(OUTDIR_SLASH)SmallSense__CodeNavigationService.$(O) \
     $(OUTDIR_SLASH)SmallSense__CompletionContext.$(O) \
+    $(OUTDIR_SLASH)SmallSense__CompletionController.$(O) \
+    $(OUTDIR_SLASH)SmallSense__CompletionEngine.$(O) \
     $(OUTDIR_SLASH)SmallSense__CompletionResult.$(O) \
     $(OUTDIR_SLASH)SmallSense__CompletionView.$(O) \
     $(OUTDIR_SLASH)SmallSense__CompletionWindow.$(O) \
@@ -118,7 +122,6 @@
     $(OUTDIR_SLASH)SmallSense__SelectorNode.$(O) \
     $(OUTDIR_SLASH)SmallSense__SettingsAppl.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkChecker.$(O) \
-    $(OUTDIR_SLASH)SmallSense__SmalltalkCompletion.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkLintAnnotation.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkLintHighlighter.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkLintService.$(O) \
@@ -138,6 +141,7 @@
     $(OUTDIR_SLASH)SmallSense__JavaEditSupport.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodInfo.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodPO.$(O) \
+    $(OUTDIR_SLASH)SmallSense__SmalltalkCompletionEngine.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkEditSupport.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkInferencer.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkParseNodeFinder.$(O) \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__CompletionController.st	Wed Oct 02 13:37:01 2013 +0100
@@ -0,0 +1,204 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+EditTextViewCompletionSupport subclass:#CompletionController
+	instanceVariableNames:'support'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Core'
+!
+
+!CompletionController methodsFor:'accessing'!
+
+support
+    ^ support
+!
+
+support:anEditSupport
+    support := anEditSupport.
+! !
+
+!CompletionController methodsFor:'events'!
+
+handleKeyPress:key x:x y:y
+
+    key == #Control_L ifTrue:[
+        completionView notNil ifTrue:[
+            ^ false.
+        ].
+    ].
+
+    key == #CodeCompletion  ifTrue: [
+        autoSelect := true.    
+        self startCompletionProcess.
+        ^ true
+    ].
+
+    (key == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
+        | c |
+
+        c := editView characterBeforeCursor.
+        (c notNil and:[c isAlphaNumeric]) ifTrue:[
+             ^ false
+        ].
+    ].     
+
+
+    completionView notNil ifTrue:[
+        (key == #Return and:[completionView hasSelection]) ifTrue:[
+            self complete.
+            ^ true.
+        ].
+        key isCharacter ifTrue:[
+            self updateSelection.
+        ].
+    ].
+    ^ super handleKeyPress:key x:x y:y
+
+    "Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-09-2013 / 15:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+postKeyPress:key
+    UserPreferences current immediateCodeCompletion ifFalse:[
+        "/ only update, if already open
+        completionView isNil ifTrue:[^ self].
+    ].
+
+    (key == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
+        | c |
+
+        c := editView characterBeforeCursor.
+        (c notNil and:[c isLetterOrDigit]) ifTrue:[
+            autoSelect := false.
+            self updateCompletionList.
+        ] ifFalse:[
+             self closeCompletionView.
+        ].
+        ^ self
+    ].
+
+    key isCharacter ifTrue:[
+        key isLetterOrDigit not ifTrue:[
+            self closeCompletionView
+        ] ifFalse:[
+            autoSelect := false.
+            self updateCompletionList.
+        ].
+        ^ self
+    ].
+
+    "Created: / 28-09-2013 / 00:21:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-09-2013 / 14:55:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionController methodsFor:'private'!
+
+complete
+    support insertCompletion: completionView selection.
+    self closeCompletionView.
+
+    "Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateCompletionList
+    "called for keypress events"
+
+    completionView isNil ifTrue:[
+        super updateCompletionList
+    ] ifFalse:[
+         self updateSelection.
+    ].
+
+    "Created: / 27-09-2013 / 15:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 28-09-2013 / 00:15:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateSelection
+
+    | matches word |
+
+    word := support wordBeforeCursor.
+    matches := completionView list select:[:po | po stringToComplete startsWith: word ].
+    matches notEmptyOrNil ifTrue:[
+        completionView selection: (matches inject: matches anElement into:[:shortest :each |
+            each stringToComplete size < shortest stringToComplete size 
+                ifTrue:[each]
+                ifFalse:[shortest]
+        ]).
+    ] ifFalse:[
+        completionView selection: nil.
+    ]
+
+    "Created: / 27-09-2013 / 16:16:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionController methodsFor:'private-API'!
+
+computeCompletions
+    "Actually compute the completions and update the completion view."  
+
+    | completions |
+
+    "/ Wait a while to give user chance finish typing.
+    "/ This also reduces CPU consumption by avoiding
+    "/ useless computation
+    Delay waitForMilliseconds: 200. 
+    completions := support computeCompletion.
+    completions notEmptyOrNil ifTrue:[
+        editView sensor pushUserEvent: #updateCompletions: for: self withArgument: completions.
+    ].
+
+    "Created: / 27-09-2013 / 13:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-09-2013 / 11:53:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+openCompletionView
+    self openCompletionView: #()
+
+    "Created: / 27-09-2013 / 16:17:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+openCompletionView: list
+    "Makes sure the completion view is opened and with given `list`."
+    
+    | movePos topView x y|
+    "/ move the window
+
+    list isEmpty ifTrue:[ ^ self ].
+
+    x := (editView xOfCol:editView cursorCol  inVisibleLine:editView cursorLine)
+            - 16"icon" - (editView widthOfString:  support wordBeforeCursor) - 5"magic constant".
+    y := editView yOfCursor + editView font maxHeight + 3.
+    movePos := (editView originRelativeTo: nil) + (x @ y).           
+
+    completionView isNil ifTrue:[
+        completionView := CompletionView new.
+        completionView list:list.
+        completionView font: editView font.
+        topView := completionView.
+        topView origin:movePos.
+"/        topView resizeToFit.
+        self updateSelection.
+        topView open.
+    ] ifFalse:[
+        completionView list:list.
+        self updateSelection.
+"/        topView := completionView topView.
+"/        topView ~~ completionView ifTrue:[
+"/            topView origin:movePos.
+"/            topView resizeToFit.
+"/        ]
+    ].
+
+    "Created: / 27-09-2013 / 14:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-09-2013 / 23:54:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateCompletions: completionResult
+    self openCompletionView: completionResult
+
+    "Created: / 27-09-2013 / 13:52:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__CompletionEngine.st	Wed Oct 02 13:37:01 2013 +0100
@@ -0,0 +1,40 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Object subclass:#CompletionEngine
+	instanceVariableNames:'codeView'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Core'
+!
+
+!CompletionEngine class methodsFor:'testing'!
+
+isAbstract
+    ^ self == CompletionEngine
+
+    "Created: / 02-10-2013 / 13:11:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionEngine methodsFor:'completion'!
+
+complete
+    "Compute completion for `codeView`, taking all the information
+     from it. Returns a CompletionResult with computed completions"        
+
+    ^ self subclassResponsibility
+
+    "Modified (comment): / 02-10-2013 / 13:33:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeFor: aCodeView2OrTextEditView
+    "Compute completion for given codeView, taking all the information
+     from it. Returns a CompletionResult with computed completions"
+
+    codeView := aCodeView2OrTextEditView.
+    ^ self complete.
+
+    "Created: / 02-10-2013 / 13:24:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/SmallSense__EditSupport.st	Wed Oct 02 12:29:25 2013 +0100
+++ b/SmallSense__EditSupport.st	Wed Oct 02 13:37:01 2013 +0100
@@ -9,13 +9,6 @@
 	category:'SmallSense-Core-Services'
 !
 
-EditTextViewCompletionSupport subclass:#CompletionController
-	instanceVariableNames:'support'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:EditSupport
-!
-
 
 !EditSupport class methodsFor:'instance creation'!
 
@@ -152,11 +145,24 @@
 !EditSupport methodsFor:'private-completion'!
 
 computeCompletion
-    "Compute completion and return a CompletionResult"
+    | completionEngineClass codeView result |
+
+    completionEngineClass := self completionEngineClass.
+    completionEngineClass isNil ifTrue: [ ^ nil ].
 
-    self subclassResponsibility
+    codeView := service codeView.
+    UserInformation 
+        handle: [:ex | 
+            codeView showInfo: (ex messageText).
+            ex proceed.
+        ]
+        do: [
+            result := completionEngineClass new completeFor: codeView 
+        ].
+    ^ result.
 
-    "Created: / 27-09-2013 / 13:14:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 27-09-2013 / 13:21:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-10-2013 / 13:31:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 insertCompletion: item
@@ -188,199 +194,6 @@
     "Modified: / 02-10-2013 / 02:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!EditSupport::CompletionController methodsFor:'accessing'!
-
-support
-    ^ support
-!
-
-support:anEditSupport
-    support := anEditSupport.
-! !
-
-!EditSupport::CompletionController methodsFor:'events'!
-
-handleKeyPress:key x:x y:y
-
-    key == #Control_L ifTrue:[
-        completionView notNil ifTrue:[
-            ^ false.
-        ].
-    ].
-
-    key == #CodeCompletion  ifTrue: [
-        autoSelect := true.    
-        self startCompletionProcess.
-        ^ true
-    ].
-
-    (key == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
-        | c |
-
-        c := editView characterBeforeCursor.
-        (c notNil and:[c isAlphaNumeric]) ifTrue:[
-             ^ false
-        ].
-    ].     
-
-
-    completionView notNil ifTrue:[
-        (key == #Return and:[completionView hasSelection]) ifTrue:[
-            self complete.
-            ^ true.
-        ].
-        key isCharacter ifTrue:[
-            self updateSelection.
-        ].
-    ].
-    ^ super handleKeyPress:key x:x y:y
-
-    "Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-09-2013 / 15:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-postKeyPress:key
-    UserPreferences current immediateCodeCompletion ifFalse:[
-        "/ only update, if already open
-        completionView isNil ifTrue:[^ self].
-    ].
-
-    (key == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
-        | c |
-
-        c := editView characterBeforeCursor.
-        (c notNil and:[c isLetterOrDigit]) ifTrue:[
-            autoSelect := false.
-            self updateCompletionList.
-        ] ifFalse:[
-             self closeCompletionView.
-        ].
-        ^ self
-    ].
-
-    key isCharacter ifTrue:[
-        key isLetterOrDigit not ifTrue:[
-            self closeCompletionView
-        ] ifFalse:[
-            autoSelect := false.
-            self updateCompletionList.
-        ].
-        ^ self
-    ].
-
-    "Created: / 28-09-2013 / 00:21:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-09-2013 / 14:55:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!EditSupport::CompletionController methodsFor:'private'!
-
-complete
-    support insertCompletion: completionView selection.
-    self closeCompletionView.
-
-    "Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-updateCompletionList
-    "called for keypress events"
-
-    completionView isNil ifTrue:[
-        super updateCompletionList
-    ] ifFalse:[
-         self updateSelection.
-    ].
-
-    "Created: / 27-09-2013 / 15:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 28-09-2013 / 00:15:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-updateSelection
-
-    | matches word |
-
-    word := support wordBeforeCursor.
-    matches := completionView list select:[:po | po stringToComplete startsWith: word ].
-    matches notEmptyOrNil ifTrue:[
-        completionView selection: (matches inject: matches anElement into:[:shortest :each |
-            each stringToComplete size < shortest stringToComplete size 
-                ifTrue:[each]
-                ifFalse:[shortest]
-        ]).
-    ] ifFalse:[
-        completionView selection: nil.
-    ]
-
-    "Created: / 27-09-2013 / 16:16:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!EditSupport::CompletionController methodsFor:'private-API'!
-
-computeCompletions
-    "Actually compute the completions and update the completion view."  
-
-    | completions |
-
-    "/ Wait a while to give user chance finish typing.
-    "/ This also reduces CPU consumption by avoiding
-    "/ useless computation
-    Delay waitForMilliseconds: 200. 
-    completions := support computeCompletion.
-    completions notEmptyOrNil ifTrue:[
-        editView sensor pushUserEvent: #updateCompletions: for: self withArgument: completions.
-    ].
-
-    "Created: / 27-09-2013 / 13:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-09-2013 / 11:53:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-openCompletionView
-    self openCompletionView: #()
-
-    "Created: / 27-09-2013 / 16:17:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-openCompletionView: list
-    "Makes sure the completion view is opened and with given `list`."
-    
-    | movePos topView x y|
-    "/ move the window
-
-    list isEmpty ifTrue:[ ^ self ].
-
-    x := (editView xOfCol:editView cursorCol  inVisibleLine:editView cursorLine)
-            - 16"icon" - (editView widthOfString:  support wordBeforeCursor) - 5"magic constant".
-    y := editView yOfCursor + editView font maxHeight + 3.
-    movePos := (editView originRelativeTo: nil) + (x @ y).           
-
-    completionView isNil ifTrue:[
-        completionView := CompletionView new.
-        completionView list:list.
-        completionView font: editView font.
-        topView := completionView.
-        topView origin:movePos.
-"/        topView resizeToFit.
-        self updateSelection.
-        topView open.
-    ] ifFalse:[
-        completionView list:list.
-        self updateSelection.
-"/        topView := completionView topView.
-"/        topView ~~ completionView ifTrue:[
-"/            topView origin:movePos.
-"/            topView resizeToFit.
-"/        ]
-    ].
-
-    "Created: / 27-09-2013 / 14:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-09-2013 / 23:54:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-updateCompletions: completionResult
-    self openCompletionView: completionResult
-
-    "Created: / 27-09-2013 / 13:52:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
 !EditSupport class methodsFor:'documentation'!
 
 version_HG
--- a/SmallSense__SmalltalkCompletion.st	Wed Oct 02 12:29:25 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,373 +0,0 @@
-"{ Package: 'jv:smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Object subclass:#SmalltalkCompletion
-	instanceVariableNames:'resultSet collector'
-	classVariableNames:''
-	poolDictionaries:''
-	category:'SmallSense-Smalltalk-Completion'
-!
-
-
-!SmalltalkCompletion class methodsFor:'utilities'!
-
-old_resultSetFor: mode source: source class: class row: row column: col 
-
-    | parser tree |
-
-
-    mode == #method ifTrue:[
-        parser := Parser new.
-        parser 
-            parseMethod:source asString
-            in: class
-            ignoreErrors:false
-            ignoreWarnings:false.
-    ] ifFalse:[
-        parser := Parser for: (source asString readStream).
-        "JV@2011-06-13: HACK, use polymorphism"
-        tree := parser
-            parseExpressionWithSelf:nil 
-            notifying:nil 
-            ignoreErrors:false 
-            ignoreWarnings:false 
-            inNameSpace:nil.
-        parser tree: tree.
-    ].
-    ^ self new
-        recognize:row
-        position:col
-        collector:parser
-
-    "Modified: / 07-04-2011 / 22:55:58 / Jakub <zelenja7@fel.cvut.cz>"
-    "Created: / 26-11-2011 / 14:40:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-resultSetFor: mode source: source class: class line: line column: col 
-
-    | inferencer tree |
-
-
-    mode == #method ifTrue:[
-        inferencer := SmalltalkInferencer forClass: class methodSource: source asString.
-        inferencer parserClass: SmalltalkParser.
-        inferencer process.
-    ] ifFalse:[
-        self breakPoint: #jv.
-        ^nil.
-        inferencer := Parser for: (source asString readStream).
-        "JV@2011-06-13: HACK, use polymorphism"
-        tree := inferencer
-            parseExpressionWithSelf:nil 
-            notifying:nil 
-            ignoreErrors:false 
-            ignoreWarnings:false 
-            inNameSpace:nil.
-        inferencer tree: tree.
-    ].
-    ^ self new
-        completeAtLine:line
-        column:col
-        collector:inferencer
-
-    "Modified: / 07-04-2011 / 22:55:58 / Jakub <zelenja7@fel.cvut.cz>"
-    "Created: / 26-11-2011 / 17:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 02-09-2013 / 14:43:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkCompletion methodsFor:'adding'!
-
-addClassVariables
-    | class |
-
-    class := collector klass theNonMetaclass.
-    class classVarNames do:[:nm|
-        resultSet add:(VariablePO classVariable: nm in: class).
-    ].
-
-    "Created: / 24-07-2013 / 17:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-07-2013 / 23:32:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addGlobalsStartingWith: prefix
-
-    | class ns cls |
-    class := collector klass.
-    ns := class nameSpace.
-    "nameSpace may return private class, sigh"
-    [ ns isNameSpace ] whileFalse:[ ns := ns nameSpace ].
-    ns keysDo:[:nm|
-        (nm startsWith: prefix) ifTrue:[
-            cls := ns classNamed: nm.
-            cls notNil ifTrue:[
-                cls isBehavior ifTrue:[
-                    resultSet add:(ClassPO new subject: cls; name: nm).
-                ] ifFalse:[
-                    resultSet add:(VariablePO globalVariable: cls).
-                ]
-            ]
-        ].
-    ].
-    ns ~~ Smalltalk ifTrue:[
-        Smalltalk keysDo:[:nm|
-            (nm startsWith: prefix) ifTrue:[
-                cls := Smalltalk classNamed: nm.
-                cls notNil ifTrue:[
-                    cls isBehavior ifTrue:[
-                        resultSet add:(ClassPO new subject: cls; name: nm ).
-                    ] ifFalse:[
-                        resultSet add:(VariablePO globalVariable: cls).
-                    ]
-                ]
-            ]
-        ].
-    ]
-
-    "Created: / 26-11-2011 / 17:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 24-07-2013 / 17:00:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addMethodsForType: type 
-    type 
-        classesDo: [:each | 
-            | class |
-
-            class := each.
-            [ class isNil ] whileFalse: [
-                class 
-                    selectorsAndMethodsDo: [:selector :met | 
-                        resultSet add: (MethodPO 
-                                    name: selector
-                                    description: nil
-                                    class: class).
-                    ].
-                class := class superclass.
-            ].
-        ].
-
-    "Created: / 26-11-2011 / 17:03:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addMethodsStartingWith: prefix
-    | selectors |
-
-    selectors := Dictionary new.
-
-
-    Smalltalk allClassesDo:[:class|
-        class selectorsAndMethodsDo:[:selector :mthd | 
-            (selector startsWith: prefix) ifTrue:[
-                | class skip |
-
-                class := mthd mclass superclass.
-                skip := false.
-                [ skip not and:[class notNil] ] whileTrue:[
-                    (class methodDictionary includesKey: selector) ifTrue:[
-                        skip := true.
-                    ].
-                    class := class superclass.
-                ].
-                skip ifFalse:[
-                    | classes |
-
-                    classes := selectors at: selector ifAbsentPut:[ Set new ].
-                    classes add: mthd mclass.
-                ].
-            ]
-        ].
-    ].
-
-    selectors keysAndValuesDo: [:selector :classes|
-        resultSet add:(MethodPO 
-                name:selector
-                description:"met source"nil
-                class:(classes size == 1 ifTrue:[classes anElement] ifFalse:[classes])).
-    ]
-
-    "Created: / 24-07-2013 / 13:10:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 02-10-2013 / 02:20:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addPools
-    | class |
-
-    class := collector klass theNonMetaclass.
-    class theNonMetaclass sharedPools do:[:pool|
-        pool theNonMetaclass classVarNames do:[:nm|
-            resultSet add:(VariablePO classVariable: nm in: pool).
-        ]
-    ].
-
-    "Created: / 24-07-2013 / 16:59:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-07-2013 / 23:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addPrivateClasses
-    | class |
-
-
-    class := collector klass theNonMetaclass.
-    class privateClassesDo:[:pclass|
-        | nm |
-
-        nm := pclass fullName copyFrom: class fullName size + 3.
-        resultSet add:(ClassPO new subject: pclass; name: nm).
-    ]
-
-    "Created: / 06-08-2013 / 12:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addVariablesFor: node
-
-    | n klass |
-
-    "Add Instance variables"
-    klass := collector klass.
-    [ klass notNil ] whileTrue:[
-         klass instVarNames do:[:nm |
-            resultSet add: (VariablePO instanceVariable: nm in: klass).
-         ].
-         klass := klass superclass.
-    ].
-    "Add pseudo variables"
-    #(self super here thisContext) do:[:nm|
-        resultSet add: (VariablePO new name: nm).
-    ].
-    "Add arguments"
-    collector parser methodArgs ? #() do:[:nm|
-        resultSet add: (VariablePO argument: nm).
-    ].
-    "Add temporaries"
-    collector parser methodVars ? #() do:[:nm|
-        resultSet add: (VariablePO variable: nm).
-    ].
-
-    n := node.
-    [ n notNil ] whileTrue:[
-        n isBlockNode ifTrue:[
-            n arguments ? #() do:[:barg|resultSet add: (VariablePO variable: barg name)].
-            n variables ? #() do:[:bvar|resultSet add: (VariablePO variable: bvar name)].
-        ].
-        n := n parent.
-    ]
-
-    "Created: / 31-07-2013 / 00:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 18-09-2013 / 00:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkCompletion methodsFor:'completion'!
-
-completeAtLine:line column:col collector:coll 
-    "find most possible codeCompletion object"
-    
-    | position |
-    resultSet := CompletionResult new.
-    collector := coll.
-
-    (collector tree isNil or:[collector tree == #Error]) ifTrue:[ 
-        ^ resultSet 
-    ].
-
-
-    position := SmalltalkParseNodeFinder new 
-                    findNodeIn: collector source tree: collector tree 
-                    line: line column: col.
-    resultSet context: position.
-
-
-    position isAfterNode ifTrue:[
-        self completeAfter:position node.
-    ] ifFalse:[
-    position isInNode ifTrue:[
-        self completeIn:position node.
-    ] ifFalse:[
-    position isBeforeNode ifTrue:[
-        self completeBefore:position node.
-    ]]].
-
-    resultSet isEmpty ifTrue:[
-        nil "/Only to set breakpoint here
-    ].
-    ^resultSet.
-
-    "Created: / 04-03-2011 / 13:01:14 / Jakub <zelenja7@fel.cvut.cz>"
-    "Modified: / 08-04-2011 / 10:52:59 / Jakub <zelenja7@fel.cvut.cz>"
-    "Created: / 26-11-2011 / 17:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 26-09-2013 / 11:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkCompletion methodsFor:'completion-private'!
-
-completeAfter:node
-    "return collection of completion items after given node"
-
-    | type |
-
-    type := node inferedType.
-    type isUnknownType ifFalse:[
-        self addMethodsForType: node inferedType
-    ].
-
-    "Created: / 04-03-2011 / 15:45:28 / Jakub <zelenja7@fel.cvut.cz>"
-    "Modified: / 08-04-2011 / 10:55:09 / Jakub <zelenja7@fel.cvut.cz>"
-    "Created: / 26-11-2011 / 17:07:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 24-09-2013 / 02:15:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-completeBefore:node
-
-    self breakPoint: #jv. "Not yet implemented"
-
-    "Created: / 04-03-2011 / 15:45:28 / Jakub <zelenja7@fel.cvut.cz>"
-    "Modified: / 08-04-2011 / 10:55:09 / Jakub <zelenja7@fel.cvut.cz>"
-    "Created: / 26-11-2011 / 17:07:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-completeIn:node
-    "return collection which can be afterNode"
-    
-    node isVariableNode ifTrue:[
-        node name first isUppercase ifTrue:[
-            self addGlobalsStartingWith: node name.
-            self addClassVariables.
-            self addPools.
-            self addPrivateClasses.
-        ] ifFalse:[
-            self addVariablesFor: node
-        ].
-        ^self.
-    ].
-
-    node isMessage ifTrue:[
-        | type |
-
-        type := node receiver inferedType.
-        type isUnknownType ifFalse:[
-            self addMethodsForType: type
-        ] ifTrue:[
-            self addMethodsStartingWith: node selector
-        ].
-
-        ^self.
-    ].
-
-    self breakPoint: #jv.
-
-    "Created: / 07-03-2011 / 18:59:02 / Jakub <zelenja7@fel.cvut.cz>"
-    "Modified: / 08-04-2011 / 09:31:51 / Jakub <zelenja7@fel.cvut.cz>"
-    "Created: / 26-11-2011 / 17:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 06-08-2013 / 12:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkCompletion class methodsFor:'documentation'!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
-!
-
-version_SVN
-    ^ '$Id: SmallSenseRecognizer.st 7826 2011-11-27 09:48:43Z vranyj1 $'
-! !
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__SmalltalkCompletionEngine.st	Wed Oct 02 13:37:01 2013 +0100
@@ -0,0 +1,382 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+CompletionEngine subclass:#SmalltalkCompletionEngine
+	instanceVariableNames:'resultSet collector'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Smalltalk'
+!
+
+
+!SmalltalkCompletionEngine class methodsFor:'utilities'!
+
+resultSetFor: mode source: source class: class line: line column: col 
+    | inferencer tree |
+
+    mode == #method ifTrue:[
+        inferencer := SmalltalkInferencer forClass: class methodSource: source asString.
+        inferencer parserClass: SmalltalkParser.
+        inferencer process.
+    ] ifFalse:[
+        self breakPoint: #jv.
+        ^nil.
+        inferencer := Parser for: (source asString readStream).
+        "JV@2011-06-13: HACK, use polymorphism"
+        tree := inferencer
+            parseExpressionWithSelf:nil 
+            notifying:nil 
+            ignoreErrors:false 
+            ignoreWarnings:false 
+            inNameSpace:nil.
+        inferencer tree: tree.
+    ].
+    ^ self new
+        completeAtLine:line
+        column:col
+        collector:inferencer
+
+    "Modified: / 07-04-2011 / 22:55:58 / Jakub <zelenja7@fel.cvut.cz>"
+    "Created: / 26-11-2011 / 17:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-09-2013 / 14:43:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 02-10-2013 / 13:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkCompletionEngine methodsFor:'adding'!
+
+addClassVariables
+    | class |
+
+    class := collector klass theNonMetaclass.
+    class classVarNames do:[:nm|
+        resultSet add:(VariablePO classVariable: nm in: class).
+    ].
+
+    "Created: / 24-07-2013 / 17:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-07-2013 / 23:32:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addGlobalsStartingWith: prefix
+
+    | class ns cls |
+    class := collector klass.
+    ns := class nameSpace.
+    "nameSpace may return private class, sigh"
+    [ ns isNameSpace ] whileFalse:[ ns := ns nameSpace ].
+    ns keysDo:[:nm|
+        (nm startsWith: prefix) ifTrue:[
+            cls := ns classNamed: nm.
+            cls notNil ifTrue:[
+                cls isBehavior ifTrue:[
+                    resultSet add:(ClassPO new subject: cls; name: nm).
+                ] ifFalse:[
+                    resultSet add:(VariablePO globalVariable: cls).
+                ]
+            ]
+        ].
+    ].
+    ns ~~ Smalltalk ifTrue:[
+        Smalltalk keysDo:[:nm|
+            (nm startsWith: prefix) ifTrue:[
+                cls := Smalltalk classNamed: nm.
+                cls notNil ifTrue:[
+                    cls isBehavior ifTrue:[
+                        resultSet add:(ClassPO new subject: cls; name: nm ).
+                    ] ifFalse:[
+                        resultSet add:(VariablePO globalVariable: cls).
+                    ]
+                ]
+            ]
+        ].
+    ]
+
+    "Created: / 26-11-2011 / 17:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-07-2013 / 17:00:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsForType: type 
+    type 
+        classesDo: [:each | 
+            | class |
+
+            class := each.
+            [ class isNil ] whileFalse: [
+                class 
+                    selectorsAndMethodsDo: [:selector :met | 
+                        resultSet add: (MethodPO 
+                                    name: selector
+                                    description: nil
+                                    class: class).
+                    ].
+                class := class superclass.
+            ].
+        ].
+
+    "Created: / 26-11-2011 / 17:03:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsStartingWith: prefix
+    | selectors |
+
+    selectors := Dictionary new.
+
+
+    Smalltalk allClassesDo:[:class|
+        class selectorsAndMethodsDo:[:selector :mthd | 
+            (selector startsWith: prefix) ifTrue:[
+                | class skip |
+
+                class := mthd mclass superclass.
+                skip := false.
+                [ skip not and:[class notNil] ] whileTrue:[
+                    (class methodDictionary includesKey: selector) ifTrue:[
+                        skip := true.
+                    ].
+                    class := class superclass.
+                ].
+                skip ifFalse:[
+                    | classes |
+
+                    classes := selectors at: selector ifAbsentPut:[ Set new ].
+                    classes add: mthd mclass.
+                ].
+            ]
+        ].
+    ].
+
+    selectors keysAndValuesDo: [:selector :classes|
+        resultSet add:(MethodPO 
+                name:selector
+                description:"met source"nil
+                class:(classes size == 1 ifTrue:[classes anElement] ifFalse:[classes])).
+    ]
+
+    "Created: / 24-07-2013 / 13:10:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-10-2013 / 02:20:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addPools
+    | class |
+
+    class := collector klass theNonMetaclass.
+    class theNonMetaclass sharedPools do:[:pool|
+        pool theNonMetaclass classVarNames do:[:nm|
+            resultSet add:(VariablePO classVariable: nm in: pool).
+        ]
+    ].
+
+    "Created: / 24-07-2013 / 16:59:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-07-2013 / 23:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addPrivateClasses
+    | class |
+
+
+    class := collector klass theNonMetaclass.
+    class privateClassesDo:[:pclass|
+        | nm |
+
+        nm := pclass fullName copyFrom: class fullName size + 3.
+        resultSet add:(ClassPO new subject: pclass; name: nm).
+    ]
+
+    "Created: / 06-08-2013 / 12:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addVariablesFor: node
+
+    | n klass |
+
+    "Add Instance variables"
+    klass := collector klass.
+    [ klass notNil ] whileTrue:[
+         klass instVarNames do:[:nm |
+            resultSet add: (VariablePO instanceVariable: nm in: klass).
+         ].
+         klass := klass superclass.
+    ].
+    "Add pseudo variables"
+    #(self super here thisContext) do:[:nm|
+        resultSet add: (VariablePO new name: nm).
+    ].
+    "Add arguments"
+    collector parser methodArgs ? #() do:[:nm|
+        resultSet add: (VariablePO argument: nm).
+    ].
+    "Add temporaries"
+    collector parser methodVars ? #() do:[:nm|
+        resultSet add: (VariablePO variable: nm).
+    ].
+
+    n := node.
+    [ n notNil ] whileTrue:[
+        n isBlockNode ifTrue:[
+            n arguments ? #() do:[:barg|resultSet add: (VariablePO variable: barg name)].
+            n variables ? #() do:[:bvar|resultSet add: (VariablePO variable: bvar name)].
+        ].
+        n := n parent.
+    ]
+
+    "Created: / 31-07-2013 / 00:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-09-2013 / 00:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkCompletionEngine methodsFor:'completion'!
+
+complete
+    "Compute completion for `codeView`, taking all the information
+     from it. Returns a CompletionResult with computed completions"
+
+    | class |
+
+    class := codeView isCodeView2 
+                ifTrue: [ codeView klass ]  
+                ifFalse: [ codeView editedClass ].
+    ^ self complete: codeView codeAspect source: codeView contents class: class line: codeView cursorLine column: codeView cursorCol
+
+    "Created: / 02-10-2013 / 13:32:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkCompletionEngine methodsFor:'completion-private'!
+
+complete: mode source: source class: class line: line column: col 
+    | inferencer tree |
+
+    mode == #method ifTrue:[
+        inferencer := SmalltalkInferencer forClass: class methodSource: source asString.
+        inferencer parserClass: SmalltalkParser.
+        inferencer process.
+    ] ifFalse:[
+        self breakPoint: #jv.
+        ^nil.
+        inferencer := Parser for: (source asString readStream).
+        "JV@2011-06-13: HACK, use polymorphism"
+        tree := inferencer
+            parseExpressionWithSelf:nil 
+            notifying:nil 
+            ignoreErrors:false 
+            ignoreWarnings:false 
+            inNameSpace:nil.
+        inferencer tree: tree.
+    ].
+    ^ self
+        completeAtLine:line
+        column:col
+        collector:inferencer
+
+    "Created: / 02-10-2013 / 13:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeAfter:node
+    "return collection of completion items after given node"
+
+    | type |
+
+    type := node inferedType.
+    type isUnknownType ifFalse:[
+        self addMethodsForType: node inferedType
+    ].
+
+    "Created: / 04-03-2011 / 15:45:28 / Jakub <zelenja7@fel.cvut.cz>"
+    "Modified: / 08-04-2011 / 10:55:09 / Jakub <zelenja7@fel.cvut.cz>"
+    "Created: / 26-11-2011 / 17:07:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-09-2013 / 02:15:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeAtLine:line column:col collector:coll 
+    "find most possible codeCompletion object"
+    
+    | position |
+    resultSet := CompletionResult new.
+    collector := coll.
+
+    (collector tree isNil or:[collector tree == #Error]) ifTrue:[ 
+        ^ resultSet 
+    ].
+
+
+    position := SmalltalkParseNodeFinder new 
+                    findNodeIn: collector source tree: collector tree 
+                    line: line column: col.
+    resultSet context: position.
+
+
+    position isAfterNode ifTrue:[
+        self completeAfter:position node.
+    ] ifFalse:[
+    position isInNode ifTrue:[
+        self completeIn:position node.
+    ] ifFalse:[
+    position isBeforeNode ifTrue:[
+        self completeBefore:position node.
+    ]]].
+
+    resultSet isEmpty ifTrue:[
+        nil "/Only to set breakpoint here
+    ].
+    ^resultSet.
+
+    "Created: / 04-03-2011 / 13:01:14 / Jakub <zelenja7@fel.cvut.cz>"
+    "Modified: / 08-04-2011 / 10:52:59 / Jakub <zelenja7@fel.cvut.cz>"
+    "Created: / 26-11-2011 / 17:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 26-09-2013 / 11:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeBefore:node
+
+    self breakPoint: #jv. "Not yet implemented"
+
+    "Created: / 04-03-2011 / 15:45:28 / Jakub <zelenja7@fel.cvut.cz>"
+    "Modified: / 08-04-2011 / 10:55:09 / Jakub <zelenja7@fel.cvut.cz>"
+    "Created: / 26-11-2011 / 17:07:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeIn:node
+    "return collection which can be afterNode"
+    
+    node isVariableNode ifTrue:[
+        node name first isUppercase ifTrue:[
+            self addGlobalsStartingWith: node name.
+            self addClassVariables.
+            self addPools.
+            self addPrivateClasses.
+        ] ifFalse:[
+            self addVariablesFor: node
+        ].
+        ^self.
+    ].
+
+    node isMessage ifTrue:[
+        | type |
+
+        type := node receiver inferedType.
+        type isUnknownType ifFalse:[
+            self addMethodsForType: type
+        ] ifTrue:[
+            self addMethodsStartingWith: node selector
+        ].
+
+        ^self.
+    ].
+
+    self breakPoint: #jv.
+
+    "Created: / 07-03-2011 / 18:59:02 / Jakub <zelenja7@fel.cvut.cz>"
+    "Modified: / 08-04-2011 / 09:31:51 / Jakub <zelenja7@fel.cvut.cz>"
+    "Created: / 26-11-2011 / 17:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-08-2013 / 12:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkCompletionEngine class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+    ^ '$Id: SmallSenseRecognizer.st 7826 2011-11-27 09:48:43Z vranyj1 $'
+! !
+
--- a/SmallSense__SmalltalkEditSupport.st	Wed Oct 02 12:29:25 2013 +0100
+++ b/SmallSense__SmalltalkEditSupport.st	Wed Oct 02 13:37:01 2013 +0100
@@ -20,6 +20,14 @@
     "Modified: / 24-07-2013 / 23:46:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SmalltalkEditSupport methodsFor:'accessing-classes'!
+
+completionEngineClass
+    ^ SmalltalkCompletionEngine
+
+    "Created: / 02-10-2013 / 13:30:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !SmalltalkEditSupport methodsFor:'editing'!
 
 insertElectricBlockOpenedBy: openText closedBy: closeText
@@ -38,33 +46,6 @@
 
 !SmalltalkEditSupport methodsFor:'event handling'!
 
-computeCompletion
-    | cls codeView result |
-
-    codeView := service codeView.
-    cls := codeView classHolder value.
-    cls isNil ifTrue: [
-        codeView showInfo: 'No class'.
-        ^ #().
-    ].
-    UserInformation 
-        handle: [:ex | 
-            codeView showInfo: (ex messageText).
-            ex proceed.
-        ]
-        do: [
-            result := SmalltalkCompletion
-                    resultSetFor: codeView mode
-                    source: codeView contents
-                    class: cls
-                    line: codeView cursorLine
-                    column: codeView cursorCol.
-        ].
-    ^ result.
-
-    "Created: / 27-09-2013 / 13:21:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 keyPress: key x:x y:y in: view
 
     "Handles an event in given view (a subview of codeView).
--- a/abbrev.stc	Wed Oct 02 12:29:25 2013 +0100
+++ b/abbrev.stc	Wed Oct 02 13:37:01 2013 +0100
@@ -5,6 +5,8 @@
 SmallSense::CodeHighlightingService SmallSense__CodeHighlightingService jv:smallsense 'SmallSense-Core-Services' 0
 SmallSense::CodeNavigationService SmallSense__CodeNavigationService jv:smallsense 'SmallSense-Core-Services' 0
 SmallSense::CompletionContext SmallSense__CompletionContext jv:smallsense 'SmallSense-Core' 0
+SmallSense::CompletionController SmallSense__CompletionController jv:smallsense 'SmallSense-Core' 0
+SmallSense::CompletionEngine SmallSense__CompletionEngine jv:smallsense 'SmallSense-Core' 0
 SmallSense::CompletionResult SmallSense__CompletionResult jv:smallsense 'SmallSense-Core' 0
 SmallSense::CompletionView SmallSense__CompletionView jv:smallsense 'SmallSense-Core-Interface' 2
 SmallSense::CompletionWindow SmallSense__CompletionWindow jv:smallsense 'SmallSense-Core-Interface' 1
@@ -22,7 +24,6 @@
 SmallSense::SelectorNode SmallSense__SelectorNode jv:smallsense 'SmallSense-Smalltalk' 0
 SmallSense::SettingsAppl SmallSense__SettingsAppl jv:smallsense 'SmallSense-Core-Interface' 1
 SmallSense::SmalltalkChecker SmallSense__SmalltalkChecker jv:smallsense 'SmallSense-Smalltalk-Lint' 0
-SmallSense::SmalltalkCompletion SmallSense__SmalltalkCompletion jv:smallsense 'SmallSense-Smalltalk-Completion' 0
 SmallSense::SmalltalkLintAnnotation SmallSense__SmalltalkLintAnnotation jv:smallsense 'SmallSense-Smalltalk-Lint' 0
 SmallSense::SmalltalkLintHighlighter SmallSense__SmalltalkLintHighlighter jv:smallsense 'SmallSense-Smalltalk-Lint' 0
 SmallSense::SmalltalkLintService SmallSense__SmalltalkLintService jv:smallsense 'SmallSense-Smalltalk-Lint' 0
@@ -44,6 +45,7 @@
 SmallSense::JavaEditSupport SmallSense__JavaEditSupport jv:smallsense 'SmallSense-Java' 0
 SmallSense::MethodInfo SmallSense__MethodInfo jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
 SmallSense::MethodPO SmallSense__MethodPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::SmalltalkCompletionEngine SmallSense__SmalltalkCompletionEngine jv:smallsense 'SmallSense-Smalltalk' 0
 SmallSense::SmalltalkEditSupport SmallSense__SmalltalkEditSupport jv:smallsense 'SmallSense-Smalltalk' 0
 SmallSense::SmalltalkInferencer SmallSense__SmalltalkInferencer jv:smallsense 'SmallSense-Smalltalk-Types-Inference' 0
 SmallSense::SmalltalkParseNodeFinder SmallSense__SmalltalkParseNodeFinder jv:smallsense 'SmallSense-Smalltalk' 0
--- a/bc.mak	Wed Oct 02 12:29:25 2013 +0100
+++ b/bc.mak	Wed Oct 02 13:37:01 2013 +0100
@@ -34,7 +34,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libhtml -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg2
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libhtml -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg2
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
@@ -60,7 +60,6 @@
 	pushd ..\..\stx\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\goodies\refactoryBrowser\browser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
-	pushd ..\..\stx\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\goodies\refactoryBrowser\lint & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\libhtml & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
@@ -89,12 +88,14 @@
 $(OUTDIR)SmallSense__CodeHighlightingService.$(O) SmallSense__CodeHighlightingService.$(H): SmallSense__CodeHighlightingService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CodeNavigationService.$(O) SmallSense__CodeNavigationService.$(H): SmallSense__CodeNavigationService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionContext.$(O) SmallSense__CompletionContext.$(H): SmallSense__CompletionContext.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__CompletionController.$(O) SmallSense__CompletionController.$(H): SmallSense__CompletionController.st $(INCLUDE_TOP)\stx\libwidg\EditTextViewCompletionSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__CompletionEngine.$(O) SmallSense__CompletionEngine.$(H): SmallSense__CompletionEngine.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionResult.$(O) SmallSense__CompletionResult.$(H): SmallSense__CompletionResult.st $(INCLUDE_TOP)\stx\libbasic\SortedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionView.$(O) SmallSense__CompletionView.$(H): SmallSense__CompletionView.st $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CompletionWindow.$(O) SmallSense__CompletionWindow.$(H): SmallSense__CompletionWindow.st $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CriticsWindow.$(O) SmallSense__CriticsWindow.$(H): SmallSense__CriticsWindow.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__EditService.$(O) SmallSense__EditService.$(H): SmallSense__EditService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__EditSupport.$(O) SmallSense__EditSupport.$(H): SmallSense__EditSupport.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextViewCompletionSupport.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__EditSupport.$(O) SmallSense__EditSupport.$(H): SmallSense__EditSupport.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__Info.$(O) SmallSense__Info.$(H): SmallSense__Info.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__Manager.$(O) SmallSense__Manager.$(H): SmallSense__Manager.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__PO.$(O) SmallSense__PO.$(H): SmallSense__PO.st $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -104,7 +105,6 @@
 $(OUTDIR)SmallSense__SelectorNode.$(O) SmallSense__SelectorNode.$(H): SmallSense__SelectorNode.st $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SettingsAppl.$(O) SmallSense__SettingsAppl.$(H): SmallSense__SettingsAppl.st $(INCLUDE_TOP)\stx\libtool\AbstractSettingsApplication.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkChecker.$(O) SmallSense__SmalltalkChecker.$(H): SmallSense__SmalltalkChecker.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\SmalllintChecker.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__SmalltalkCompletion.$(O) SmallSense__SmalltalkCompletion.$(H): SmallSense__SmalltalkCompletion.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkLintAnnotation.$(O) SmallSense__SmalltalkLintAnnotation.$(H): SmallSense__SmalltalkLintAnnotation.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkLintHighlighter.$(O) SmallSense__SmalltalkLintHighlighter.$(H): SmallSense__SmalltalkLintHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkLintService.$(O) SmallSense__SmalltalkLintService.$(H): SmallSense__SmalltalkLintService.st $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -124,6 +124,7 @@
 $(OUTDIR)SmallSense__JavaEditSupport.$(O) SmallSense__JavaEditSupport.$(H): SmallSense__JavaEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodInfo.$(O) SmallSense__MethodInfo.$(H): SmallSense__MethodInfo.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Info.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodPO.$(O) SmallSense__MethodPO.$(H): SmallSense__MethodPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__SmalltalkCompletionEngine.$(O) SmallSense__SmalltalkCompletionEngine.$(H): SmallSense__SmalltalkCompletionEngine.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkEditSupport.$(O) SmallSense__SmalltalkEditSupport.$(H): SmallSense__SmalltalkEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkInferencer.$(O) SmallSense__SmalltalkInferencer.$(H): SmallSense__SmalltalkInferencer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__SmalltalkParseNodeVisitor.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkParseNodeFinder.$(O) SmallSense__SmalltalkParseNodeFinder.$(H): SmallSense__SmalltalkParseNodeFinder.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__SmalltalkParseNodeVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/jv_smallsense.st	Wed Oct 02 12:29:25 2013 +0100
+++ b/jv_smallsense.st	Wed Oct 02 13:37:01 2013 +0100
@@ -46,7 +46,6 @@
     ^ #(
         #'stx:goodies/refactoryBrowser/helpers'    "BrowserEnvironment - superclass of SmallSense::SmalltalkUnacceptedMethodEnvironment "
         #'stx:goodies/refactoryBrowser/lint'    "RBLintRule - extended "
-        #'stx:goodies/sunit'    "TestAsserter - superclass of SmallSense::TestCase "
         #'stx:libbasic'    "Autoload - superclass of SmallSense::BaseTestClass "
         #'stx:libcomp'    "AbstractSyntaxHighlighter - superclass of SmallSense::SmalltalkParser "
         #'stx:libhtml'    "HTMLDocumentFrame - extended "
@@ -96,6 +95,7 @@
         #'stx:goodies/refactoryBrowser/parser'    "RBFormatter - referenced by SmallSense::SmalltalkEditSupport>>keyPressReturn "
         #'stx:libbasic2'    "BackgroundQueueProcessingJob - referenced by SmallSense::Manager>>initialize "
         #'stx:libbasic3'    "ChangeSet - referenced by RBTransformationRule>>fixes: "
+        #'stx:libjava/tools'    "JavaToolbox - referenced by SmallSense::CodeNavigationService::Navigator>>navigateToMessageSend: "
     )
 !
 
@@ -160,6 +160,8 @@
         #'SmallSense::CodeHighlightingService'
         #'SmallSense::CodeNavigationService'
         #'SmallSense::CompletionContext'
+        #'SmallSense::CompletionController'
+        #'SmallSense::CompletionEngine'
         #'SmallSense::CompletionResult'
         #'SmallSense::CompletionView'
         #'SmallSense::CompletionWindow'
@@ -177,7 +179,6 @@
         #'SmallSense::SelectorNode'
         #'SmallSense::SettingsAppl'
         #'SmallSense::SmalltalkChecker'
-        #'SmallSense::SmalltalkCompletion'
         #'SmallSense::SmalltalkLintAnnotation'
         #'SmallSense::SmalltalkLintHighlighter'
         #'SmallSense::SmalltalkLintService'
@@ -199,6 +200,7 @@
         #'SmallSense::JavaEditSupport'
         #'SmallSense::MethodInfo'
         #'SmallSense::MethodPO'
+        #'SmallSense::SmalltalkCompletionEngine'
         #'SmallSense::SmalltalkEditSupport'
         #'SmallSense::SmalltalkInferencer'
         #'SmallSense::SmalltalkParseNodeFinder'
--- a/libInit.cc	Wed Oct 02 12:29:25 2013 +0100
+++ b/libInit.cc	Wed Oct 02 13:37:01 2013 +0100
@@ -30,6 +30,8 @@
 _SmallSense__CodeHighlightingService_Init(pass,__pRT__,snd);
 _SmallSense__CodeNavigationService_Init(pass,__pRT__,snd);
 _SmallSense__CompletionContext_Init(pass,__pRT__,snd);
+_SmallSense__CompletionController_Init(pass,__pRT__,snd);
+_SmallSense__CompletionEngine_Init(pass,__pRT__,snd);
 _SmallSense__CompletionResult_Init(pass,__pRT__,snd);
 _SmallSense__CompletionView_Init(pass,__pRT__,snd);
 _SmallSense__CompletionWindow_Init(pass,__pRT__,snd);
@@ -45,7 +47,6 @@
 _SmallSense__SelectorNode_Init(pass,__pRT__,snd);
 _SmallSense__SettingsAppl_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkChecker_Init(pass,__pRT__,snd);
-_SmallSense__SmalltalkCompletion_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkLintAnnotation_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkLintHighlighter_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkLintService_Init(pass,__pRT__,snd);
@@ -65,6 +66,7 @@
 _SmallSense__JavaEditSupport_Init(pass,__pRT__,snd);
 _SmallSense__MethodInfo_Init(pass,__pRT__,snd);
 _SmallSense__MethodPO_Init(pass,__pRT__,snd);
+_SmallSense__SmalltalkCompletionEngine_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkEditSupport_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkInferencer_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkParseNodeFinder_Init(pass,__pRT__,snd);
--- a/smallsense.rc	Wed Oct 02 12:29:25 2013 +0100
+++ b/smallsense.rc	Wed Oct 02 13:37:01 2013 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Mon, 30 Sep 2013 13:18:21 GMT\0"
+      VALUE "ProductDate", "Wed, 02 Oct 2013 12:35:47 GMT\0"
     END
 
   END