Initial support for Java/Groovy completion and for mixed-language completion.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 04 Oct 2013 08:25:15 +0100
changeset 120 4fefce92f5bb
parent 119 9bb3a9892c2e
child 121 6fc2c58db318
Initial support for Java/Groovy completion and for mixed-language completion. For now, completion for Java & Groovy is rather naive, based on a lexical structure of the line.
Make.proto
Make.spec
SmallSense__ClassPO.st
SmallSense__CompletionEngine.st
SmallSense__EditSupport.st
SmallSense__GroovyCompletionEngineSimple.st
SmallSense__GroovyEditSupport.st
SmallSense__JavaCompletionEngineSimple.st
SmallSense__JavaEditSupport.st
SmallSense__MethodPO.st
SmallSense__PO.st
SmallSense__SmalltalkCompletionEngine.st
SmallSense__SmalltalkEditSupport.st
SmallSense__SmalltalkInferencer.st
abbrev.stc
bc.mak
jv_smallsense.st
libInit.cc
smallsense.rc
--- a/Make.proto	Fri Oct 04 08:01:47 2013 +0100
+++ b/Make.proto	Fri Oct 04 08:25:15 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/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/goodies/sunit -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,6 +137,7 @@
 	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)"
@@ -197,6 +198,7 @@
 $(OUTDIR)SmallSense__ClassType.$(O) SmallSense__ClassType.$(H): SmallSense__ClassType.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Type.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ConstantPO.$(O) SmallSense__ConstantPO.$(H): SmallSense__ConstantPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__GenericEditSupport.$(O) SmallSense__GenericEditSupport.$(H): SmallSense__GenericEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaCompletionEngineSimple.$(O) SmallSense__JavaCompletionEngineSimple.$(H): SmallSense__JavaCompletionEngineSimple.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(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)
@@ -208,6 +210,8 @@
 $(OUTDIR)SmallSense__UnionType.$(O) SmallSense__UnionType.$(H): SmallSense__UnionType.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Type.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__UnknownType.$(O) SmallSense__UnknownType.$(H): SmallSense__UnknownType.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Type.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__VariablePO.$(O) SmallSense__VariablePO.$(H): SmallSense__VariablePO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__GroovyEditSupport.$(O) SmallSense__GroovyEditSupport.$(H): SmallSense__GroovyEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__JavaEditSupport.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libcomp/AssignmentNode.$(H) $(INCLUDE_TOP)/stx/libcomp/MessageNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseErrorNode.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimaryNode.$(H) $(INCLUDE_TOP)/stx/libcomp/StatementNode.$(H) $(INCLUDE_TOP)/stx/libbasic/UserPreferences.$(H) $(INCLUDE_TOP)/stx/libbasic/IdentityDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libcomp/VariableNode.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBTransformationRule.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentView.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentFrame.$(H) $(INCLUDE_TOP)/stx/libview/View.$(H) $(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/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libwidg2/DoWhatIMeanSupport.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NavigationState.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)/stx/libcomp/BlockNode.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)/stx/libwidg/Workspace.$(H) $(INCLUDE_TOP)/stx/libwidg/TextCollector.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextView.$(H) $(INCLUDE_TOP)/stx/libwidg/TextView.$(H) $(INCLUDE_TOP)/stx/libwidg/ListView.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
--- a/Make.spec	Fri Oct 04 08:01:47 2013 +0100
+++ b/Make.spec	Fri Oct 04 08:25:15 2013 +0100
@@ -86,6 +86,7 @@
 	SmallSense::ClassType \
 	SmallSense::ConstantPO \
 	SmallSense::GenericEditSupport \
+	SmallSense::JavaCompletionEngineSimple \
 	SmallSense::JavaEditSupport \
 	SmallSense::MethodInfo \
 	SmallSense::MethodPO \
@@ -97,6 +98,8 @@
 	SmallSense::UnionType \
 	SmallSense::UnknownType \
 	SmallSense::VariablePO \
+	SmallSense::GroovyCompletionEngineSimple \
+	SmallSense::GroovyEditSupport \
 
 
 
@@ -138,6 +141,7 @@
     $(OUTDIR_SLASH)SmallSense__ClassType.$(O) \
     $(OUTDIR_SLASH)SmallSense__ConstantPO.$(O) \
     $(OUTDIR_SLASH)SmallSense__GenericEditSupport.$(O) \
+    $(OUTDIR_SLASH)SmallSense__JavaCompletionEngineSimple.$(O) \
     $(OUTDIR_SLASH)SmallSense__JavaEditSupport.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodInfo.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodPO.$(O) \
@@ -149,6 +153,8 @@
     $(OUTDIR_SLASH)SmallSense__UnionType.$(O) \
     $(OUTDIR_SLASH)SmallSense__UnknownType.$(O) \
     $(OUTDIR_SLASH)SmallSense__VariablePO.$(O) \
+    $(OUTDIR_SLASH)SmallSense__GroovyCompletionEngineSimple.$(O) \
+    $(OUTDIR_SLASH)SmallSense__GroovyEditSupport.$(O) \
     $(OUTDIR_SLASH)extensions.$(O) \
 
 
--- a/SmallSense__ClassPO.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__ClassPO.st	Fri Oct 04 08:25:15 2013 +0100
@@ -38,12 +38,16 @@
 
     showPrefix ifTrue:[
         nm := subject name.
+        subject isJavaClass ifTrue:[
+            nm := nm copyReplaceAll: $/ with: $.
+        ].
     ] ifFalse:[
         nm := subject nameWithoutPrefix.
     ].
     ^nm
 
     "Created: / 26-08-2013 / 10:26:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 11:38:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 showPrefix
@@ -54,12 +58,22 @@
     showPrefix := something.
 !
 
+stringToCompleteForLanguage: language
+    ^ (subject isJavaClass and:[language isSmalltalk]) ifTrue:[
+        'JAVA ', (subject name copyReplaceAll: $/ with: Character space)
+    ] ifFalse:[
+        super stringToCompleteForLanguage: language
+    ].
+
+    "Created: / 03-10-2013 / 16:42:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 subject: aClass
 
     super subject: aClass.
-    name := aClass name.
 
     "Created: / 06-04-2011 / 21:02:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 16:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ClassPO methodsFor:'converting'!
--- a/SmallSense__CompletionEngine.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__CompletionEngine.st	Fri Oct 04 08:25:15 2013 +0100
@@ -34,9 +34,58 @@
 
     codeView := aCodeView2OrTextEditView.
     result := CompletionResult new.
+
     ^ self complete.
 
     "Created: / 02-10-2013 / 13:24:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 03-10-2013 / 11:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 16:42:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!CompletionEngine methodsFor:'completion-individual'!
+
+addMethodsStartingWith: prefix
+    ^ self addMethodsStartingWith: prefix filter: nil
+
+    "Created: / 24-07-2013 / 13:10:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 17:59:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsStartingWith: prefix filter: filterOrNil
+    | selectors filter |
+
+    selectors := Dictionary new.
+    filter := filterOrNil  isNil ifTrue:[ [:method | true ] ] ifFalse:[ filterOrNil  ].
+
+    Smalltalk allClassesDo:[:class|
+        class selectorsAndMethodsDo:[:selector :mthd |             
+            ((selector startsWith: prefix) and:[filter value: mthd]) 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|
+        result add:(MethodPO 
+                name:selector
+                description:"met source"nil
+                class:(classes size == 1 ifTrue:[classes anElement] ifFalse:[classes])).
+    ]
+
+    "Created: / 03-10-2013 / 17:56:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/SmallSense__EditSupport.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__EditSupport.st	Fri Oct 04 08:25:15 2013 +0100
@@ -40,6 +40,17 @@
     ^ service
 ! !
 
+!EditSupport methodsFor:'accessing-classes'!
+
+completionEngineClass
+    "Returns a code completion engine class or nil, of 
+     no completion is supported"
+
+    ^ nil
+
+    "Created: / 03-10-2013 / 17:43:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !EditSupport methodsFor:'editing'!
 
 insertDo: aBlock
@@ -89,19 +100,24 @@
 !EditSupport methodsFor:'initialization'!
 
 initializeCompletion
-    completionController := CompletionController for: service textView.
-    completionController support: self.
-    service textView completionSupport: completionController.
+    self completionEngineClass  notNil ifTrue:[
+        completionController := CompletionController 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: / 03-10-2013 / 17:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializeForService:aSmallSenseService
     service := aSmallSenseService.
     textView := aSmallSenseService textView.
     backspaceIsUndo := false.
+    self initializeCompletion.
 
     "Created: / 27-09-2013 / 13:19:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 17:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditSupport methodsFor:'private'!
@@ -188,10 +204,10 @@
             textView cursorCol: startCol + stringToComplete size.
         ].
     ].
-    textView cursorCol: textView cursorCol - stringToComplete size + po cursorColumnAfterComplete.
+    textView setCursorCol: textView cursorCol - stringToComplete size + (po cursorColumnAfterCompleteForLanguage: self language).
 
     "Created: / 27-09-2013 / 15:40:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 02-10-2013 / 02:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 16:52:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditSupport class methodsFor:'documentation'!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__GroovyCompletionEngineSimple.st	Fri Oct 04 08:25:15 2013 +0100
@@ -0,0 +1,11 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+JavaCompletionEngineSimple subclass:#GroovyCompletionEngineSimple
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Groovy'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__GroovyEditSupport.st	Fri Oct 04 08:25:15 2013 +0100
@@ -0,0 +1,35 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+JavaEditSupport subclass:#GroovyEditSupport
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Groovy'
+!
+
+!GroovyEditSupport methodsFor:'accessing'!
+
+language
+    "superclass SmallSenseEditSupport says that I am responsible to implement this method"
+
+    | groovyLanguageClass |
+
+    groovyLanguageClass := Smalltalk at:#GroovyLanguage.
+    groovyLanguageClass notNil ifTrue:[ groovyLanguageClass instance ] ifFalse: [ nil ].
+
+    "Created: / 04-10-2013 / 07:49:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovyEditSupport methodsFor:'accessing-classes'!
+
+completionEngineClass
+    "Returns a code completion engine class or nil, of 
+     no completion is supported"
+
+    ^ SmallSense::GroovyCompletionEngineSimple
+
+    "Created: / 04-10-2013 / 07:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__JavaCompletionEngineSimple.st	Fri Oct 04 08:25:15 2013 +0100
@@ -0,0 +1,147 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+CompletionEngine subclass:#JavaCompletionEngineSimple
+	instanceVariableNames:'class method'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Java'
+!
+
+!JavaCompletionEngineSimple methodsFor:'completion'!
+
+complete
+    | line col scanner token tokens values maybeReceiverToken |
+
+    line := codeView listAt: codeView cursorLine.
+    col := codeView cursorCol.
+    line isNil ifTrue:[ ^ nil ].
+    line size < (col - 1) ifTrue:[ ^ nil ].
+
+    "/ we need at least three characters in order to reduce
+    "/ completions...
+    line size < 3 ifTrue:[ ^ nil ]. 
+    col - 3 to: col - 1 do:[:i|
+        | c |
+
+        c := line at: i.
+        (c isLetterOrDigit or:[c == $_ or:[ c == $$ ] ]) ifFalse:[ ^ nil ] 
+    ].
+
+    "/ Setup some context vars
+    method := codeView editedMethod.
+    class := method notNil ifTrue:[method mclass] ifFalse:[codeView editedClass ].
+
+    "/ ok, we got three character prefix, now scan the current line...
+    scanner := JavaScanner for: line.
+    tokens := OrderedCollection new.
+    values := OrderedCollection new.
+    [
+        [ (token := scanner nextToken) ~~ #EOF and:[ scanner tokenStartPosition < (col - 1) ] ] whileTrue:[
+            tokens add: token.
+            values add: scanner tokenValue.
+        ].
+    ] on: Error do:[ 
+        ^ nil 
+    ].
+
+    "/ now check whether the butlast token is dot...
+    maybeReceiverToken := nil.
+    (tokens size > 1 and:[(tokens at: tokens size - 1) == $.]) ifTrue:[
+        "/ if so, it's likely a message send, then complete methods...
+        tokens size > 2 ifTrue:[
+            maybeReceiverToken := values at: values size - 2.
+        ].
+    ] ifFalse:[
+        "/ if not, then complete local variables, fields and methods defined in the class itself.
+        maybeReceiverToken := 'this'.
+    ].
+    maybeReceiverToken = 'this' ifTrue:[
+        values last first isUppercase ifTrue:[      
+            self addClassesStartingWith: values last.
+        ] ifFalse:[
+            self addFieldsStartingWith: values last.
+            self addLocalsStartingWith: values last.
+        ].
+    ].
+    self addMethodsForReceiver: maybeReceiverToken startingWith: values last.
+
+    ^ result
+
+    "Created: / 02-10-2013 / 13:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 17:48:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaCompletionEngineSimple methodsFor:'completion-individual'!
+
+addClassesStartingWith: prefix
+    self allClassesDo:[:cls|
+        | name i |
+
+        name := cls name.
+        i := name lastIndexOf: $/.
+        ((name size >= (i + prefix size))
+            and:[(name at: i + 1) == prefix first
+            and:[(name at: i + prefix size) == prefix last
+            and:[(2 to: prefix size - 1) allSatisfy:[:o| (name at: i + o) == (prefix at: o)]]]])
+            ifTrue:[
+                result add: (ClassPO new subject: cls).        
+            ].
+    ].
+
+    "Created: / 03-10-2013 / 11:16:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 18:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addFieldsStartingWith: prefix
+    | klass |
+
+    klass := class.
+    [ klass notNil ] whileTrue:[
+        klass instVarNames do:[:nm |
+            result add: (VariablePO instanceVariable: nm in: klass).
+        ].
+        klass := klass superclass.
+    ].
+
+    "Created: / 03-10-2013 / 11:16:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addLocalsStartingWith: prefix
+
+    "Created: / 03-10-2013 / 17:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsForReceiver: maybeReceiverToken startingWith: prefix    
+    ^ self addMethodsStartingWith: prefix
+
+    "Created: / 03-10-2013 / 17:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsStartingWith: prefix    
+    ^ self addMethodsStartingWith: prefix filter: [:m | m isJavaMethod ]
+
+    "Created: / 03-10-2013 / 18:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+allClassesDo: aBlock
+    | loader loaders |
+
+    loaders := Set new.
+    loader := (class notNil and:[class isJavaClass]) ifTrue:[class classLoader] ifFalse:[JavaVM systemClassLoader].
+    [ loader notNil ] whileTrue:[
+        loaders add: loader.
+        loader := loader instVarNamed: #parent.
+    ].
+    loaders add: nil.
+
+    JavaVM registry  classesDo:[:cls|
+        (loaders includes: cls classLoader) ifTrue:[
+            aBlock value: cls.
+        ].
+    ].
+
+    "Created: / 03-10-2013 / 17:52:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/SmallSense__JavaEditSupport.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__JavaEditSupport.st	Fri Oct 04 08:25:15 2013 +0100
@@ -14,9 +14,24 @@
 language
     "superclass SmallSenseEditSupport says that I am responsible to implement this method"
 
-    ^ (Smalltalk at:#JavaLanguage) instance.
+    | javaLanguageClass |
+
+    javaLanguageClass := Smalltalk at:#JavaLanguage.
+    javaLanguageClass notNil ifTrue:[ javaLanguageClass instance ] ifFalse: [ nil ].
+
+    "Modified: / 04-10-2013 / 07:57:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
-    "Modified: / 04-08-2013 / 02:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!JavaEditSupport methodsFor:'accessing-classes'!
+
+completionEngineClass
+    "Returns a code completion engine class or nil, of 
+     no completion is supported"
+
+    ^ SmallSense::JavaCompletionEngineSimple
+
+    "Created: / 03-10-2013 / 17:45:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 07:42:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaEditSupport methodsFor:'event handling'!
--- a/SmallSense__MethodPO.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__MethodPO.st	Fri Oct 04 08:25:15 2013 +0100
@@ -38,6 +38,26 @@
     "Created: / 05-04-2011 / 17:08:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+cursorColumnAfterCompleteForLanguage: language
+    | stringToComplete idx |
+
+    stringToComplete := self stringToCompleteForLanguage: language.
+    language  isSmalltalk  ifTrue:[
+        idx := stringToComplete indexOf: $:.
+        ^idx == 0 ifTrue:[stringToComplete size + 1] ifFalse:[idx + 1].
+    ].
+    language isJava ifTrue:[
+        ^ (stringToComplete at: stringToComplete size - 1) isSeparator
+            ifTrue:[stringToComplete size- 2]
+            ifFalse:[stringToComplete size]
+    ].
+
+    ^ stringToComplete size + 1.
+
+    "Created: / 03-10-2013 / 16:50:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 18:09:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 label
 
     label isNil ifTrue:[
@@ -64,10 +84,25 @@
     "Created: / 05-04-2011 / 16:51:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-stringToCompleteForLanguage: aProgrammingLanguage
-    ^ self stringToComplete.
+stringToCompleteForLanguage: language
+    | someClass |
+
+    someClass := class isBehavior ifTrue:[class] ifFalse:[class anElement].
+    someClass isJavaClass ifTrue:[
+        | method |
+
+        method := someClass compiledMethodAt: name.
+        language isSmalltalk  ifTrue:[          
+            ^  method selector upTo: $(
+        ].
+        language isJava ifTrue:[
+            ^ (method selector upTo: $() , (method numArgs == 0 ifTrue:['()'] ifFalse:['(  )']).
+        ].
+    ].
+    ^ super stringToCompleteForLanguage: language
 
     "Created: / 02-10-2013 / 02:33:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 18:07:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MethodPO methodsFor:'displaying'!
--- a/SmallSense__PO.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__PO.st	Fri Oct 04 08:25:15 2013 +0100
@@ -47,9 +47,20 @@
     "Answers a cursor column after completion. The number returned
      is relative to the start of the text being replaced"
 
-    ^name size + 1
+    ^self stringToComplete size + 1
 
     "Created: / 05-04-2011 / 17:05:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 16:50:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+cursorColumnAfterCompleteForLanguage: language
+    "Answers a cursor column after completion. The number returned
+     is relative to the start of the text being replaced"
+
+    ^ (self stringToCompleteForLanguage: language) size
+
+    "Created: / 03-10-2013 / 16:49:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 07:48:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 description
@@ -69,10 +80,11 @@
 
 label
 
-    label ifNil:[label := name].
+    label isNil ifTrue:[label := self name].
     ^label
 
     "Created: / 07-04-2011 / 09:55:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 16:28:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 name
@@ -87,9 +99,10 @@
 
     "Answers a string to complete"
 
-    ^name
+    ^self name
 
     "Created: / 05-04-2011 / 16:48:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 16:31:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 stringToCompleteForLanguage: aProgrammingLanguage
--- a/SmallSense__SmalltalkCompletionEngine.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__SmalltalkCompletionEngine.st	Fri Oct 04 08:25:15 2013 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 CompletionEngine subclass:#SmalltalkCompletionEngine
-	instanceVariableNames:'resultSet collector'
+	instanceVariableNames:'collector'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Smalltalk'
@@ -43,14 +43,34 @@
     "Modified (format): / 02-10-2013 / 13:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!SmalltalkCompletionEngine methodsFor:'adding'!
+!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 ].
+    class isNil ifTrue:[
+        class := UndefinedObject.
+    ].
+    ^ 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>"
+    "Modified: / 04-10-2013 / 08:18:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SmalltalkCompletionEngine methodsFor:'completion-individual'!
 
 addClassVariables
     | class |
 
     class := collector klass theNonMetaclass.
     class classVarNames do:[:nm|
-        resultSet add:(VariablePO classVariable: nm in: class).
+        result add:(VariablePO classVariable: nm in: class).
     ].
 
     "Created: / 24-07-2013 / 17:00:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -67,11 +87,13 @@
     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).
+            (JavaPackage isNil or:[cls isJavaPackage not]) ifTrue:[
+                cls notNil ifTrue:[
+                    cls isBehavior ifTrue:[
+                        result add:(ClassPO new subject: cls).
+                    ] ifFalse:[
+                        result add:(VariablePO globalVariable: cls).
+                    ]
                 ]
             ]
         ].
@@ -80,11 +102,13 @@
         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).
+                (JavaPackage isNil or:[cls isJavaPackage not ]) ifTrue:[
+                    cls notNil ifTrue:[
+                        cls isBehavior ifTrue:[
+                            result add:(ClassPO new subject: cls).
+                        ] ifFalse:[
+                            result add:(VariablePO globalVariable: cls).
+                        ]
                     ]
                 ]
             ]
@@ -92,7 +116,7 @@
     ]
 
     "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>"
+    "Modified: / 03-10-2013 / 16:36:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addMethodsForType: type 
@@ -104,7 +128,7 @@
             [ class isNil ] whileFalse: [
                 class 
                     selectorsAndMethodsDo: [:selector :met | 
-                        resultSet add: (MethodPO 
+                        result add: (MethodPO 
                                     name: selector
                                     description: nil
                                     class: class).
@@ -116,53 +140,13 @@
     "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).
+            result add:(VariablePO classVariable: nm in: pool).
         ]
     ].
 
@@ -179,7 +163,7 @@
         | nm |
 
         nm := pclass fullName copyFrom: class fullName size + 3.
-        resultSet add:(ClassPO new subject: pclass; name: nm).
+        result add:(ClassPO new subject: pclass; name: nm).
     ]
 
     "Created: / 06-08-2013 / 12:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -193,28 +177,28 @@
     klass := collector klass.
     [ klass notNil ] whileTrue:[
          klass instVarNames do:[:nm |
-            resultSet add: (VariablePO instanceVariable: nm in: klass).
+            result add: (VariablePO instanceVariable: nm in: klass).
          ].
          klass := klass superclass.
     ].
     "Add pseudo variables"
     #(self super here thisContext) do:[:nm|
-        resultSet add: (VariablePO new name: nm).
+        result add: (VariablePO new name: nm).
     ].
     "Add arguments"
     collector parser methodArgs ? #() do:[:nm|
-        resultSet add: (VariablePO argument: nm).
+        result add: (VariablePO argument: nm).
     ].
     "Add temporaries"
     collector parser methodVars ? #() do:[:nm|
-        resultSet add: (VariablePO variable: nm).
+        result 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 arguments ? #() do:[:barg|result add: (VariablePO variable: barg name)].
+            n variables ? #() do:[:bvar|result add: (VariablePO variable: bvar name)].
         ].
         n := n parent.
     ]
@@ -223,50 +207,30 @@
     "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 |
+    | inferencer |
 
     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.
+        | lineString |
+
+        lineString := codeView list at: line.
+        lineString isEmptyOrNil ifTrue:[ ^ nil ].
+        inferencer := SmalltalkInferencer forExpression: lineString.
     ].
+    inferencer parserClass: SmalltalkParser.
+    inferencer process.
+
     ^ self
         completeAtLine:line
         column:col
         collector:inferencer
 
     "Created: / 02-10-2013 / 13:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 08:16:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 completeAfter:node
@@ -289,18 +253,15 @@
     "find most possible codeCompletion object"
     
     | position |
-    resultSet := CompletionResult new.
+
     collector := coll.
-
     (collector tree isNil or:[collector tree == #Error]) ifTrue:[ 
-        ^ resultSet 
+        ^ nil 
     ].
-
-
     position := SmalltalkParseNodeFinder new 
                     findNodeIn: collector source tree: collector tree 
                     line: line column: col.
-    resultSet context: position.
+    result context: position.
 
 
     position isAfterNode ifTrue:[
@@ -313,15 +274,15 @@
         self completeBefore:position node.
     ]]].
 
-    resultSet isEmpty ifTrue:[
+    result isEmpty ifTrue:[
         nil "/Only to set breakpoint here
     ].
-    ^resultSet.
+    ^result.
 
     "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>"
+    "Modified: / 03-10-2013 / 17:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 completeBefore:node
--- a/SmallSense__SmalltalkEditSupport.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__SmalltalkEditSupport.st	Fri Oct 04 08:25:15 2013 +0100
@@ -113,6 +113,7 @@
         ^ true
     ].
     tokens := self tokensAtCursorLine.
+    tokens isEmpty ifTrue:[ ^ false ].
     i := tokens size.
     t := tokens at: i.
     t == $[ ifTrue:[
@@ -141,7 +142,7 @@
     ^ false.
 
     "Created: / 25-07-2013 / 00:02:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 17-09-2013 / 23:21:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 08:03:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressReturnToken
@@ -161,10 +162,10 @@
 
 initializeForService: anEditService    
     super initializeForService: anEditService.
-    service textView  autoIndent:true.
-    self initializeCompletion.
+    service textView autoIndent:true.
 
     "Created: / 27-09-2013 / 13:22:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2013 / 17:44:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkEditSupport methodsFor:'private'!
--- a/SmallSense__SmalltalkInferencer.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/SmallSense__SmalltalkInferencer.st	Fri Oct 04 08:25:15 2013 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 Object subclass:#SmalltalkInferencer
-	instanceVariableNames:'class classInfo source parser parserClass tree'
+	instanceVariableNames:'type class classInfo source parser parserClass tree'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Smalltalk-Types-Inference'
@@ -60,6 +60,13 @@
     "Created: / 26-11-2011 / 12:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+forExpression: source
+
+    ^self new expression: source.
+
+    "Created: / 04-10-2013 / 08:12:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 forMethod: method
 
     ^self new method: method.
@@ -118,18 +125,29 @@
 
 class: cls source: src
 
-    class := cls.
+    class := cls ? UndefinedObject.
     classInfo := self manager infoForClass: class.
     source := src.
 
     "Created: / 26-11-2011 / 14:46:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 08:19:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+expression: expression
+
+    type := #expression.
+    self class: nil source: expression.
+
+    "Created: / 04-10-2013 / 08:14:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 method: method
 
+    type := #method.
     self class: method mclass source: method source.
 
     "Created: / 26-11-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 08:13:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkInferencer methodsFor:'private'!
@@ -151,13 +169,27 @@
     parserClass isNil ifTrue:[
         parserClass := class parserClass.
     ].
-    parser := parserClass 
-                parseMethod: source in: class
-                ignoreErrors:true 
-                ignoreWarnings:true.
-    tree := parser tree.
+    type == #method ifTrue:[
+        parser := parserClass 
+                    parseMethod: source in: class
+                    ignoreErrors:true 
+                    ignoreWarnings:true.
+        tree := parser tree.
+    ] ifFalse:[
+        type == #expression ifTrue:[
+            parser := parserClass for: source.
+            tree := parser
+                        parseExpressionWithSelf:nil 
+                        notifying:nil 
+                        ignoreErrors:false 
+                        ignoreWarnings:false 
+                        inNameSpace:nil.   
+            parser tree: tree.
+        ].
+    ].
 
     "Created: / 26-11-2011 / 12:51:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 04-10-2013 / 08:15:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkInferencer methodsFor:'processing'!
--- a/abbrev.stc	Fri Oct 04 08:01:47 2013 +0100
+++ b/abbrev.stc	Fri Oct 04 08:25:15 2013 +0100
@@ -42,6 +42,7 @@
 SmallSense::ClassType SmallSense__ClassType jv:smallsense 'SmallSense-Smalltalk-Types' 0
 SmallSense::ConstantPO SmallSense__ConstantPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
 SmallSense::GenericEditSupport SmallSense__GenericEditSupport jv:smallsense 'SmallSense-Core-Services' 0
+SmallSense::JavaCompletionEngineSimple SmallSense__JavaCompletionEngineSimple jv:smallsense 'SmallSense-Java' 0
 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
@@ -53,3 +54,5 @@
 SmallSense::UnionType SmallSense__UnionType jv:smallsense 'SmallSense-Smalltalk-Types' 0
 SmallSense::UnknownType SmallSense__UnknownType jv:smallsense 'SmallSense-Smalltalk-Types' 1
 SmallSense::VariablePO SmallSense__VariablePO jv:smallsense 'SmallSense-Core-Interface-PO' 0
+SmallSense::GroovyCompletionEngineSimple SmallSense__GroovyCompletionEngineSimple jv:smallsense 'SmallSense-Groovy' 0
+SmallSense::GroovyEditSupport SmallSense__GroovyEditSupport jv:smallsense 'SmallSense-Groovy' 0
--- a/bc.mak	Fri Oct 04 08:01:47 2013 +0100
+++ b/bc.mak	Fri Oct 04 08:25:15 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\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\goodies\sunit -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,6 +60,7 @@
 	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) "
@@ -121,6 +122,7 @@
 $(OUTDIR)SmallSense__ClassType.$(O) SmallSense__ClassType.$(H): SmallSense__ClassType.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Type.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ConstantPO.$(O) SmallSense__ConstantPO.$(H): SmallSense__ConstantPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__GenericEditSupport.$(O) SmallSense__GenericEditSupport.$(H): SmallSense__GenericEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaCompletionEngineSimple.$(O) SmallSense__JavaCompletionEngineSimple.$(H): SmallSense__JavaCompletionEngineSimple.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(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)
@@ -132,6 +134,8 @@
 $(OUTDIR)SmallSense__UnionType.$(O) SmallSense__UnionType.$(H): SmallSense__UnionType.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Type.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__UnknownType.$(O) SmallSense__UnknownType.$(H): SmallSense__UnknownType.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Type.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__VariablePO.$(O) SmallSense__VariablePO.$(H): SmallSense__VariablePO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__GroovyEditSupport.$(O) SmallSense__GroovyEditSupport.$(H): SmallSense__GroovyEditSupport.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__JavaEditSupport.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__EditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libcomp\AssignmentNode.$(H) $(INCLUDE_TOP)\stx\libcomp\MessageNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseErrorNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimaryNode.$(H) $(INCLUDE_TOP)\stx\libcomp\StatementNode.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libcomp\VariableNode.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBTransformationRule.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentView.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentFrame.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(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\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libwidg2\DoWhatIMeanSupport.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NavigationState.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)\stx\libcomp\BlockNode.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)\stx\libwidg\Workspace.$(H) $(INCLUDE_TOP)\stx\libwidg\TextCollector.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextView.$(H) $(INCLUDE_TOP)\stx\libwidg\TextView.$(H) $(INCLUDE_TOP)\stx\libwidg\ListView.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
--- a/jv_smallsense.st	Fri Oct 04 08:01:47 2013 +0100
+++ b/jv_smallsense.st	Fri Oct 04 08:25:15 2013 +0100
@@ -46,6 +46,7 @@
     ^ #(
         #'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 "
@@ -95,7 +96,8 @@
         #'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: "
+        #'stx:libjava'    "JavaPackage - referenced by SmallSense::SmalltalkCompletionEngine>>addGlobalsStartingWith: "
+        #'stx:libjava/tools'    "JavaScanner - referenced by SmallSense::JavaCompletionEngineSimple>>complete "
     )
 !
 
@@ -197,6 +199,7 @@
         #'SmallSense::ClassType'
         #'SmallSense::ConstantPO'
         #'SmallSense::GenericEditSupport'
+        #'SmallSense::JavaCompletionEngineSimple'
         #'SmallSense::JavaEditSupport'
         #'SmallSense::MethodInfo'
         #'SmallSense::MethodPO'
@@ -208,6 +211,8 @@
         #'SmallSense::UnionType'
         #'SmallSense::UnknownType'
         #'SmallSense::VariablePO'
+        #'SmallSense::GroovyCompletionEngineSimple'
+        #'SmallSense::GroovyEditSupport'
     )
 !
 
--- a/libInit.cc	Fri Oct 04 08:01:47 2013 +0100
+++ b/libInit.cc	Fri Oct 04 08:25:15 2013 +0100
@@ -63,6 +63,7 @@
 _SmallSense__ClassType_Init(pass,__pRT__,snd);
 _SmallSense__ConstantPO_Init(pass,__pRT__,snd);
 _SmallSense__GenericEditSupport_Init(pass,__pRT__,snd);
+_SmallSense__JavaCompletionEngineSimple_Init(pass,__pRT__,snd);
 _SmallSense__JavaEditSupport_Init(pass,__pRT__,snd);
 _SmallSense__MethodInfo_Init(pass,__pRT__,snd);
 _SmallSense__MethodPO_Init(pass,__pRT__,snd);
@@ -74,6 +75,8 @@
 _SmallSense__UnionType_Init(pass,__pRT__,snd);
 _SmallSense__UnknownType_Init(pass,__pRT__,snd);
 _SmallSense__VariablePO_Init(pass,__pRT__,snd);
+_SmallSense__GroovyCompletionEngineSimple_Init(pass,__pRT__,snd);
+_SmallSense__GroovyEditSupport_Init(pass,__pRT__,snd);
 
 _jv_137smallsense_extensions_Init(pass,__pRT__,snd);
 __END_PACKAGE__();
--- a/smallsense.rc	Fri Oct 04 08:01:47 2013 +0100
+++ b/smallsense.rc	Fri Oct 04 08:25:15 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", "Wed, 02 Oct 2013 12:35:47 GMT\0"
+      VALUE "ProductDate", "Fri, 04 Oct 2013 07:21:53 GMT\0"
     END
 
   END