Merged 1d0f835b2d9d and 174331ea79a5
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 19 Jun 2014 11:33:05 +0100
changeset 343 b3d22e8c0a05
parent 342 1d0f835b2d9d (current diff)
parent 241 174331ea79a5 (diff)
child 344 88d012c17762
Merged 1d0f835b2d9d and 174331ea79a5
Make.proto
Make.spec
SmallSense__ClassPO.st
SmallSense__MethodPO.st
SmallSense__PO.st
SmallSense__PackagePO.st
SmallSense__PackageSearchDialog.st
SmallSense__SmalltalkEditSupport.st
SmallSense__TestCase.st
SmallSense__VariablePO.st
abbrev.stc
bc.mak
jv_smallsense.st
libInit.cc
smallsense.rc
--- a/Make.proto	Sat May 10 12:08:16 2014 +0100
+++ b/Make.proto	Thu Jun 19 11:33:05 2014 +0100
@@ -34,7 +34,7 @@
 # add the path(es) here:,
 # ********** OPTIONAL: MODIFY the next lines ***
 # LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libhtml -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libwidg2
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/goodies/regex -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libhtml -I$(INCLUDE_TOP)/stx/libjava -I$(INCLUDE_TOP)/stx/libjava/tools -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libwidg2
 
 
 # if you need any additional defines for embedded C code,
@@ -130,6 +130,7 @@
 	cd $(TOP)/libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/goodies/refactoryBrowser/helpers && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/goodies/refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd $(TOP)/goodies/regex && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
 	cd $(TOP)/libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
@@ -169,7 +170,7 @@
 $(OUTDIR)SmallSense__CompletionController.$(O) SmallSense__CompletionController.$(H): SmallSense__CompletionController.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextViewCompletionSupport.$(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/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SortedCollection.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__CompletionView.$(O) SmallSense__CompletionView.$(H): SmallSense__CompletionView.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__CompletionView.$(O) SmallSense__CompletionView.$(H): SmallSense__CompletionView.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CriticsWindow.$(O) SmallSense__CriticsWindow.$(H): SmallSense__CriticsWindow.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__EditService.$(O) SmallSense__EditService.$(H): SmallSense__EditService.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__EditSupport.$(O) SmallSense__EditSupport.$(H): SmallSense__EditSupport.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -191,16 +192,21 @@
 $(OUTDIR)SmallSense__SmalltalkQuickFixer.$(O) SmallSense__SmalltalkQuickFixer.$(H): SmallSense__SmalltalkQuickFixer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkSyntaxHighlighter.$(O) SmallSense__SmalltalkSyntaxHighlighter.$(H): SmallSense__SmalltalkSyntaxHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkUnacceptedMethodEnvironment.$(O) SmallSense__SmalltalkUnacceptedMethodEnvironment.$(H): SmallSense__SmalltalkUnacceptedMethodEnvironment.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers/BrowserEnvironment.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternMatcher.$(O) SmallSense__TokenPatternMatcher.$(H): SmallSense__TokenPatternMatcher.st $(INCLUDE_TOP)/stx/goodies/regex/RxMatcher.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternParser.$(O) SmallSense__TokenPatternParser.$(H): SmallSense__TokenPatternParser.st $(INCLUDE_TOP)/stx/goodies/regex/RxCharSetParser.$(H) $(INCLUDE_TOP)/stx/goodies/regex/RxParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternToken.$(O) SmallSense__TokenPatternToken.$(H): SmallSense__TokenPatternToken.st $(INCLUDE_TOP)/stx/goodies/regex/RxsNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternTokenSet.$(O) SmallSense__TokenPatternTokenSet.$(H): SmallSense__TokenPatternTokenSet.st $(INCLUDE_TOP)/stx/goodies/regex/RxsCharSet.$(H) $(INCLUDE_TOP)/stx/goodies/regex/RxsNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenStream.$(O) SmallSense__TokenStream.$(H): SmallSense__TokenStream.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__Type.$(O) SmallSense__Type.$(H): SmallSense__Type.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__TypeHolder.$(O) SmallSense__TypeHolder.$(H): SmallSense__TypeHolder.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)jv_smallsense.$(O) jv_smallsense.$(H): jv_smallsense.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__AbstractSearchDialog.$(O) SmallSense__AbstractSearchDialog.$(H): SmallSense__AbstractSearchDialog.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__AbstractJavaCompletionEngine.$(O) SmallSense__AbstractJavaCompletionEngine.$(H): SmallSense__AbstractJavaCompletionEngine.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ClassInfo.$(O) SmallSense__ClassInfo.$(H): SmallSense__ClassInfo.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__Info.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ClassPO.$(O) SmallSense__ClassPO.$(H): SmallSense__ClassPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(STCHDR)
 $(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/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(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__JavaImportPO.$(O) SmallSense__JavaImportPO.$(H): SmallSense__JavaImportPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(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)
@@ -215,12 +221,17 @@
 $(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/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ClassSearchDialog.$(O) SmallSense__ClassSearchDialog.$(H): SmallSense__ClassSearchDialog.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__AbstractJavaCompletionEngineSimple.$(O) SmallSense__AbstractJavaCompletionEngineSimple.$(H): SmallSense__AbstractJavaCompletionEngineSimple.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__GroovyEditSupport.$(O) SmallSense__GroovyEditSupport.$(H): SmallSense__GroovyEditSupport.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__EditSupport.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__JavaEditSupport.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaCompletionEngine.$(O) SmallSense__JavaCompletionEngine.$(H): SmallSense__JavaCompletionEngine.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaConstructorPO.$(O) SmallSense__JavaConstructorPO.$(H): SmallSense__JavaConstructorPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__MethodPO.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodKeywordRestPO.$(O) SmallSense__MethodKeywordRestPO.$(H): SmallSense__MethodKeywordRestPO.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__MethodPO.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__PO.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodSearchDialog.$(O) SmallSense__MethodSearchDialog.$(H): SmallSense__MethodSearchDialog.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__PackageSearchDialog.$(O) SmallSense__PackageSearchDialog.$(H): SmallSense__PackageSearchDialog.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBTransformationRule.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(INCLUDE_TOP)/stx/libbasic/IdentityDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Method.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/UserPreferences.$(H) $(INCLUDE_TOP)/stx/libcomp/AssignmentNode.$(H) $(INCLUDE_TOP)/stx/libcomp/BlockNode.$(H) $(INCLUDE_TOP)/stx/libcomp/MessageNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseErrorNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimaryNode.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimitiveNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ReturnNode.$(H) $(INCLUDE_TOP)/stx/libcomp/StatementNode.$(H) $(INCLUDE_TOP)/stx/libcomp/VariableNode.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentFrame.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentView.$(H) $(INCLUDE_TOP)/stx/libtool/SystemBrowser.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NavigationState.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/ModalBox.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/StandardSystemView.$(H) $(INCLUDE_TOP)/stx/libview/TopView.$(H) $(INCLUDE_TOP)/stx/libview/View.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libwidg/DialogBox.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextView.$(H) $(INCLUDE_TOP)/stx/libwidg/ListView.$(H) $(INCLUDE_TOP)/stx/libwidg/TextCollector.$(H) $(INCLUDE_TOP)/stx/libwidg/TextView.$(H) $(INCLUDE_TOP)/stx/libwidg/Workspace.$(H) $(INCLUDE_TOP)/stx/libwidg2/DoWhatIMeanSupport.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaCompletionEngineSimple.$(O) SmallSense__JavaCompletionEngineSimple.$(H): SmallSense__JavaCompletionEngineSimple.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/jv/smallsense/SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
 
--- a/Make.spec	Sat May 10 12:08:16 2014 +0100
+++ b/Make.spec	Thu Jun 19 11:33:05 2014 +0100
@@ -79,16 +79,21 @@
 	SmallSense::SmalltalkQuickFixer \
 	SmallSense::SmalltalkSyntaxHighlighter \
 	SmallSense::SmalltalkUnacceptedMethodEnvironment \
+	SmallSense::TokenPatternMatcher \
+	SmallSense::TokenPatternParser \
+	SmallSense::TokenPatternToken \
+	SmallSense::TokenPatternTokenSet \
+	SmallSense::TokenStream \
 	SmallSense::Type \
 	SmallSense::TypeHolder \
 	jv_smallsense \
 	SmallSense::AbstractSearchDialog \
+	SmallSense::AbstractJavaCompletionEngine \
 	SmallSense::ClassInfo \
 	SmallSense::ClassPO \
 	SmallSense::ClassType \
 	SmallSense::ConstantPO \
 	SmallSense::GenericEditSupport \
-	SmallSense::JavaCompletionEngineSimple \
 	SmallSense::JavaEditSupport \
 	SmallSense::JavaImportPO \
 	SmallSense::MethodInfo \
@@ -103,11 +108,15 @@
 	SmallSense::UnknownType \
 	SmallSense::VariablePO \
 	SmallSense::ClassSearchDialog \
-	SmallSense::GroovyCompletionEngineSimple \
+	SmallSense::AbstractJavaCompletionEngineSimple \
 	SmallSense::GroovyEditSupport \
+	SmallSense::JavaCompletionEngine \
+	SmallSense::JavaConstructorPO \
 	SmallSense::MethodKeywordRestPO \
 	SmallSense::MethodSearchDialog \
 	SmallSense::PackageSearchDialog \
+	SmallSense::JavaCompletionEngineSimple \
+	SmallSense::GroovyCompletionEngineSimple \
 
 
 
@@ -142,16 +151,21 @@
     $(OUTDIR_SLASH)SmallSense__SmalltalkQuickFixer.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkSyntaxHighlighter.$(O) \
     $(OUTDIR_SLASH)SmallSense__SmalltalkUnacceptedMethodEnvironment.$(O) \
+    $(OUTDIR_SLASH)SmallSense__TokenPatternMatcher.$(O) \
+    $(OUTDIR_SLASH)SmallSense__TokenPatternParser.$(O) \
+    $(OUTDIR_SLASH)SmallSense__TokenPatternToken.$(O) \
+    $(OUTDIR_SLASH)SmallSense__TokenPatternTokenSet.$(O) \
+    $(OUTDIR_SLASH)SmallSense__TokenStream.$(O) \
     $(OUTDIR_SLASH)SmallSense__Type.$(O) \
     $(OUTDIR_SLASH)SmallSense__TypeHolder.$(O) \
     $(OUTDIR_SLASH)jv_smallsense.$(O) \
     $(OUTDIR_SLASH)SmallSense__AbstractSearchDialog.$(O) \
+    $(OUTDIR_SLASH)SmallSense__AbstractJavaCompletionEngine.$(O) \
     $(OUTDIR_SLASH)SmallSense__ClassInfo.$(O) \
     $(OUTDIR_SLASH)SmallSense__ClassPO.$(O) \
     $(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__JavaImportPO.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodInfo.$(O) \
@@ -166,11 +180,15 @@
     $(OUTDIR_SLASH)SmallSense__UnknownType.$(O) \
     $(OUTDIR_SLASH)SmallSense__VariablePO.$(O) \
     $(OUTDIR_SLASH)SmallSense__ClassSearchDialog.$(O) \
-    $(OUTDIR_SLASH)SmallSense__GroovyCompletionEngineSimple.$(O) \
+    $(OUTDIR_SLASH)SmallSense__AbstractJavaCompletionEngineSimple.$(O) \
     $(OUTDIR_SLASH)SmallSense__GroovyEditSupport.$(O) \
+    $(OUTDIR_SLASH)SmallSense__JavaCompletionEngine.$(O) \
+    $(OUTDIR_SLASH)SmallSense__JavaConstructorPO.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodKeywordRestPO.$(O) \
     $(OUTDIR_SLASH)SmallSense__MethodSearchDialog.$(O) \
     $(OUTDIR_SLASH)SmallSense__PackageSearchDialog.$(O) \
+    $(OUTDIR_SLASH)SmallSense__JavaCompletionEngineSimple.$(O) \
+    $(OUTDIR_SLASH)SmallSense__GroovyCompletionEngineSimple.$(O) \
     $(OUTDIR_SLASH)extensions.$(O) \
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__AbstractJavaCompletionEngine.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,130 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+CompletionEngine subclass:#AbstractJavaCompletionEngine
+	instanceVariableNames:'class method'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Java'
+!
+
+!AbstractJavaCompletionEngine class methodsFor:'queries'!
+
+isAbstract
+    "Return if this class is an abstract class.
+     True is returned here for myself only; false for subclasses.
+     Abstract subclasses must redefine again."
+
+    ^ self == SmallSense::AbstractJavaCompletionEngine.
+! !
+
+!AbstractJavaCompletionEngine methodsFor:'completion-individual'!
+
+addClassesStartingWith: prefix
+    ^ self addClassesStartingWith: prefix fullName: false
+
+    "Created: / 03-10-2013 / 11:16:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 07:25:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addClassesStartingWith: prefixArg fullName: matchFullName
+    | prefix |
+
+    prefix := prefixArg.
+    matchFullName ifTrue:[
+        prefix := prefix copyReplaceAll: $. with: $/.
+    ].
+    context environment allClassesDo: [:cls |
+        cls isJavaClass ifTrue:[
+            | name i |
+
+            matchFullName ifTrue:[
+                (cls binaryName startsWith: prefix) ifTrue:[
+                    result add: ((PO forClas: cls) showPrefix: true; yourself).
+                ].
+            ] ifFalse:[
+                name := cls lastName.
+                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: (PO forClass: cls).
+                    ].
+            ].
+        ].
+    ].
+
+    "Created: / 15-05-2014 / 07:24:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addConstructorsForClass: aJavaClass fullName: showFullName
+    aJavaClass selectorsAndMethodsDo:[:selector :method |
+        (selector first == $< and:[ selector startsWith: '<init>' ]) ifTrue:[
+            result add: ((JavaConstructorPO new initializeWithClass: aJavaClass selector: selector) showPrefix: showFullName)
+        ].
+    ].
+
+    "Created: / 15-05-2014 / 12:05:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addFieldsForType: type
+    | seen |
+
+    type isUnknownType ifTrue:[ 
+        ^ self.
+    ].
+    seen := Set new.
+    type classesDo:[:initialCls |
+        (seen includes: initialCls) ifFalse:[
+            | cls |
+
+            cls := initialCls.
+            cls staticFields do:[:each | result add: (VariablePO classVariable: each name in: cls) ].
+            [ cls ~~ JavaObject and:[ (seen includes: cls) not ] ] whileTrue:[
+                seen add: cls.
+                cls fields do:[:each | result add: (VariablePO instanceVariable: each name in: cls) ].
+                cls := cls superclass.
+            ].
+        ]
+    ].
+
+    "Created: / 17-05-2014 / 20:37:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-05-2014 / 17:36:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addImportsStartingWith: prefix
+    | packages |
+
+    packages := Set new.
+
+    "/ Class imports...
+    context environment allClassesDo: [:cls |
+        cls isJavaClass ifTrue:[
+            | name |
+
+            name := cls javaName.
+            (cls isPublic and:[name startsWith: prefix]) ifTrue:[
+                result add: (JavaImportPO new import: name; klass: cls; yourself).
+                packages add: cls javaPackage.
+            ].
+        ]
+    ].
+    "/ Package imports...
+    packages do:[:each |
+        result add: (JavaImportPO new import: (each , '.*'))
+    ].
+
+    "Created: / 19-10-2013 / 17:54:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 14-05-2014 / 12:48:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsStartingWith: prefix
+    ^ self addMethodsStartingWith: prefix stripOff: nil filter: [:m | m isJavaMethod ]
+
+    "Created: / 03-10-2013 / 18:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 08-04-2014 / 21:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__AbstractJavaCompletionEngineSimple.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,494 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+AbstractJavaCompletionEngine subclass:#AbstractJavaCompletionEngineSimple
+	instanceVariableNames:'imports locals'
+	classVariableNames:'PatternPrimitiveType PatternReferenceType'
+	poolDictionaries:''
+	category:'SmallSense-Java'
+!
+
+AbstractJavaCompletionEngineSimple class instanceVariableNames:'PatternsForCompletion PatternsForAnalysis'
+
+"
+ No other class instance variables are inherited by this class.
+"
+!
+
+
+!AbstractJavaCompletionEngineSimple class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    PatternPrimitiveType := '( [[:byte:]] | [[:short:]] | [[:int:]] | [[:long:]] | [[:float:]] | [[:double:]] | [[:char:]] | [[:boolean:]] )'.
+    PatternReferenceType := '( [[:Identifier:]]( \. [[:Identifier:]] )* )'
+
+    "Modified: / 19-05-2014 / 12:31:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple class methodsFor:'accessing'!
+
+patternsForAnalysis
+    PatternsForAnalysis isNil ifTrue:[
+        PatternsForAnalysis := self patternsFrom: self patternDefinitionsForAnalysis
+    ].
+    ^ PatternsForAnalysis
+
+    "Created: / 19-05-2014 / 11:56:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+patternsForCompletion
+    PatternsForCompletion isNil ifTrue:[
+        PatternsForCompletion := self patternsFrom: self patternDefinitionsForCompletion.  
+    ].
+    ^ PatternsForCompletion
+
+    "Created: / 14-05-2014 / 16:55:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-05-2014 / 11:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+patternsFrom: anArray
+    | patterns |
+
+    patterns := Dictionary new.
+    anArray pairWiseDo:[:key :def |
+        patterns at: key put: (TokenPatternParser parse: def)             
+    ].
+    ^ patterns
+
+    "Created: / 19-05-2014 / 11:55:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple class methodsFor:'accessing-definitions'!
+
+patternDefinitionsForAnalysis
+    ^ { 
+        #analyzeImport:                 . '[[:import:]] [[:Identifier:]] ( \. ([[:Identifier:]] | \*) )* ;' .
+        #analyzeLocalDecl:              .  '( ', PatternPrimitiveType , ' | ' , PatternReferenceType , ') [[:Identifier:]] ( = | ; )' .
+    }
+
+    "
+    self flush; patternsForAnalysis
+    "
+
+    "Created: / 19-05-2014 / 11:56:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-05-2014 / 10:23:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+patternDefinitionsForCompletion
+    ^ { 
+        #completeImport:                . '[[:import:]] ( [[:Identifier:]](\.[[:Identifier:]])*\.? )? [[:CARET:]]' .
+        #completeNew:                   . '[[:new:]] ( [[:Identifier:]](\.[[:Identifier:]])*\.?)? [[:CARET:]]' .
+        #completeLocalDef:              . '( ', PatternPrimitiveType , ' | ' , PatternReferenceType , ') [[:Identifier:]] [[:CARET:]]' .
+    }
+
+    "
+    self flush
+    "
+
+    "Created: / 19-05-2014 / 11:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple class methodsFor:'queries'!
+
+isAbstract
+    "Return if this class is an abstract class.
+     True is returned here for myself only; false for subclasses.
+     Abstract subclasses must redefine again."
+
+    ^ self == SmallSense::AbstractJavaCompletionEngineSimple.
+
+    "Modified: / 19-05-2014 / 11:23:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple class methodsFor:'utilities'!
+
+flush
+    PatternsForAnalysis := PatternsForCompletion := nil.
+    self subclassesDo:[:each | each flush ].
+
+    "Created: / 19-05-2014 / 11:57:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple methodsFor:'accessing'!
+
+patternsForAnalysis
+    ^ self class patternsForAnalysis
+
+    "Created: / 19-05-2014 / 13:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+patternsForCompletion
+    ^ self class patternsForCompletion
+
+    "Created: / 14-05-2014 / 17:02:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple methodsFor:'accessing-class'!
+
+scannerClass
+    "raise an error: must be redefined in concrete subclass(es)"
+
+    ^ self subclassResponsibility
+! !
+
+!AbstractJavaCompletionEngineSimple methodsFor:'analysis'!
+
+analyze
+    | stream |
+
+    imports := OrderedCollection new.
+    locals := Dictionary new.
+    stream := TokenStream on: (self scannerClass for: codeView contents).
+    self patternsForAnalysis keysAndValuesDo:[ :action :pattern |
+        | matcher |
+
+        stream reset. "/ Reset the position
+        matcher := TokenPatternMatcher for: pattern.
+        matcher matchesOnStream: stream do:[:match | 
+            self perform: action with: match.
+        ].
+    ].
+
+    "Created: / 19-05-2014 / 13:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-06-2014 / 16:47:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+analyzeImport: match
+
+    | import |
+
+    import := String streamContents: [ :s| 2 to: match size - 1 do:[:i | s nextPutAll: (match at: i) value asString ] ].
+    imports add: import
+
+    "Created: / 19-05-2014 / 13:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+analyzeLocalDecl: match
+    | typename name |
+
+    self assert: match size >= 3.
+
+    name := (match at: match size - 1) value.
+    typename := String streamContents:[ :s| 1 to: match size - 2 do:[:i | s nextPutAll: (match at: i) value asString ] ].
+
+    locals at: name put: typename.
+
+    "Created: / 23-05-2014 / 10:23:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple methodsFor:'completion-individual'!
+
+addSnippetsStartingWith: prefix
+    self scannerClass keywordTable keysDo:[:keyword |
+        (keyword startsWith: prefix) ifTrue:[
+            result add: (SnippetPO new value: keyword , ' ').        
+        ]
+    ]
+
+    "Created: / 18-05-2014 / 10:49:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addVariables
+    self addFieldsForType: self guessTypeOfThis.
+
+    locals keysDo:[:name | 
+        result add: (VariablePO variable: name) 
+    ].
+
+    "Created: / 17-05-2014 / 09:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-05-2014 / 16:45:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple methodsFor:'completion-private'!
+
+complete
+    | line col stream tokens anyMatched |
+
+    line := codeView listAt: codeView cursorLine.
+    col := codeView cursorCol.
+    line isNil ifTrue:[ ^ nil ].
+    line size < (col - 1) ifTrue:[ ^ nil ].
+
+    self analyze.
+
+    stream := TokenStream on: (self scannerClass for: line string) cursor: col - 1.
+    anyMatched := false.
+    self patternsForCompletion keysAndValuesDo:[ :action :pattern |
+        | matcher |
+
+        stream position: 0. "/ Reset the position
+        matcher := TokenPatternMatcher for: pattern.
+        matcher matchesOnStream: stream do:[:match | 
+            self perform: action with: match.
+            anyMatched := true.
+        ].
+    ].
+    anyMatched ifFalse:[ 
+        | caretI last lastI |
+
+        stream position: 0.
+        tokens := stream contents.
+        "/ At least there must be CARET token
+        tokens size == 1 ifTrue:[ ^ result ].
+        tokens first type == #CARET ifTrue:[ ^ result ].
+
+        "/ Find last token before CARET
+        caretI := 2.
+        [ (tokens at: caretI) type ~~ #CARET ] whileTrue:[ caretI := caretI + 1 ].
+        lastI := caretI - 1.
+        last := tokens at: lastI.
+
+        last type == #Identifier ifTrue:[
+            lastI == 1 ifTrue:[ 
+                "/ Only one token on line, complete local variable or receiver's field.
+                self completeSnippetsStartingWith: last value.
+                self completeLocalOrFieldIn: tokens before: caretI.
+            ] ifFalse:[ 
+                "/ If preceeding token is dot, complete method or field of the receiver.
+                (tokens at: lastI - 1) type == $. ifTrue:[ 
+                    self completeMethodOrFieldIn: tokens before: caretI.
+                ] ifFalse:[ 
+                    "/ Else try to complete field.
+                    self completeLocalOrFieldIn: tokens before: caretI.
+                ].
+            ].
+        ] ifFalse:[
+        "/ Else if last token in dot, complete method or field of the receiver
+        last type == $. ifTrue:[ 
+            self completeMethodOrFieldIn: tokens before: caretI.
+        ]].
+    ].
+    ^ result
+
+    "Created: / 02-10-2013 / 13:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-05-2014 / 13:07:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeImport: match
+    | prefix |
+
+    match size > 2 ifTrue:[ 
+        prefix := String streamContents:[:s | 2 to: match size - 1 do:[:i | s nextPutAll: (match at: i) value asString] ].
+        self addImportsStartingWith: prefix
+    ].
+
+    "Created: / 15-05-2014 / 06:57:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-05-2014 / 13:39:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeLocalDef: match
+    "Nothing to so here. Mainly to inhibit local variable/field completion here"
+
+    "Created: / 19-05-2014 / 12:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeLocalOrFieldIn: tokens before: caretTokenIndex
+    self addVariables
+
+    "Created: / 15-05-2014 / 18:53:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-05-2014 / 09:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeMethodOrFieldIn: tokens before: caretTokenIndex
+    | type dotIndex |
+
+    dotIndex := (tokens at: caretTokenIndex - 1) type == #Identifier ifTrue:[ caretTokenIndex - 2 ] ifFalse:[ caretTokenIndex - 1 ].  
+    self assert: (tokens at: dotIndex) type == $..
+    type := self guessTypeOfExpressionBefore: dotIndex in: tokens.
+    type isUnknownType ifFalse:[
+        self addMethodsForType: type.  
+        "/self addFieldsForType: type.
+    ] ifTrue:[ 
+        (tokens at: caretTokenIndex - 1) type == #Identifier ifTrue:[
+            | prefix |
+
+            prefix := (tokens at: caretTokenIndex - 1) value.
+            (prefix size >= 3 and:[ prefix ~= 'get' and:[prefix ~= 'set' ]]) ifTrue:[
+                self addMethodsStartingWith: prefix.
+            ].
+        ].
+    ].
+
+    "Created: / 15-05-2014 / 18:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2014 / 13:16:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeNew: match
+    | prefix classes full |
+
+    match size < 2 ifTrue:[ 
+        ^ self.
+    ].
+
+    match size > 3 ifTrue:[ 
+        prefix := String streamContents:[:s | 2 to: match size - 1 do:[:i | s nextPutAll: (match at: i) value asString] ].
+        full := true.
+    ] ifFalse:[
+        match size < 3 ifTrue:[ ^ self ].
+        prefix := (match at: 2) value.
+        full := false.
+    ].
+    prefix replaceAll: $. with: $/.
+    classes := Set new.
+    context environment allClassesDo:[:cls |
+        (cls isJavaClass and:[cls isPublic]) ifTrue:[ 
+            full ifTrue:[ 
+                (cls binaryName startsWith: prefix) ifTrue:[ 
+                    classes add: cls.
+                ].
+            ] ifFalse:[ 
+                (cls lastName startsWith: prefix) ifTrue:[ 
+                    classes add: cls.
+                ].
+            ].
+        ].
+    ].
+
+    classes do:[:cls | 
+        self addConstructorsForClass: cls fullName: full.
+    ].
+
+    "Created: / 15-05-2014 / 07:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-05-2014 / 13:19:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+completeSnippetsStartingWith: prefix
+    self addSnippetsStartingWith: prefix
+
+    "Created: / 18-05-2014 / 10:48:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple methodsFor:'guesswork'!
+
+guessTypeOfExpressionBefore: end in: tokens
+    | i type |
+
+    i := end - 1.  
+
+    (tokens at: i) type == $) ifTrue:[ 
+        "/ OK, end of message send, scan for method name...
+        | nparens nargs name |
+
+        nparens := 1.
+
+        i := i - 1.
+        nargs := 0.
+        (tokens at: i) type == $( ifTrue:[ 
+            i := i - 1.
+        ] ifFalse:[
+            nargs := 1.
+            [ i > 0 and:[ nparens ~~ 0 ] ] whileTrue:[ 
+                (tokens at: i) type == $) ifTrue:[ 
+                    nparens := nparens + 1 
+                ] ifFalse:[ 
+                    (tokens at: i) type == $( ifTrue:[ 
+                        nparens := nparens - 1 
+                    ] ifFalse:[ 
+                        (((tokens at: i) type == $,) and:[nparens == 1]) ifTrue:[    
+                            nargs := nargs + 1.
+                        ]
+                    ].
+                ].
+                i := i - 1.
+            ].
+        ].
+        nparens ~~ 0 ifTrue:[ 
+            "/ Malformed input
+            ^ Type unknown
+        ].
+        (tokens at: i) type == #Identifier ifFalse:[ 
+            "/ Malformed input
+            ^ Type unknown
+        ].
+        name := (tokens at: i) value.
+        i > 0 ifTrue:[ 
+            (tokens at: i - 1) type == $. ifTrue:[ 
+                type := self guessTypeOfExpressionBefore: i - 1 in: tokens.
+            ] ifFalse:[ 
+                type := self guessTypeOfThis.
+            ].
+            ^ self guessTypeOfMethod: type of: type numArgs: nargs.
+        ].
+    ].
+    (tokens at: i) type == #Identifier ifTrue:[ 
+        "/ Either field or local
+        | name type |
+
+        name := (tokens at: i) value.
+        (i > 1 and:[ (tokens at: i - 1) type == $. ]) ifTrue:[ 
+            "/ Non-this field
+            type := self guessTypeOfExpressionBefore: i - 1 in: tokens.      
+            ^ self guessTypeOfField: name of: type.  
+        ] ifFalse:[ 
+            "/ This-field
+            ^ self guessTypeOfFieldOrLocal: name
+        ].
+    ].
+
+    ^ Type unknown    
+"/    ^ Type withClass: 
+"/        (context environment classNamed:#'JAVA::java::lang::Object')
+"/            ? (context environment classNamed:#'java/lang/Object')
+
+    "Created: / 17-05-2014 / 10:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+guessTypeOfField: name of: type
+    ^ Type unknown
+
+    "Created: / 17-05-2014 / 10:47:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+guessTypeOfFieldOrLocal: name
+    ^ Type unknown
+
+    "Created: / 17-05-2014 / 10:47:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+guessTypeOfMethod: name of: type numArgs: nargs
+    | methods |
+
+    methods := Set new.
+    type classesDo:[:initialClass | 
+        | class |
+
+        class := initialClass.
+        [ class notNil and:[ class ~~ JavaObject  ] ] whileTrue:[
+            class selectorsAndMethodsDo:[:selector :method |
+                method isJavaMethod ifTrue:[ 
+                    (selector size > name size 
+                        and:[ method numJavaArgs = nargs
+                        and:[ (selector at: name size + 1) == $(
+                        and:[ (selector startsWith: name) ]]])
+                        ifTrue:[ methods add: method ].
+                    ].
+            ].
+        ].
+    ].
+
+    self halt.
+
+    "Created: / 15-05-2014 / 09:39:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+guessTypeOfThis
+    ^ class isNil 
+        ifTrue:[ Type unknown ]
+        ifFalse: [ Type withClass: class ]
+
+    "Created: / 17-05-2014 / 10:52:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-05-2014 / 17:34:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineSimple class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
+
+AbstractJavaCompletionEngineSimple initialize!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__AbstractJavaCompletionEngineTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,29 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+CompletionEngineTests subclass:#AbstractJavaCompletionEngineTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Tests'
+!
+
+!AbstractJavaCompletionEngineTests class methodsFor:'accessing'!
+
+resources
+    ^ Array with: JavaCompletionEngineEnvironmentResource
+
+    "Created: / 22-05-2014 / 17:18:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!AbstractJavaCompletionEngineTests class methodsFor:'queries'!
+
+isAbstract
+    "Return if this class is an abstract class.
+     True is returned here for myself only; false for subclasses.
+     Abstract subclasses must redefine again."
+
+    ^ self == AbstractJavaCompletionEngineTests.
+! !
+
--- a/SmallSense__BaseTestClass.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__BaseTestClass.st	Thu Jun 19 11:33:05 2014 +0100
@@ -6,7 +6,7 @@
 	instanceVariableNames:'u v'
 	classVariableNames:''
 	poolDictionaries:''
-	category:'SmallSense-Tests'
+	category:'SmallSense-Tests-Obsolete'
 !
 
 
@@ -43,6 +43,11 @@
 
 !BaseTestClass class methodsFor:'documentation'!
 
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
 version_SVN
     ^ '$Id: SmallSense__BaseTestClass.st,v 1.2 2014/02/12 14:49:29 sr Exp $'
 ! !
--- a/SmallSense__ClassPO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__ClassPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 PO subclass:#ClassPO
-	instanceVariableNames:'showPrefix'
+	instanceVariableNames:'showPrefix klass icon'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-PO'
@@ -12,103 +12,122 @@
 
 !ClassPO methodsFor:'accessing'!
 
+hint
+    | namespace |
+
+    namespace := nil.
+    showPrefix ifFalse:[
+	namespace := klass isJavaClass
+			ifTrue:[klass javaPackage]
+			ifFalse:[klass nameSpace name].
+	(namespace notNil and:[namespace ~~ #Smalltalk]) ifTrue:[
+	    ^ 'in ', namespace.
+	].
+    ].
+    ^ nil
+
+    "Created: / 20-05-2014 / 12:21:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 icon
 
-    icon ifNil:[icon := SystemBrowser iconForClass: subject].
+    icon ifNil:[icon := SystemBrowser iconForClass: klass].
     ^icon
 
     "Created: / 06-04-2011 / 23:36:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 klass
-    ^ subject
+    ^ klass
 
     "Created: / 25-08-2013 / 13:07:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-klass: klass
-    ^ subject := klass
+klass: aClass
+    ^ klass := aClass
 
     "Created: / 25-08-2013 / 13:07:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 10:05:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-name
-
-    | nm |
+label
+    label isNil ifTrue:[
+	showPrefix ifTrue:[
+	    label := klass name.
+	    (context notNil and:[klass isJavaClass]) ifTrue:[
+		context language isJava ifTrue:[
+		    label := klass javaName
+		] ifFalse:[
+		    context language isSmalltalk ifTrue:[
+		       label := 'JAVA ' , (klass  binaryName copyReplaceAll: $/ with: Character space)
+		     ]
+		]
+	    ].
+	] ifFalse:[
+	    label := klass nameWithoutPrefix.
+	].
+    ].
 
-    showPrefix ifTrue:[
-        nm := subject name.
-        (context notNil and:[subject isJavaClass]) ifTrue:[
-            context language isJava ifTrue:[
-                nm := subject javaName
-            ] ifFalse:[
-                context language isSmalltalk ifTrue:[
-                   nm := 'JAVA ' , (subject  binaryName copyReplaceAll: $/ with: Character space)
-                 ]
-            ]
-        ].
-    ] ifFalse:[
-        nm := subject nameWithoutPrefix.
-    ].
-    ^nm
+    ^label
 
-    "Created: / 26-08-2013 / 10:26:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 17-12-2013 / 22:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 20-05-2014 / 11:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+
+
 showPrefix
     ^ showPrefix
 !
 
-showPrefix:something
-    showPrefix := something.
+showPrefix:aBoolean
+    showPrefix := aBoolean.
 !
 
 stringAlreadyWritten
-    "Answers a string already written in the textview"    
+    "Answers a string already written in the textview"
 
-    (subject isJavaClass and:[context language isSmalltalk]) ifTrue:[
-        | rec |
+    klass isJavaClass ifTrue:[
+	context language isSmalltalk ifTrue:[
+	    | rec |
 
-        rec := context node .
-        [ rec isUnaryMessage ] whileTrue:[
-            rec := rec receiver.
-        ].
-        (rec isVariableNode and:['JAVA' startsWith: rec name]) ifTrue:[
-            ^ context codeView contents asString copyFrom: rec startPosition to: context node endPosition
-        ].
+	    rec := context node .
+	    [ rec isUnaryMessage ] whileTrue:[
+		rec := rec receiver.
+	    ].
+	    (rec isVariableNode and:['JAVA' startsWith: rec name]) ifTrue:[
+		^ context codeView contents asString copyFrom: rec startPosition to: context node endPosition
+	    ].
+	] ifFalse:[
+	context language isJavaLike ifTrue:[
+	     ^ context wordBeforeCursorConsisitingOfCharactersMatching:[:c | c isAlphaNumeric or:['$_.' includes: c] ]
+	]].
     ].
     ^ super stringAlreadyWritten
 
     "Created: / 20-10-2013 / 02:46:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 07:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 stringToCompleteForLanguage: language
-    ^ (subject isJavaClass and:[language isSmalltalk]) ifTrue:[
-        'JAVA ', (subject binaryName copyReplaceAll: $/ with: Character space)
+    ^ (klass isJavaClass and:[language isSmalltalk]) ifTrue:[
+	'JAVA ', (klass binaryName copyReplaceAll: $/ with: Character space)
     ] ifFalse:[
-        super stringToCompleteForLanguage: language
+	self label
     ].
 
     "Created: / 03-10-2013 / 16:42:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-10-2013 / 02:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:41:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-subject: aClass
-
-    super subject: aClass.
-
-    "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'!
 
 asString
-    ^subject isJavaClass ifTrue:[
-        subject javaName
+    ^klass isJavaClass ifTrue:[
+	klass javaName
     ] ifFalse:[
-        subject name
+	klass name
     ].
 
     "Created: / 04-04-2012 / 13:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -117,41 +136,9 @@
 
 !ClassPO methodsFor:'displaying'!
 
-displayLabel:aLabel h:lH on:aGC x:x y:y h:h
-    | namespace y0 lw cnw fg |
 
-    super displayLabel:aLabel h:lH on:aGC x:x y:y h:h.
-
-    showPrefix ifFalse:[
-        namespace := subject isJavaClass 
-                        ifFalse:[subject  nameSpace name]
-                        ifTrue:[subject javaPackage].
-        (namespace notNil and:[namespace ~~ #Smalltalk]) ifTrue:[
-            namespace := 'in ', namespace.
-            lw :=  x + (parent isNil ifTrue:[IconWidth] ifFalse:[0]) + (aLabel widthOn: aGC).
-            y0 := y - (lH + 1 - h // 2).
-            y0 := y0 + (namespace ascentOn:aGC). 
-            cnw := aGC widthOfString: namespace.
 
-            (aGC width > (lw + cnw + 5)) ifTrue:[
-                fg := aGC paint.
-                aGC paint: (Color gray: 40).
-                namespace displayOn:aGC x: aGC width - cnw - 5 y:y0.
-                aGC paint: fg.
-            ]
-        ]
-    ]
-
-    "Created: / 18-09-2013 / 00:17:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 28-04-2014 / 00:24:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-displayString
-    ^ self name
-
-    "Created: / 20-04-2012 / 18:19:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 26-08-2013 / 10:27:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
+ !
 
 !ClassPO methodsFor:'initialization'!
 
@@ -161,10 +148,18 @@
     "/ please change as required (and remove this comment)
     "/ showPrefix := nil.
 
-    super initialize.  
+    super initialize.
     showPrefix := false.
 
     "Modified: / 20-10-2013 / 02:38:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+initializeWithClass: aClass
+
+    klass := aClass.
+    showPrefix := false.
+
+    "Created: / 20-05-2014 / 09:56:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ClassPO methodsFor:'testing'!
@@ -183,4 +178,3 @@
 version_SVN
     ^ '$Id: SmallSense__ClassPO.st,v 1.2 2014/02/12 14:49:29 sr Exp $'
 ! !
-
--- a/SmallSense__CompletionContext.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__CompletionContext.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 Object subclass:#CompletionContext
-	instanceVariableNames:'node position support'
+	instanceVariableNames:'environment node position support'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core'
@@ -27,6 +27,22 @@
     "Modified: / 21-01-2014 / 23:16:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+environment
+    "Return an system environment for completion."
+
+    ^ environment
+
+    "Modified (comment): / 13-05-2014 / 11:54:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+environment:aSystemEnvironment
+    "Sets an envirronment for completion. Only classes and/or methods in
+     the environment are offered for completion"
+    environment := aSystemEnvironment.
+
+    "Modified (comment): / 13-05-2014 / 11:55:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 language
     ^ support language
 
--- a/SmallSense__CompletionController.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__CompletionController.st	Thu Jun 19 11:33:05 2014 +0100
@@ -18,15 +18,26 @@
     ^ self basicNew initialize.
 ! !
 
-!CompletionController class methodsFor:'testing'!
+!CompletionController methodsFor:'accessing'!
+
+completionEngine
+    | engineClass |
 
-isAbstract
-    ^ false
+    engineClass := self completionEngineClass.
+    ^ engineClass notNil 
+        ifTrue:[ engineClass new ]
+        ifFalse:[ nil ].
 
-    "Created: / 17-10-2013 / 00:29:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
+    "Created: / 18-05-2014 / 11:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
 
-!CompletionController methodsFor:'accessing'!
+environment
+    ^ support notNil 
+        ifTrue:[support environment]
+        ifFalse:[Smalltalk].
+
+    "Created: / 18-05-2014 / 11:53:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
 
 support
     ^ support
@@ -36,6 +47,16 @@
     support := anEditSupport.
 ! !
 
+!CompletionController methodsFor:'accessing-classes'!
+
+completionEngineClass
+    ^ support notNil 
+        ifTrue:[ support completionEngineClass ]
+        ifFalse:[ nil ].
+
+    "Created: / 18-05-2014 / 11:55:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !CompletionController methodsFor:'events'!
 
 handleKeyPress:key x:x y:y
@@ -72,21 +93,24 @@
             ^ true
         ].
         key isCharacter ifTrue:[
-            self updateSelection.
+            (self updateSelectionAfterKeyPress: key) ifTrue:[ 
+                ^ true
+            ].
         ].
     ].
     ^ super handleKeyPress:key x:x y:y
 
     "Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 31-03-2014 / 22:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-06-2014 / 10:17:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 handleKeyPressTab
     "Tab has been pressed, try to complete longest common prefix"
 
-    | prefix matching longest minlen |
+    | first prefix matching longest minlen |
 
-    prefix := support wordBeforeCursor string.                                        
+    first := completionView list first.
+    prefix := self prefixAlreadyWritten.
     matching := OrderedCollection new.
     minlen := SmallInteger maxVal.
     completionView list do:[:po |
@@ -131,6 +155,7 @@
     editView insertStringAtCursor:(longest copyFrom: prefix size + 1).
 
     "Created: / 31-03-2014 / 22:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2014 / 13:55:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 postKeyPress:key
@@ -151,6 +176,10 @@
 
     key isCharacter ifTrue:[
         key isLetterOrDigit not ifTrue:[
+            "/ Hack for Java - should be delegated to completion engine    
+            (key == $. and:[support notNil and:[ support language isJavaLike ]]) ifTrue:[ 
+                ^ self
+            ].
             self closeCompletionView
         ] ifFalse:[
             | c |
@@ -168,7 +197,7 @@
     ].
 
     "Created: / 28-09-2013 / 00:21:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 11-04-2014 / 16:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2014 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CompletionController methodsFor:'initialization'!
@@ -202,6 +231,23 @@
     "Created: / 31-03-2014 / 23:21:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+prefixAlreadyWritten
+    | list first |
+
+    completionView notNil ifTrue:[ 
+        list := completionView list.
+        list notEmptyOrNil ifTrue:[ 
+            first := list first.
+            (completionView list allSatisfy:[:e | e class == first class ]) ifTrue:[ 
+                first stringAlreadyWritten 
+            ]
+        ]
+    ].
+    ^ support wordBeforeCursor string .
+
+    "Created: / 18-05-2014 / 13:55:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 stopCompletionProcess
     "kill any background completion process"
 
@@ -226,17 +272,34 @@
 !
 
 updateSelection
-    "Updates selection in completion view based on
-     currently typed partial text. Return true if
-     the complection window should be closed or false
-     if it shall be kept open."
+    "Updates selection in completion view based on currently typed partial 
+     text. Return true if the complection window should be closed or false
+     if it shall be kept open. "
+
+    ^ self updateSelectionAfterKeyPress: nil
+
+    "Created: / 27-09-2013 / 16:16:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 17-06-2014 / 07:24:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateSelectionAfterKeyPress: keyOrNil
+    "Updates selection in completion view based on currently typed partial 
+     text. Return true if the complection window should be closed or false
+     if it shall be kept open.
+
+     If `keyOrNil` is not nil, then it's a key press that triggered the update
+     which HAS NOT YET been processed by a `editView`.
+     "
 
     | list prefix matcher1 matches1 matcher2 matches2 |
 
     list := completionView list.
     matcher1 := CompletionEngine exactMatcher.
     matcher2 := CompletionEngine inexactMatcher.
-    prefix := support wordBeforeCursor.
+    prefix := self prefixAlreadyWritten.
+    keyOrNil isCharacter ifTrue:[ 
+        prefix := prefix , keyOrNil
+    ].
 
     matches1 := list select:[:po | matcher1 value: prefix value: po stringToComplete ].
     matches1 notEmptyOrNil ifTrue:[
@@ -278,8 +341,7 @@
     ].
     ^ false.
 
-    "Created: / 27-09-2013 / 16:16:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 08-04-2014 / 21:32:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 17-06-2014 / 07:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CompletionController methodsFor:'private-API'!
@@ -311,14 +373,36 @@
     "/ This also reduces CPU consumption by avoiding
     "/ useless computation
     Delay waitForMilliseconds: 200. 
-"/    self updateCompletions: support computeCompletion
-    completions := support computeCompletion.
+
+    completions := self computeCompletionsInContext.
     completions notEmptyOrNil ifTrue:[
         editView sensor pushUserEvent: #updateCompletions:sequence: for: self withArguments: (Array with: completions with: seqno)
     ].
 
     "Created: / 27-09-2013 / 13:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 03-10-2013 / 07:17:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2014 / 11:50:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+computeCompletionsInContext
+    | context |
+
+    context := CompletionContext new.
+    context environment: self environment.
+    context support: support.
+    ^self computeCompletionsInContext: context.
+
+    "Created: / 18-05-2014 / 11:50:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+computeCompletionsInContext: aCompletionContext
+    | engine |
+
+    engine := self completionEngine.
+    ^engine notNil 
+        ifTrue:[ engine complete: aCompletionContext ]
+        ifFalse:[ nil ]
+
+    "Created: / 18-05-2014 / 11:53:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 openCompletionView
@@ -337,7 +421,7 @@
     list = #( 'Busy...' ) ifTrue:[ ^ self ].  
 
     x := (editView xOfCol:editView cursorCol  inVisibleLine:editView cursorLine)
-            - 16"icon" - (editView widthOfString:  support wordBeforeCursor) - 5"magic constant".
+            - 16"icon" - (editView widthOfString:  "support wordBeforeCursor"list first stringAlreadyWritten) - 5"magic constant".
     y := editView yOfCursor + editView font maxHeight + 3.
     movePos := (editView originRelativeTo: nil) + (x @ y).
 
@@ -370,7 +454,7 @@
     ].
 
     "Created: / 27-09-2013 / 14:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-02-2014 / 10:13:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 11:30:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateCompletions: completionResult sequence: sequence
--- a/SmallSense__CompletionEngine.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__CompletionEngine.st	Thu Jun 19 11:33:05 2014 +0100
@@ -24,9 +24,9 @@
     "Return a match block returning true, if given prefix matches given selector"
 
     ^ [ :prefix :selector |
-        prefix size < 5 ifTrue:[ 
-            selector startsWith: prefix.  
-        ] ifFalse:[ 
+        prefix size < 5 ifTrue:[
+            selector startsWith: prefix.
+        ] ifFalse:[
             | part |
 
             part := selector copyTo: (prefix size min: selector size).
@@ -41,9 +41,9 @@
     "Return a match block returning true, if given prefix matches given selector"
 
     ^ [ :prefix :selector |
-        prefix size < 5 ifTrue:[ 
-            selector startsWith: prefix.  
-        ] ifFalse:[ 
+        prefix size < 5 ifTrue:[
+            selector startsWith: prefix.
+        ] ifFalse:[
             | part |
 
             part := selector copyTo: (prefix size min: selector size).
@@ -75,19 +75,6 @@
     ^ self complete.
 
     "Created: / 21-01-2014 / 23:07:47 / 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.
-    result := CompletionResult new.
-
-    ^ self complete.
-
-    "Created: / 02-10-2013 / 13:24:43 / 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'!
@@ -99,7 +86,7 @@
     "Modified: / 08-04-2014 / 21:36:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-addMethodsStartingWith: prefix stripOff: stripoffPrefix 
+addMethodsStartingWith: prefix stripOff: stripoffPrefix
     ^ self addMethodsStartingWith: prefix stripOff: stripoffPrefix filter: nil
 
     "Created: / 08-04-2014 / 21:36:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -118,23 +105,22 @@
     | matchPrefix selectors filter |
 
     selectors := Dictionary new.
-    matchPrefix := stripoffPrefix isNil ifTrue:[ prefix ] ifFalse:[ stripoffPrefix , prefix ]. 
+    matchPrefix := stripoffPrefix isNil ifTrue:[ prefix ] ifFalse:[ stripoffPrefix , prefix ].
     filter := filterOrNil  isNil ifTrue:[ [:method | true ] ] ifFalse:[ filterOrNil  ].
 
-    Smalltalk allClassesDo:[:class|
-        class selectorsAndMethodsDo:[:selector :mthd |             
-            (mthd isSynthetic not and:[(filter value: mthd) and:[ matcher value: matchPrefix value: selector]]) ifTrue:[
-                | class skip |
+    context environment allMethodsWithSelectorDo:[:mthd :selector|
+        (mthd isSynthetic not and:[(filter value: mthd) and:[ matcher value: matchPrefix value: selector]]) ifTrue:[
+                | class overridden |
 
                 class := mthd mclass superclass.
-                skip := false.
-                [ skip not and:[class notNil] ] whileTrue:[
+                overridden := false.
+                [ overridden not and:[class notNil] ] whileTrue:[
                     (class methodDictionary includesKey: selector) ifTrue:[
-                        skip := true.
+                        overridden := true.
                     ].
                     class := class superclass.
                 ].
-                skip ifFalse:[
+                overridden ifFalse:[
                     | classes |
 
                     classes := selectors at: selector ifAbsentPut:[ Set new ].
@@ -143,24 +129,23 @@
                     ].
                 ].
             ]
-        ].
     ].
 
-    selectors keysAndValuesDo: [:selector :classes|
-        result add:(MethodPO 
-                name:selector
-                class:(classes size == 1 ifTrue:[classes anElement] ifFalse:[classes])
-                stripOff: stripoffPrefix)
-    ]
+
+    selectors keysAndValuesDo: [:selector :classes |
+        result add:(PO forClasses: classes selector: selector prefix: stripoffPrefix)
+    ].
+    ^ self
 
     "Created: / 08-04-2014 / 21:34:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-05-2014 / 11:54:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CompletionEngine methodsFor:'completion-private'!
 
 complete
     "Compute completion for `codeView`, taking all the information
-     from it. Returns a CompletionResult with computed completions"        
+     from it. Returns a CompletionResult with computed completions"
 
     ^ self subclassResponsibility
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__CompletionEngineTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,95 @@
+"{ Encoding: utf8 }"
+
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Smalltalk::TestCase subclass:#CompletionEngineTests
+	instanceVariableNames:'engine context result'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Tests'
+!
+
+
+!CompletionEngineTests class methodsFor:'queries'!
+
+isAbstract
+    "Return if this class is an abstract class.
+     True is returned here for myself only; false for subclasses.
+     Abstract subclasses must redefine again."
+
+    ^ self == SmallSense::CompletionEngineTests.
+! !
+
+!CompletionEngineTests methodsFor:'accessing'!
+
+environment
+   ^ Smalltalk
+
+    "Created: / 22-05-2014 / 16:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionEngineTests methodsFor:'accessing-classes'!
+
+completionEngineClass
+    ^ self subclassResponsibility
+
+    "Created: / 22-05-2014 / 16:38:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionEngineTests methodsFor:'running'!
+
+setUp
+    | service support codeView |
+    engine := self completionEngineClass new.
+
+    codeView := Tools::CodeView2 new.
+    service := EditService new.
+    service registerIn: codeView.  
+    support := GenericEditSupport new.
+    service updateSupport: support.  
+    context := CompletionContext new.
+    context support: support.
+    context environment: self environment.
+
+    "Created: / 22-05-2014 / 16:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+tearDown
+    engine := context := nil
+
+    "Created: / 22-05-2014 / 16:51:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionEngineTests methodsFor:'utilities'!
+
+complete: aString
+     | list textView |
+
+    list := aString asStringCollection.
+    textView := context codeView textView.
+    textView list: list.
+    1 to: list size do:[:i |  
+        | line cursorCol |
+
+        line := list at: i.
+        cursorCol := line indexOf: '┃' first.
+        cursorCol ~~ 0 ifTrue:[ 
+            line := (line copyTo: cursorCol - 1) , (line copyFrom: cursorCol + 1).
+            list at: i put: line.
+            textView setCursorLine: i; setCursorCol: cursorCol.
+        ].
+    ].
+    ^ result := engine complete: context
+
+    "Created: / 22-05-2014 / 16:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionEngineTests class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/SmallSense__ConstantPO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__ConstantPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -10,6 +10,25 @@
 !
 
 
+!ConstantPO methodsFor:'accessing'!
+
+label
+    "Return a text to be displayed. The label may be cached
+     `label` instvar."
+
+    ^ '???'
+
+    "Created: / 20-05-2014 / 11:31:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stringToCompleteForLanguage:aProgrammingLanguage
+    "Answers a string to complete"
+
+    ^ '???'
+
+    "Created: / 20-05-2014 / 11:32:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ConstantPO methodsFor:'testing'!
 
 isSmallSenseConstantPO
--- a/SmallSense__EditService.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__EditService.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 Tools::CodeViewService subclass:#EditService
-	instanceVariableNames:'support'
+	instanceVariableNames:'environment support'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Services'
@@ -56,6 +56,28 @@
     "Created: / 27-07-2013 / 22:35:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!EditService methodsFor:'accessing'!
+
+environment
+    "Return an system environment for completion."
+
+    ^ environment ? Smalltalk
+
+    "Modified: / 13-05-2014 / 12:02:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+environment:aSystemEnvironment
+    "Sets an envirronment for completion. Only classes and/or methods in
+     the environment are offered for completion"
+    environment := aSystemEnvironment.
+
+    "Modified (comment): / 13-05-2014 / 11:55:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+support
+    ^ support
+! !
+
 !EditService methodsFor:'accessing-views'!
 
 codeView
@@ -99,12 +121,19 @@
 
     UserPreferences current smallSenseElectricEditSupportEnabled ifTrue:[
         support language ~~ (lang := codeView language) ifTrue:[
-            support := EditSupport forLanguage: lang.
-            support initializeForService: self.
+            self updateSupport: (EditSupport forLanguage: lang).
         ].
     ].
 
     "Created: / 16-09-2013 / 16:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-05-2014 / 14:49:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateSupport: anEditSupport
+    support := anEditSupport.
+    support initializeForService: self.
+
+    "Created: / 13-05-2014 / 14:49:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditService methodsFor:'event handling'!
@@ -126,7 +155,6 @@
 !EditService methodsFor:'registering'!
 
 registerIn: aCodeView
-
     UserPreferences current smallSenseEnabled ifTrue:[
         super registerIn: aCodeView.
         aCodeView languageHolder addDependent: self.
@@ -142,19 +170,19 @@
     ].
 
     "Created: / 24-07-2013 / 23:13:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-02-2014 / 09:45:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-06-2014 / 14:15:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 unregister
-
     "Uninstall myself from my codeView"
 
-    super unregister.
     codeView languageHolder removeDependent: self.
     codeView classHolder    removeDependent: self.
     codeView methodHolder   removeDependent: self.
+    super unregister
 
     "Created: / 24-07-2013 / 23:14:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-06-2014 / 14:17:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditService class methodsFor:'documentation'!
--- a/SmallSense__EditSupport.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__EditSupport.st	Thu Jun 19 11:33:05 2014 +0100
@@ -4,7 +4,8 @@
 
 Object subclass:#EditSupport
 	instanceVariableNames:'service codeView textView backspaceIsUndo completionController
-		snippets ignoreKeystrokes ignoreKeystrokesPosition'
+		completionEnvironment snippets ignoreKeystrokes
+		ignoreKeystrokesPosition'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Services'
@@ -41,6 +42,14 @@
     "Modified: / 03-02-2014 / 23:28:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+environment
+    "raise an error: this method should be implemented (TODO)"
+
+    ^ service environment
+
+    "Created: / 15-05-2014 / 16:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 language
     ^ self subclassResponsibility.
 
@@ -59,6 +68,14 @@
 
 !EditSupport methodsFor:'accessing-classes'!
 
+completionControllerClass
+    "raise an error: this method should be implemented (TODO)"
+
+    ^ CompletionController
+
+    "Created: / 13-05-2014 / 16:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 completionEngineClass
     "Returns a code completion engine class or nil, of 
      no completion is supported"
@@ -250,7 +267,7 @@
     ^false
 
     "Created: / 24-07-2013 / 23:31:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 20-01-2014 / 09:20:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-05-2014 / 21:22:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressIgnored: key
@@ -285,16 +302,17 @@
 !EditSupport methodsFor:'initialization'!
 
 initializeCompletion
+    | controller |
+
     UserPreferences current smallSenseCompletionEnabled ifTrue:[
-        self completionEngineClass  notNil ifTrue:[
-            completionController := CompletionController for: service textView.
-            completionController support: self.
-            service textView completionSupport: completionController.
+        self completionEngineClass notNil ifTrue:[
+            controller := self completionControllerClass for: service textView.
+            controller support: self.
+            service textView completionSupport: controller.
         ].
     ].
 
-    "Created: / 27-09-2013 / 13:20:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-02-2014 / 09:30:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 18-05-2014 / 12:40:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializeForService:aSmallSenseService
@@ -333,7 +351,7 @@
 
 wordBeforeCursorConsisitingOfCharactersMatching: characterMatchBlock
     |  currentLine wordStart wordEnd |
-    currentLine := textView list at: textView cursorLine.
+    currentLine := textView list at: textView cursorLine ifAbsent:[ ^ '' ].
     currentLine isNil ifTrue:[ ^ '' ].
     wordEnd := textView cursorCol - 1.
     wordEnd > currentLine size ifTrue:[ ^ '' ].
@@ -350,34 +368,7 @@
     ^ ''
 
     "Created: / 31-03-2014 / 23:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 01-04-2014 / 18:00:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!EditSupport methodsFor:'private-completion'!
-
-computeCompletion
-    | completionEngineClass codeView result |
-
-    completionEngineClass := self completionEngineClass.
-    completionEngineClass isNil ifTrue: [ ^ nil ].
-
-    codeView := service codeView.
-    UserInformation 
-        handle: [:ex | 
-            codeView showInfo: (ex messageText).
-            ex proceed.
-        ]
-        do: [
-            | context |
-
-            context := CompletionContext new.
-            context support: self.
-            result := completionEngineClass new complete: context
-        ].
-    ^ result.
-
-    "Created: / 27-09-2013 / 13:21:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-01-2014 / 23:17:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-06-2014 / 07:27:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditSupport methodsFor:'private-scanning'!
--- a/SmallSense__FinderTests.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__FinderTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -6,7 +6,7 @@
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
-	category:'SmallSense-Tests'
+	category:'SmallSense-Tests-Obsolete'
 !
 
 
--- a/SmallSense__GroovyCompletionEngineSimple.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__GroovyCompletionEngineSimple.st	Thu Jun 19 11:33:05 2014 +0100
@@ -10,14 +10,59 @@
 !
 
 
-!GroovyCompletionEngineSimple methodsFor:'completion-private'!
+!GroovyCompletionEngineSimple class methodsFor:'accessing-definitions'!
+
+patternDefinitionsForAnalysis
+    ^ super patternDefinitionsForAnalysis , { 
+        #analyzeLocalDef1:              .  '[[:def:]] [[:Identifier:]] ( = | ; )' .
+    }
+
+    "
+    self flush; patternsForAnalysis
+    "
+
+    "Created: / 23-05-2014 / 10:24:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+patternDefinitionsForCompletion
+    
+    ^super patternDefinitionsForCompletion , { 
+        #completeLocalDef:              . '( ', PatternPrimitiveType , ' | ' , PatternReferenceType , ' | [[:def:]] ) [[:Identifier:]] [[:CARET:]]' .
+    }
+
+    "
+    self flush.
+    self patternsForCompletion
+    "
 
-complete
-    super complete.
-    ^ result.
+    "Created: / 19-05-2014 / 12:32:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovyCompletionEngineSimple methodsFor:'accessing-class'!
+
+scannerClass
+    "raise an error: this method should be implemented (TODO)"
+
+    ^ GroovyScanner
+
+    "Created: / 13-05-2014 / 17:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
-    "Created: / 17-10-2013 / 00:39:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 03-02-2014 / 23:32:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!GroovyCompletionEngineSimple methodsFor:'analysis'!
+
+analyzeLocalDef1: match
+    "Analyze:
+
+    def <identifier> ;
+
+    "
+    | name |
+
+    self assert: match size = 3.
+    name := (match at: match size - 1) value.
+    locals at: name put: nil.
+
+    "Created: / 23-05-2014 / 10:26:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !GroovyCompletionEngineSimple class methodsFor:'documentation'!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__GroovyCompletionEngineSimpleTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,401 @@
+"{ Encoding: utf8 }"
+
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+AbstractJavaCompletionEngineTests subclass:#GroovyCompletionEngineSimpleTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Tests'
+!
+
+!GroovyCompletionEngineSimpleTests methodsFor:'accessing-classes'!
+
+completionEngineClass
+    ^ GroovyCompletionEngineSimple
+
+    "Created: / 22-05-2014 / 16:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovyCompletionEngineSimpleTests methodsFor:'tests - analysis'!
+
+test_analyze_01a
+
+    self complete:'import java.util.Array;┃'.
+
+    self assert: (engine instVarNamed: #imports) size == 1.
+    self assert: (engine instVarNamed: #imports) first = 'java.util.Array'
+
+    "Created: / 22-05-2014 / 17:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_01b
+
+    self complete:'import java.util.*;┃'.
+
+    self assert: (engine instVarNamed: #imports) size == 1.
+    self assert: (engine instVarNamed: #imports) first = 'java.util.*'
+
+    "Created: / 22-05-2014 / 17:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_01c
+
+    self complete:'import java.util.*;
+                   import java.lang.reflect.Field;┃'.
+
+    self assert: (engine instVarNamed: #imports) size == 2.
+    self assert: (engine instVarNamed: #imports) first = 'java.util.*'.
+    self assert: (engine instVarNamed: #imports) second = 'java.lang.reflect.Field'.
+
+    "Created: / 22-05-2014 / 17:09:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_boolean
+
+    self complete:'boolean  var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'boolean' .
+
+    "Created: / 23-05-2014 / 09:24:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_byte
+
+    self complete:'byte var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'byte' .
+
+    "Created: / 23-05-2014 / 09:23:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_char
+
+    self complete:'char  var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'char' .
+
+    "Created: / 23-05-2014 / 09:24:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_def
+
+    self complete:'def var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') isNil .
+
+    "Created: / 23-05-2014 / 09:26:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_double
+
+    self complete:'double  var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'double' .
+
+    "Created: / 23-05-2014 / 09:24:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_float
+
+    self complete:'float  var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'float' .
+
+    "Created: / 23-05-2014 / 09:24:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_int_1
+
+    self complete:'int var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'int' .
+
+    "Created: / 23-05-2014 / 09:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_int_2
+
+    self complete:'int var = 10; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'int' .
+
+    "Created: / 23-05-2014 / 09:22:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_long
+
+    self complete:'long var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'long' .
+
+    "Created: / 23-05-2014 / 09:23:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_ref_full
+
+    self complete:'java.util.ArrayList var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'java.util.ArrayList' .
+
+    "Created: / 23-05-2014 / 09:27:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_ref_short
+
+    self complete:'ArrayList var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'ArrayList' .
+
+    "Created: / 23-05-2014 / 09:26:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_02_short
+
+    self complete:'short var; ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 1.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var') .
+    self assert: ((engine instVarNamed: #locals) at: 'var') = 'short' .
+
+    "Created: / 23-05-2014 / 09:23:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_analyze_03a
+
+    self complete:' int var1; 
+                    def var2 = var1 + ┃'.
+
+    self assert: (engine instVarNamed: #locals) size == 2.
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var1') .
+    self assert: ((engine instVarNamed: #locals) at: 'var1') = 'int' .
+
+    self assert: ((engine instVarNamed: #locals) includesKey: 'var2') .
+    self assert: ((engine instVarNamed: #locals) at: 'var2') = nil .
+
+    "Created: / 23-05-2014 / 10:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GroovyCompletionEngineSimpleTests methodsFor:'tests - completion'!
+
+test_complete_01a
+
+    self complete:'import java.uti┃'.
+
+    self assert: result notEmpty.
+    self assert: (result allSatisfy:[:each | each class == JavaImportPO ]).
+    self assert: (result contains:[:each | each import = 'java.util.*' ]).
+    self assert: (result contains:[:each | each import = 'java.util.zip.*' ]).
+    self assert: (result contains:[:each | each import = 'java.util.ArrayList' ]).
+
+    "Created: / 22-05-2014 / 17:28:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_02a
+
+    self complete:'im┃'.
+
+    self assert: result notEmpty.
+    self assert: (result contains:[:each | each isSmallSenseSnippetPO and:[each value = 'import '] ]).
+
+    "Created: / 22-05-2014 / 17:33:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_03a
+    "
+    Test variable completion"
+
+    self complete:'int  ival = 10;
+                   List ilist = new ArrayList();
+                   il┃'.
+
+    self assert: result size >= 2.
+    self assert: (result contains:[:each | each isSmallSenseVariablePO and:[each name = 'ilist']]).
+    self assert: (result contains:[:each | each isSmallSenseVariablePO and:[each name = 'ival']]) .
+
+    "Created: / 23-05-2014 / 10:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_03b
+    "
+    Test variable completion"
+
+    self complete:'int  ival = 10;
+                   List ilist = new ArrayList();
+                   i┃'.
+
+    self assert: result size >= 2.
+    self assert: (result contains:[:each | each isSmallSenseVariablePO and:[each name = 'ilist'] ]).
+    self assert: (result contains:[:each | each isSmallSenseVariablePO and:[each name = 'ival'] ]).
+
+    "Created: / 23-05-2014 / 10:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_03c
+    "
+    Test variable completion"
+
+    self complete:'int  ival = 10;
+                   List ilist = new ArrayList();
+                   ilist.add( i┃ )'.
+
+    self assert: result size >= 2.
+    self assert: (result contains:[:each | each isSmallSenseVariablePO and:[each name = 'ilist'] ]).
+    self assert: (result contains:[:each | each isSmallSenseVariablePO and:[each name = 'ival'] ]).
+
+    "Created: / 23-05-2014 / 10:38:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_03d
+    "
+    Test pseudo-variable completion"
+
+    self complete:'th┃'.
+
+    self assert: result size >= 1.
+    self assert: (result contains:[:each | each isSmallSenseSnippetPO and:[each value = 'this '] ]).
+
+    "Created: / 23-05-2014 / 10:39:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_04a
+    "
+    Test class completion
+    "
+
+    | java_lang_ArrayList ctors pos |
+
+    self complete:'def list = new Arr┃'.
+
+    java_lang_ArrayList := context environment == Smalltalk 
+                            ifTrue:[ context environment classNamed: #'JAVA::java::util::ArrayList'  ]
+                            ifFalse:[ context environment classNamed: #'java/util/ArrayList'].
+    ctors := java_lang_ArrayList methodDictionary values select:[:e | e selector startsWith: '<init>' ].
+    pos := result select:[:each | each class == JavaConstructorPO and:[ each classes anElement == java_lang_ArrayList ] ].
+
+    self assert: result size >= ctors size.
+    ctors do:[:ctor |  
+        self assert: (pos contains:[:po | po selector == ctor selector ]).
+    ].
+
+    "Created: / 23-05-2014 / 11:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_04b
+    "
+    Test class completion
+    "
+
+    | java_lang_ArrayList ctors pos |
+
+    self complete:'def list = new java.util.Arr┃'.
+
+    java_lang_ArrayList := context environment == Smalltalk 
+                            ifTrue:[ context environment classNamed: #'JAVA::java::util::ArrayList'  ]
+                            ifFalse:[ context environment classNamed: #'java/util/ArrayList'].
+    ctors := java_lang_ArrayList methodDictionary values select:[:e | e selector startsWith: '<init>' ].
+    pos := result select:[:each | each class == JavaConstructorPO and:[ each classes anElement == java_lang_ArrayList ] ].
+
+    self assert: result size >= ctors size.
+    ctors do:[:ctor |  
+        self assert: (pos contains:[:po | po selector == ctor selector ]).
+    ].
+
+    "Created: / 23-05-2014 / 11:32:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_04c
+    "
+    Test class completion
+    "
+
+    | java_lang_ArrayList ctors pos |
+
+    self complete:'def list = new java.util.┃'.
+
+    java_lang_ArrayList := context environment == Smalltalk 
+                            ifTrue:[ context environment classNamed: #'JAVA::java::util::ArrayList'  ]
+                            ifFalse:[ context environment classNamed: #'java/util/ArrayList'].
+    ctors := java_lang_ArrayList methodDictionary values select:[:e | e selector startsWith: '<init>' ].
+    pos := result select:[:each | each class == JavaConstructorPO and:[ each classes anElement == java_lang_ArrayList ] ].
+
+    self assert: result size >= ctors size.
+    ctors do:[:ctor |  
+        self assert: (pos contains:[:po | po selector == ctor selector ]).
+    ].
+
+    "Created: / 23-05-2014 / 11:33:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_04d
+    "
+    Test class completion
+    "
+
+    | java_lang_ArrayList ctors pos |
+
+    self complete:'def list = new java.ut┃'.
+
+    java_lang_ArrayList := context environment == Smalltalk 
+                            ifTrue:[ context environment classNamed: #'JAVA::java::util::ArrayList'  ]
+                            ifFalse:[ context environment classNamed: #'java/util/ArrayList'].
+    ctors := java_lang_ArrayList methodDictionary values select:[:e | e selector startsWith: '<init>' ].
+    pos := result select:[:each | each class == JavaConstructorPO and:[ each classes anElement == java_lang_ArrayList ] ].
+
+    self assert: result size >= ctors size.
+    ctors do:[:ctor |  
+        self assert: (pos contains:[:po | po selector == ctor selector ]).
+    ].
+
+    "Created: / 23-05-2014 / 11:41:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_complete_05a
+    "
+    Test method completion
+    "
+
+    | java_lang_ArrayList methods pos |
+
+    self complete:'def list = new java.util.ArrayList();
+                   list.addA┃'.
+
+    java_lang_ArrayList := context environment == Smalltalk 
+                            ifTrue:[ context environment classNamed: #'JAVA::java::util::ArrayList'  ]
+                            ifFalse:[ context environment classNamed: #'java/util/ArrayList'].
+
+    methods := java_lang_ArrayList methodDictionary values select:[:e | e selector startsWith: 'addA' ].
+    pos := result select:[:each | each isSmallSenseMethodPO and:[ each selector startsWith: 'addA' ] ].
+
+    self assert: result size >= methods size.
+    methods do:[:method |  
+        self assert: (pos contains:[:po | po selector == method selector ]).
+    ].
+
+    "Created: / 23-05-2014 / 11:43:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__JavaCompletionEngine.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,144 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+AbstractJavaCompletionEngine subclass:#JavaCompletionEngine
+	instanceVariableNames:'classTree methodTree'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Java'
+!
+
+!JavaCompletionEngine methodsFor:'completion'!
+
+completeNode: node
+    Transcript 
+        show: 'Java Simple Completion on node: ';
+        show: node printString;
+        show: ' [';
+        show: node class printString;
+        showCR: ']'.
+
+    "Created: / 20-10-2013 / 01:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaCompletionEngine methodsFor:'completion-individual'!
+
+addFieldsStartingWith: prefix
+    | klass |
+
+    classTree notNil ifTrue:[
+        (classTree fields ? #()) do:[:field |
+            result add: (VariablePO instanceVariable: field name in: class).            
+        ].
+    ] ifFalse:[
+        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>"
+    "Modified: / 20-10-2013 / 02:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addImportsStartingWith: prefix
+    | packages |
+
+    packages := Set new.
+
+    "/ Class imports...
+    self javaClassesDo:[:cls|
+        | name i |
+
+        name := cls javaName.
+        (cls isPublic and:[name startsWith: prefix]) ifTrue:[
+            result add: (JavaImportPO new subject: name; klass: cls; yourself).        
+            packages add: cls javaPackage.
+        ].
+    ].
+    "/ Package imports...
+    packages do:[:each |
+        result add: (JavaImportPO new subject: (each , '.*'))
+    ].
+
+    "Created: / 19-10-2013 / 17:54:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-10-2013 / 00:35:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addLocalsStartingWith: prefix
+    | queue |
+
+    methodTree isNil ifTrue:[ ^ self ].
+    methodTree scope isNil ifTrue:[ ^ self ].
+
+    queue := OrderedCollection with: methodTree scope.
+    [ queue notEmpty ] whileTrue:[
+        | scope |
+
+        scope := queue removeFirst.
+        1 to: scope localIndex do:[:i|
+            | nm |
+
+            nm := (scope locals at: i) name.
+            (nm startsWith: prefix) ifTrue:[
+                result add: (VariablePO instanceVariable: nm in: class). 
+            ].
+        ].
+    ].
+
+    "Created: / 03-10-2013 / 17:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-10-2013 / 02:15:51 / 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 stripOff: nil filter: [:m | m isJavaMethod ]
+
+    "Created: / 03-10-2013 / 18:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 08-04-2014 / 21:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaCompletionEngine methodsFor:'completion-private'!
+
+complete
+    
+    | position entry node |
+
+    position := context codeView characterPositionOfCursor.
+    codeView syntaxElements notEmptyOrNil ifTrue:[
+        entry := codeView syntaxElements atCharacterPosition: position - 1. 
+        entry notNil ifTrue:[
+            node := entry node
+        ].
+        codeView syntaxElements tree notNil ifTrue:[
+            classTree := (codeView syntaxElements tree types ? #()) detect:[:t | (position - 1) between: t declarationSourceStart and: t declarationSourceEnd ] ifNone:[nil].
+            classTree notNil ifTrue:[
+                methodTree := (classTree methods ? #()) detect:[:m | (position - 1) between: m declarationSourceStart and: m declarationSourceEnd ] ifNone:[nil].
+            ]
+        ].
+    ].
+
+    context node: node position: position.
+
+    node isNil ifTrue:[
+        result := JavaCompletionEngineSimple new complete: context.
+    ] ifFalse:[
+        self completeNode: node.
+    ].
+
+    ^ result
+
+    "Created: / 02-10-2013 / 13:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-05-2014 / 17:21:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__JavaCompletionEngineEnvironmentResource.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,39 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+TestResource subclass:#JavaCompletionEngineEnvironmentResource
+	instanceVariableNames:'booted'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Tests'
+!
+
+!JavaCompletionEngineEnvironmentResource methodsFor:'running'!
+
+setUp
+    JavaVM isNil ifTrue:[ 
+        self signalInitializationError.
+    ].
+    
+    booted := JavaVM booted.
+
+    JavaVM booted ifFalse:[ 
+        [
+            JavaVM boot.                            
+        ] on: Error do:[:ex | 
+            self signalInitializationError.
+        ].
+    ].
+
+    "Created: / 22-05-2014 / 17:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+tearDown
+    booted ifFalse:[ 
+        Java flushAllJavaResources
+    ].
+
+    "Created: / 22-05-2014 / 17:21:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/SmallSense__JavaCompletionEngineSimple.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__JavaCompletionEngineSimple.st	Thu Jun 19 11:33:05 2014 +0100
@@ -2,291 +2,51 @@
 
 "{ NameSpace: SmallSense }"
 
-CompletionEngine subclass:#JavaCompletionEngineSimple
-	instanceVariableNames:'class classTree method methodTree'
+AbstractJavaCompletionEngineSimple subclass:#JavaCompletionEngineSimple
+	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Java'
 !
 
 
+!JavaCompletionEngineSimple methodsFor:'accessing-class'!
+
+scannerClass
+    "raise an error: this method should be implemented (TODO)"
+
+    ^ JavaScanner
+
+    "Created: / 13-05-2014 / 17:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !JavaCompletionEngineSimple methodsFor:'completion'!
 
-completeNode: node
-    Transcript 
-        show: 'Java Simple Completion on node: ';
-        show: node printString;
-        show: ' [';
-        show: node class printString;
-        showCR: ']'.
-
-    "Created: / 20-10-2013 / 01:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-completeSimple
-    | line col scanner token tokens values startPositions stopPositions 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.
-    startPositions := OrderedCollection new.
-    stopPositions := OrderedCollection new.
-    [
-        [ (token := scanner nextToken) ~~ #EOF and:[ scanner tokenStartPosition < (col - 1) ] ] whileTrue:[
-            tokens add: token.
-            values add: scanner tokenValue.
-            startPositions add: scanner tokenStartPosition.
-            stopPositions add: scanner tokenEndPosition. 
-        ].
-    ] on: Error do:[ 
-        ^ nil 
-    ].
-
-    tokens isEmpty ifTrue:[ ^ nil ].
-    "/ now, simple check for import declaration
-    tokens first == #import and:[
-        | prefix |
-
-        prefix := String streamContents:[:s|
-            | i |
-
-            i := 2.
-            [ i <= tokens size ] whileTrue:[
-                (tokens at: i) == #Identifier ifTrue:[
-                    s nextPutAll: (values at: i).
-                ] ifFalse:[
-                    ^ nil "/ malformed import
-                ].
-                (i < tokens size) ifTrue:[
-                    (tokens at: i + 1) == $. ifTrue:[
-                        s nextPut: $.
-                    ] ifFalse:[
-                        ^ nil "/ malformed import
-                    ].
-                ].
-                i := i + 2.
-            ].
-        ].
-        self addImportsStartingWith: prefix.
-        ^ result.
-    ].
-
-    "/ We need at least three characters to complete methods/fields.
-    (tokens last ~~ #Identifier or:[values last size < 3]) ifTrue:[ ^ nil ].
-
-    "/ Complete after new keyword
-    (tokens size > 1 and:[(tokens at: tokens size - 1) == #new]) ifTrue:[
-        self addClassesStartingWith: values last.
-        ^ result.
-    ].
 
 
-    "/ 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: / 20-10-2013 / 01:32:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
+ !
 
 !JavaCompletionEngineSimple methodsFor:'completion-helpers'!
 
-javaClassesDo: 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: / 04-10-2013 / 13:10:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
+ !
 
 !JavaCompletionEngineSimple methodsFor:'completion-individual'!
 
-addClassesStartingWith: prefix
-    self javaClassesDo:[:cls|
-        | name i |
 
-        name := cls lastName.
-        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: / 20-10-2013 / 01:27:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addFieldsStartingWith: prefix
-    | klass |
 
-    classTree notNil ifTrue:[
-        (classTree fields ? #()) do:[:field |
-            result add: (VariablePO instanceVariable: field name in: class).            
-        ].
-    ] ifFalse:[
-        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>"
-    "Modified: / 20-10-2013 / 02:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addImportsStartingWith: prefix
-    | packages |
-
-    packages := Set new.
-
-    "/ Class imports...
-    self javaClassesDo:[:cls|
-        | name i |
 
-        name := cls javaName.
-        (cls isPublic and:[name startsWith: prefix]) ifTrue:[
-            result add: (JavaImportPO new subject: name; klass: cls; yourself).        
-            packages add: cls javaPackage.
-        ].
-    ].
-    "/ Package imports...
-    packages do:[:each |
-        result add: (JavaImportPO new subject: (each , '.*'))
-    ].
 
-    "Created: / 19-10-2013 / 17:54:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-10-2013 / 00:35:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
 
-addLocalsStartingWith: prefix
-    | queue |
-
-    methodTree isNil ifTrue:[ ^ self ].
-    methodTree scope isNil ifTrue:[ ^ self ].
-
-    queue := OrderedCollection with: methodTree scope.
-    [ queue notEmpty ] whileTrue:[
-        | scope |
 
-        scope := queue removeFirst.
-        1 to: scope localIndex do:[:i|
-            | nm |
 
-            nm := (scope locals at: i) name.
-            (nm startsWith: prefix) ifTrue:[
-                result add: (VariablePO instanceVariable: nm in: class). 
-            ].
-        ].
-    ].
-
-    "Created: / 03-10-2013 / 17:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-10-2013 / 02:15:51 / 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 stripOff: nil filter: [:m | m isJavaMethod ]
-
-    "Created: / 03-10-2013 / 18:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 08-04-2014 / 21:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
+ !
 
 !JavaCompletionEngineSimple methodsFor:'completion-private'!
 
-complete
-    
-    | position entry node |
-
-    position := context codeView characterPositionOfCursor.
-    codeView syntaxElements notEmptyOrNil ifTrue:[
-        entry := codeView syntaxElements atCharacterPosition: position - 1. 
-        entry notNil ifTrue:[
-            node := entry node
-        ].
-        codeView syntaxElements tree notNil ifTrue:[
-            classTree := (codeView syntaxElements tree types ? #()) detect:[:t | (position - 1) between: t declarationSourceStart and: t declarationSourceEnd ] ifNone:[nil].
-            classTree notNil ifTrue:[
-                methodTree := (classTree methods ? #()) detect:[:m | (position - 1) between: m declarationSourceStart and: m declarationSourceEnd ] ifNone:[nil].
-            ]
-        ].
-    ].
-
-    context node: node position: position.
-
-    node isNil ifTrue:[
-        self completeSimple.
-    ] ifFalse:[
-        self completeNode: node.
-    ].
-
-    ^ result
-
-    "Created: / 02-10-2013 / 13:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-01-2014 / 23:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
+ !
 
 !JavaCompletionEngineSimple class methodsFor:'documentation'!
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__JavaConstructorPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,56 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+MethodPO subclass:#JavaConstructorPO
+	instanceVariableNames:'showPrefix'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Java-Interface-PO'
+!
+
+!JavaConstructorPO methodsFor:'accessing'!
+
+label
+    label isNil ifTrue:[
+	label := (classes anElement compiledMethodAt: selector) printStringForBrowserWithSelector: selector.
+	showPrefix ifTrue:[
+	    label := classes anElement javaPackage , '.' , label
+	].
+    ].
+    ^ label
+
+    "Created: / 15-05-2014 / 12:04:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+showPrefix: aBoolean
+    showPrefix := aBoolean
+
+    "Created: / 15-05-2014 / 12:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stringAlreadyWritten
+    "Answers a string already written in the textview"
+
+    ^ showPrefix ifTrue:[
+	context wordBeforeCursorConsisitingOfCharactersMatching:[:c | c isAlphaNumeric or:['$_.' includes: c] ]
+    ] ifFalse:[
+	super stringAlreadyWritten
+    ].
+
+    "Created: / 15-05-2014 / 12:06:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stringToCompleteForLanguage: aProgrammingLanguage
+    "Answers a string to complete"
+
+    | string |
+
+    string := super stringToCompleteForLanguage: aProgrammingLanguage.
+    showPrefix ifTrue:[
+	string := classes anElement javaPackage , '.' , string
+    ].
+    ^ string
+
+    "Created: / 15-05-2014 / 12:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
--- a/SmallSense__JavaEditSupport.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__JavaEditSupport.st	Thu Jun 19 11:33:05 2014 +0100
@@ -149,6 +149,15 @@
     lastTypedKey1 := lastTypedKey0.
     lastTypedKey0 := key.
 
+    key == #CodeCompletion ifTrue:[ 
+        | controller |
+
+        (controller := self textView completionSupport) notNil ifTrue:[
+            ^ controller handleKeyPress:key x:x y:y 
+        ].
+        ^ false
+    ].     
+
     key == ${ ifTrue:[
         ^ self keyPressOpenCurly
     ].
@@ -160,7 +169,7 @@
     ^ false
 
     "Created: / 07-03-2010 / 09:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-01-2014 / 09:20:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-05-2014 / 12:45:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPressOpenCurly
--- a/SmallSense__JavaImportPO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__JavaImportPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 PO subclass:#JavaImportPO
-	instanceVariableNames:'klass'
+	instanceVariableNames:'klass import icon'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Java-Interface-PO'
@@ -51,6 +51,16 @@
     "Created: / 20-10-2013 / 00:32:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+import
+    ^ import
+!
+
+import:aString
+    import := aString.
+
+    "Modified: / 20-05-2014 / 11:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 klass
     ^ klass
 !
@@ -59,6 +69,12 @@
     klass := something.
 !
 
+label
+    ^ import
+
+    "Created: / 20-05-2014 / 11:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 stringAlreadyWritten
     "Answers a string already written in the textview"    
 
@@ -71,16 +87,10 @@
 stringToCompleteForLanguage: aProgrammingLanguage
     "Answers a string to complete"
 
-    ^ subject , ';'.
+    ^ import , ';'.
 
     "Created: / 20-10-2013 / 00:39:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-subject:aString
-    subject := aString.
-    name := aString
-
-    "Created: / 19-10-2013 / 21:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 10:10:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaImportPO class methodsFor:'documentation'!
--- a/SmallSense__MethodKeywordRestPO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__MethodKeywordRestPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -9,17 +9,6 @@
 	category:'SmallSense-Core-Interface-PO'
 !
 
-!MethodKeywordRestPO class methodsFor:'Instance creation'!
-
-name:nm class:class stripOff: prefix
-    ^ self new
-        name: nm;
-        class: class;
-        keywords: (nm copyFrom: prefix size + 1);
-        yourself
-
-    "Created: / 08-04-2014 / 21:22:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
 
 !MethodKeywordRestPO class methodsFor:'accessing'!
 
@@ -79,3 +68,20 @@
     "Created: / 08-04-2014 / 21:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!MethodKeywordRestPO methodsFor:'initialization'!
+
+initializeWithClasses: anArray"Of Classes" selector: aSymbol prefix: aString 
+    selector := aSymbol.
+    classes := anArray.
+    keywords := (aSymbol copyFrom: aString size + 1)
+
+    "Created: / 20-05-2014 / 10:44:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!MethodKeywordRestPO class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/SmallSense__MethodPO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__MethodPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,48 +3,27 @@
 "{ NameSpace: SmallSense }"
 
 PO subclass:#MethodPO
-	instanceVariableNames:'class'
+	instanceVariableNames:'selector classes'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-PO'
 !
 
 
-!MethodPO class methodsFor:'Instance creation'!
-
-name:nm class:class 
-    ^ (self new)
-        name:nm;
-        class:class.
-
-    "Created: / 17-10-2013 / 01:04:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-name:nm class:class stripOff: prefix
-    ^ prefix notNil ifTrue:[ 
-        MethodKeywordRestPO name: nm class: class stripOff: prefix.
-    ] ifFalse:[ 
-        self name: nm class: class.
-    ].
-
-    "Created: / 08-04-2014 / 21:20:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
 !MethodPO methodsFor:'accessing'!
 
-class:something
-    class := something.
-
-    "Created: / 06-04-2011 / 16:51:42 / Jakub <zelenja7@fel.cvut.cz>"
+classes
+    ^ classes
 !
 
 cursorColumnAfterComplete
 
     | idx |
-    idx := name indexOf: $:.
-    ^idx == 0 ifTrue:[name size + 1] ifFalse:[idx + 1].
+    idx := self label indexOf: $:.
+    ^idx == 0 ifTrue:[self label size + 1] ifFalse:[idx + 1].
 
     "Created: / 05-04-2011 / 17:08:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:43:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 cursorColumnAfterCompleteForLanguage: language
@@ -67,10 +46,10 @@
     "Modified: / 07-10-2013 / 12:30:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-klass
-    ^ class
+hint
+    ^ (classes collect:[:each | each nameWithoutPrefix ]) asArray asStringWith:' , '.
 
-    "Created: / 06-05-2014 / 00:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 20-05-2014 / 12:27:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 label
@@ -78,86 +57,67 @@
     label isNil ifTrue:[
         | someClass |
 
-        someClass := class isBehavior ifTrue:[class] ifFalse:[class anElement].
-        label := name.
+        someClass := classes anElement.
+        label := selector.
         someClass programmingLanguage isSmalltalk ifFalse:[
-            label := (someClass compiledMethodAt: name) printStringForBrowserWithSelector: name.
+            label := (someClass compiledMethodAt: selector) printStringForBrowserWithSelector: selector.
         ]
     ].
     ^ label
 
     "Created: / 07-04-2011 / 09:56:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 02-10-2013 / 02:28:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 10:28:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selector
+    ^ selector
 !
 
 stringToCompleteForLanguage: language
     | someClass |
 
-    someClass := class isBehavior ifTrue:[class] ifFalse:[class anElement].
+    someClass := classes anElement.
     someClass isJavaClass ifTrue:[
         | method |
 
-        method := someClass compiledMethodAt: name.
+        method := someClass compiledMethodAt: selector.
         language isSmalltalk  ifTrue:[          
-            ^  method selector upTo: $(
+            ^ selector upTo: $(
         ].
         ((language askFor: #isJava) or:[language askFor: #isGroovy]) ifTrue:[
-            ^ (method selector upTo: $() , (method numArgs == 0 ifTrue:['()'] ifFalse:['(  )']).
+            | selector |
+
+            selector := (method selector upTo: $().
+            selector = '<init>' ifTrue:[ 
+                selector := someClass lastName.
+            ].
+            selector := selector , (method numArgs == 0 ifTrue:['()'] ifFalse:['(  )']).
+            ^ selector
         ].
     ].
     ^ String 
-        fromStringCollection: (name tokensBasedOn: $:)
+        fromStringCollection: (selector tokensBasedOn: $:)
         separatedBy: ':  '.
 
     "Created: / 02-10-2013 / 02:33:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 31-03-2014 / 23:08:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 13:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 10:29:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!MethodPO methodsFor:'displaying'!
-
-displayLabel:aLabel h:lH on:aGC x:x y:y h:h
-    | lw cn cnw fg y0 |
-
-    super displayLabel:aLabel h:lH on:aGC x:x y:y h:h.
+!MethodPO methodsFor:'initialization'!
 
-    lw :=  x + (parent isNil ifTrue:[IconWidth] ifFalse:[0]) + (self label widthOn: aGC).
-    class isCollection ifTrue:[
-        cn := (class collect:[:each | each nameWithoutPrefix ]) asArray asStringWith:' , '.
-    ] ifFalse:[
-        cn := class nameWithoutPrefix.
-    ].
-    cnw := aGC widthOfString: cn.
-    y0 := y - (lH + 1 - h // 2).
-    y0 := y0 + (cn ascentOn:aGC).  
+initializeWithClass: aClass selector: aSymbol
+    ^ self initializeWithClasses: (Array with: aClass) selector: aSymbol
 
-    (aGC width > (lw + cnw + 5)) ifTrue:
-        [fg := aGC paint.
-        aGC paint: Color gray .
-        aGC displayString: cn x: aGC width - cnw - 5 y: y0.
-        aGC paint: fg.
-    ]
-
-    "Created: / 18-09-2013 / 00:19:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 28-04-2014 / 00:24:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 20-05-2014 / 10:32:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-displayOn:aGC x:x y:y opaque:opaque
-
-    | lw cn cnw fg |
-
-    super displayOn:aGC x:x y:y opaque:opaque.
-    lw :=  x + 16 + (self label widthOn: aGC).
-    cn := class nameWithoutPrefix.
-    cnw := aGC widthOfString: cn.
+initializeWithClasses: anArray"Of Classes" selector: aSymbol 
+    selector := aSymbol.
+    classes := anArray
 
-    (aGC width > (lw + cnw + 5)) ifTrue:
-        [fg := aGC paint.
-        aGC paint: Color gray .
-        aGC displayString: cn x: aGC width - cnw - 5 y: y.
-        aGC paint: fg.
-        ]
-
-    "Created: / 21-05-2011 / 11:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 20-05-2014 / 10:32:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:34:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MethodPO methodsFor:'testing'!
--- a/SmallSense__PO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__PO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 HierarchicalItem subclass:#PO
-	instanceVariableNames:'subject icon label name relevance context'
+	instanceVariableNames:'label relevance context'
 	classVariableNames:'IconWidth'
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-PO'
@@ -24,7 +24,34 @@
 
 !PO class methodsFor:'Instance creation'!
 
+forClass: aClass
+    ^ ClassPO new initializeWithClass: aClass
+
+    "Created: / 20-05-2014 / 09:56:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+forClass: aClass selector: aSymbol
+    ^ MethodPO new initializeWithClass: aClass selector: aSymbol
+
+    "Created: / 20-05-2014 / 10:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+forClasses: aCollection selector: aSymbol
+    ^ MethodPO new initializeWithClasses: aCollection selector: aSymbol
+
+    "Created: / 20-05-2014 / 10:33:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+forClasses: aCollection selector: aSymbol prefix: aString
+    ^ aString notEmptyOrNil 
+        ifTrue: [ MethodKeywordRestPO new initializeWithClasses: aCollection selector: aSymbol prefix: aString ]
+        ifFalse:[ MethodPO new initializeWithClasses: aCollection selector: aSymbol ]
+
+    "Created: / 20-05-2014 / 10:43:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 subject: anObject
+    <resource: #obsolete>
 
     ^self new subject: anObject
 
@@ -34,15 +61,12 @@
 !PO methodsFor:'accessing'!
 
 context
-    "Returns a complection context or nil (if not used for code completion)"
     ^ context
-
-    "Modified (comment): / 10-05-2014 / 11:35:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-context:aCompletionContextOrNil
-    aCompletionContextOrNil notNil ifTrue:[
-        context := aCompletionContextOrNil.
+context:something
+    something notNil ifTrue:[
+        context := something.
     ].
 
     "Modified: / 17-10-2013 / 01:16:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -58,6 +82,15 @@
     "Modified: / 04-10-2013 / 07:48:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+hint
+    "Return a hint text to be displayed in gray after a label
+     (if there's space). If nil is returned, no hint is shown"
+
+    ^ nil
+
+    "Created: / 20-05-2014 / 11:52:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 icon
 
     ^nil
@@ -66,20 +99,30 @@
 !
 
 label
+    "Return a text to be displayed. The label may be cached
+     `label` instvar."
 
-    label isNil ifTrue:[label := self name].
-    ^label
+    ^ self subclassResponsibility
 
     "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>"
+    "Modified: / 20-05-2014 / 11:30:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 name
-    ^ name
+    <resource: #obsolete>
+
+    self obsoleteMethodWarning.
+    ^ self label
+
+    "Modified: / 20-05-2014 / 11:36:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-name:something
-    name := something.
+name:aString
+    <resource: #obsolete>
+
+    self shouldNeverBeSent
+
+    "Modified: / 20-05-2014 / 11:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 relevance
@@ -124,18 +167,26 @@
 stringToCompleteForLanguage: aProgrammingLanguage
     "Answers a string to complete"
 
-    ^ self name
+    ^ self subclassResponsibility
 
     "Created: / 02-10-2013 / 02:32:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 31-03-2014 / 23:07:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:32:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 subject
-    ^ subject
+    <resource: #obsolete>
+
+    self error: 'Should no longer be sent'.
+
+    "Modified: / 20-05-2014 / 10:16:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-subject:something
-    subject := something.
+subject:anObject
+    <resource: #obsolete>
+
+    self error: 'Should no longer be sent'.
+
+    "Modified: / 20-05-2014 / 10:16:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PO methodsFor:'completion'!
@@ -207,6 +258,13 @@
     super displayOn:aGC x:cx y:y h:h
 
     "Created: / 28-04-2014 / 00:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+displayString
+    ^ self label
+
+    "Created: / 20-04-2012 / 18:19:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:34:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PO methodsFor:'printing & storing'!
@@ -216,10 +274,10 @@
 
     super printOn:aStream.
     aStream nextPut:$(.
-    self label printOn:aStream.
+    self label.
     aStream nextPut:$).
 
-    "Modified: / 02-05-2014 / 12:08:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:18:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PO methodsFor:'queries'!
@@ -245,12 +303,6 @@
     ^ false
 !
 
-isSmallSensePackagePO
-    ^ false
-
-    "Created: / 05-05-2014 / 23:50:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 isSmallSenseSnippetPO
     ^ false
 !
--- a/SmallSense__PackagePO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__PackagePO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 PO subclass:#PackagePO
-	instanceVariableNames:'projectDefinition isJava'
+	instanceVariableNames:'name projectDefinition isJava'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-PO'
@@ -18,14 +18,14 @@
 !
 
 name
-    ^ subject
+    ^ name 
 
     "Created: / 06-05-2014 / 00:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 projectDefinition
     projectDefinition isNil ifTrue:[ 
-        projectDefinition := ProjectDefinition definitionClassForPackage: subject.  
+        projectDefinition := ProjectDefinition definitionClassForPackage: name.  
     ].
     ^ projectDefinition
 
--- a/SmallSense__PackageSearchDialog.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__PackageSearchDialog.st	Thu Jun 19 11:33:05 2014 +0100
@@ -22,7 +22,7 @@
 matchingObjectPOsFor:objects
 
     objects sort: [ :a :b | a < b ].
-    ^ objects collect:[ :e | PackagePO new subject: e ].
+    ^ objects collect:[ :e | PackagePO new name: e ].
 
     "Created: / 05-05-2014 / 23:54:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
--- a/SmallSense__ParseTreeIndexEntry.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__ParseTreeIndexEntry.st	Thu Jun 19 11:33:05 2014 +0100
@@ -262,3 +262,10 @@
     "Created: / 21-08-2011 / 09:31:33 / cg"
 ! !
 
+!ParseTreeIndexEntry class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/SmallSense__RecognizerTests.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__RecognizerTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -6,7 +6,7 @@
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
-	category:'SmallSense-Tests'
+	category:'SmallSense-Tests-Obsolete'
 !
 
 
--- a/SmallSense__SmalltalkCompletionEngine.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__SmalltalkCompletionEngine.st	Thu Jun 19 11:33:05 2014 +0100
@@ -43,7 +43,7 @@
 
 !SmalltalkCompletionEngine class methodsFor:'utilities'!
 
-resultSetFor: mode source: source class: class line: line column: col 
+resultSetFor: mode source: source class: class line: line column: col
     | inferencer tree |
 
     mode == #method ifTrue:[
@@ -56,10 +56,10 @@
         inferencer := Parser for: (source asString readStream).
         "JV@2011-06-13: HACK, use polymorphism"
         tree := inferencer
-            parseExpressionWithSelf:nil 
-            notifying:nil 
-            ignoreErrors:false 
-            ignoreWarnings:false 
+            parseExpressionWithSelf:nil
+            notifying:nil
+            ignoreErrors:false
+            ignoreWarnings:false
             inNameSpace:nil.
         inferencer tree: tree.
     ].
@@ -88,13 +88,14 @@
     ].
     loaders add: nil.
 
-    JavaVM registry  classesDo:[:cls|
+    JavaVM registry  allClassesDo:[:cls|
         (loaders includes: cls classLoader) ifTrue:[
             aBlock value: cls.
         ].
     ].
 
     "Created: / 04-10-2013 / 13:10:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-06-2014 / 11:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkCompletionEngine methodsFor:'completion-individual'!
@@ -113,9 +114,10 @@
 
 addGlobalsStartingWith: prefix
 
-    | class ns cls |
+    | class ns cls environment |
     class := collector klass.
     ns := class nameSpace.
+    environment := context environment.
     "nameSpace may return private class, sigh"
     [ ns isNameSpace ] whileFalse:[ ns := ns nameSpace ].
     ns keysDo:[:nm|
@@ -123,25 +125,25 @@
             cls := ns classNamed: nm.
             (cls notNil and:[cls name = nm]) ifTrue:[
                 (JavaPackage isNil or:[cls isJavaPackage not]) ifTrue:[
-                    result add:(ClassPO new subject: cls; showPrefix: cls isJavaClass).
+                    result add:(((PO forClass: cls)) showPrefix: cls isJavaClass).
                 ]
             ] ifFalse:[
-                (self isGlobalKeyForClassVariable: nm) ifFalse:[  
+                (self isGlobalKeyForClassVariable: nm) ifFalse:[
                     result add:(VariablePO globalVariable: nm)
                 ].
             ].
         ].
     ].
-    ns ~~ Smalltalk ifTrue:[
-        Smalltalk keysDo:[:nm|
+    ns ~~ environment ifTrue:[
+        environment keysDo:[:nm|
             (nm startsWith: prefix) ifTrue:[
-                cls := Smalltalk classNamed: nm.
+                cls := environment classNamed: nm.
                 (JavaPackage isNil or:[cls isJavaPackage not ]) ifTrue:[
                     cls notNil ifTrue:[
                         cls isBehavior ifTrue:[
-                            result add:(ClassPO new subject: cls; showPrefix: cls isJavaClass).
+                            result add:(((PO forClass: cls)) showPrefix: cls isJavaClass).
                         ] ifFalse:[
-                            (self isGlobalKeyForClassVariable: nm) ifFalse:[  
+                            (self isGlobalKeyForClassVariable: nm) ifFalse:[
                                 result add:(VariablePO globalVariable: nm).
                             ].
                         ]
@@ -152,7 +154,7 @@
     ]
 
     "Created: / 26-11-2011 / 17:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 09-04-2014 / 13:52:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 09:58:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addJavaClassesInPackage: prefix
@@ -173,9 +175,38 @@
     "Modified: / 20-10-2013 / 02:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-addMethodsForType: type 
-    | classes seen |
+addMethodsForType: type
+    ^ self addMethodsForType: type stripOff: nil
+
+    "Created: / 26-11-2011 / 17:03:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 09-05-2014 / 12:51:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsForType: type prefix: prefix stripOff: stripprefix
+
+    type isUnknownType ifFalse:[
+        self addMethodsForType:type stripOff: stripprefix.
 
+        "/ If the type is union of more than 6 types, then
+        "/ assume that the inferencer is likely wrong.
+        "/ then, if the prefix is at least 3 chars,
+        "/ also add methods with that prefix.
+
+        ((type classes size > 6) and:[ prefix size > 2 ]) ifTrue:[
+            self addMethodsStartingWith:prefix stripOff: stripprefix
+        ].
+    ] ifTrue:[
+        self addMethodsStartingWith:prefix stripOff: stripprefix
+    ].
+
+    "Created: / 08-04-2014 / 21:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 09-04-2014 / 09:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addMethodsForType: type stripOff: stripprefix
+    | classes seen selector2classesMap |
+
+    selector2classesMap := Dictionary new.
     classes := type classes.
     "/ Hack for Boolean: ifTrue:iFalse: etc are not defined
     "/ in Boolean ?!!?
@@ -183,7 +214,7 @@
         classes := Array with: True with: False.
     ].
     classes size == 1 ifTrue:[
-        classes anElement == JavaPackage class ifTrue:[  
+        classes anElement == JavaPackage class ifTrue:[
             "/ Special hack for JAVA: for pattern `JAVA java lang reflect`
             "/ complete all Java classes in that package
             | node |
@@ -206,124 +237,46 @@
     ].
 
     seen := Set new.
-    classes do: [:each | 
-        | class |
+    classes do: [:each |
+        | class selector2classMap |
 
         class := each.
-        [ class notNil and:[(seen includes: class) not]] whileTrue: [
+        selector2classMap := Dictionary new.
+
+        "/ Now, special care for Java classes, sigh...
+        (class isMetaclass and:[class theNonMetaclass isJavaClass]) ifTrue:[
             seen add: class.
-            "/ Now, special care for Java classes, sigh...
-            (class isMetaclass and:[class theNonMetaclass isJavaClass]) ifTrue:[
-                class theNonMetaclass selectorsAndMethodsDo: [:selector :met | 
-                    met isStatic ifTrue:[
-                        result add: (MethodPO 
-                                    name: selector
-                                    class: met mclass).
-                    ].
+            class theNonMetaclass selectorsAndMethodsDo: [:selector :met |
+                met isStatic ifTrue:[
+                    result add: (PO forClass: met mclass selector: selector)
                 ].
-            ] ifFalse:[
-                class selectorsAndMethodsDo: [:selector :met | 
+            ].
+        ] ifFalse:[
+            [ class notNil and:[(seen includes: class) not]] whileTrue: [
+                class selectorsAndMethodsDo: [:selector :met |
                     met isSynthetic ifFalse:[
-                        result add: (MethodPO 
-                                    name: selector
-                                    class: met mclass).
+                        (stripprefix isNil or:[ selector size > stripprefix size and:[selector startsWith: stripprefix]]) ifTrue:[
+                            selector2classMap at: selector put: class.
+                        ].
                     ]
                 ].
-            ].
-            class := class superclass.
+                class := class superclass.
+            ]
+        ].
+        selector2classMap keysAndValuesDo:[:selector :class |
+            | classes |
+
+            classes := selector2classesMap at: selector ifAbsentPut: [ Set new ].
+            classes add: class.
         ]
     ].
 
-    "Created: / 26-11-2011 / 17:03:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-01-2014 / 19:48:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addMethodsForType: type prefix: prefix stripOff: stripprefix
-
-    type isUnknownType ifFalse:[
-        self addMethodsForType:type stripOff: stripprefix.
-        
-        "/ If the type is union of more than 6 types, then
-        "/ assume that the inferencer is likely wrong.
-        "/ then, if the prefix is at least 3 chars,
-        "/ also add methods with that prefix.
-        
-        ((type classes size > 6) and:[ prefix size > 2 ]) ifTrue:[
-            self addMethodsStartingWith:prefix stripOff: stripprefix
-        ].
-    ] ifTrue:[
-        self addMethodsStartingWith:prefix stripOff: stripprefix  
-    ].
-
-    "Created: / 08-04-2014 / 21:04:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 09-04-2014 / 09:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-addMethodsForType: type stripOff: stripprefix     
-    | classes seen |
-
-    classes := type classes.
-    "/ Hack for Boolean: ifTrue:iFalse: etc are not defined
-    "/ in Boolean ?!!?
-    (classes size == 1 and:[classes anElement == Boolean ]) ifTrue:[
-        classes := Array with: True with: False.
-    ].
-    classes size == 1 ifTrue:[
-        classes anElement == JavaPackage class ifTrue:[  
-            "/ Special hack for JAVA: for pattern `JAVA java lang reflect`
-            "/ complete all Java classes in that package
-            | node |
-
-            node := result context node.
-            node isUnaryMessage ifTrue:[
-                | package |
-                "/ Compute package prefix...
-
-                package := node selector.
-                node := node receiver.
-                [ node isUnaryMessage ] whileTrue:[
-                    package := node selector , '/' , package.
-                    node := node receiver.
-                ].
-                self addJavaClassesInPackage: package.
-                ^ self.
-            ]
-        ]
-    ].
-
-    seen := Set new.
-    classes do: [:each | 
-        | class |
-
-        class := each.
-        [ class notNil and:[(seen includes: class) not]] whileTrue: [
-            seen add: class.
-            "/ Now, special care for Java classes, sigh...
-            (class isMetaclass and:[class theNonMetaclass isJavaClass]) ifTrue:[
-                class theNonMetaclass selectorsAndMethodsDo: [:selector :met | 
-                    met isStatic ifTrue:[
-                        result add: (MethodPO 
-                                    name: selector
-                                    class: met mclass).
-                    ].
-                ].
-            ] ifFalse:[
-                class selectorsAndMethodsDo: [:selector :met | 
-                    met isSynthetic ifFalse:[
-                        (stripprefix isNil or:[ selector size > stripprefix size and:[selector startsWith: stripprefix]]) ifTrue:[
-                            result add: (MethodPO 
-                                        name: selector
-                                        class: met mclass
-                                        stripOff: stripprefix).
-                        ].
-                    ]
-                ].
-            ].
-            class := class superclass.
-        ]
-    ].
+    selector2classesMap keysAndValuesDo: [:selector :classes|
+        result add:(MethodPO forClasses: classes selector: selector prefix: stripprefix)
+    ]
 
     "Created: / 08-04-2014 / 21:23:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 10:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addPools
@@ -349,10 +302,11 @@
         | nm |
 
         nm := pclass fullName copyFrom: class fullName size + 3.
-        result add:(ClassPO new subject: pclass; name: nm).
+        result add:((PO forClass: pclass) ).
     ]
 
     "Created: / 06-08-2013 / 12:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 29-05-2014 / 15:36:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addVariablesFor: node
@@ -364,7 +318,7 @@
     [ klass notNil ] whileTrue:[
         | usedInstVars |
 
-        usedInstVars := collector parser usedInstVars. 
+        usedInstVars := collector parser usedInstVars.
         klass instVarNames do:[:nm |
             | po |
 
@@ -379,7 +333,7 @@
         "/ When on class side (i.e., in class method), do not complete
         "/ instance variables of Class / ClassDescription / Behaviour
         "/ as STC won't compile such code.
-        klass := (klass isMetaclass and:[klass superclass == Class]) 
+        klass := (klass isMetaclass and:[klass superclass == Class])
                     ifTrue:[nil]
                     ifFalse:[klass superclass].
     ].
@@ -397,7 +351,7 @@
     ].
     "Add literals"
     #(#true #false #nil ) do:[:nm|
-        result add: (SnippetPO new subject: nm).
+        result add: (SnippetPO new value: nm).
     ].
 
 
@@ -411,7 +365,7 @@
     ]
 
     "Created: / 31-07-2013 / 00:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-01-2014 / 19:42:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 10:09:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkCompletionEngine methodsFor:'completion-private'!
@@ -424,18 +378,18 @@
 
     codeView := context codeView.
     class := codeView isCodeView2
-                ifTrue: [ codeView klass ]  
+                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
+    ^ self complete: codeView codeAspect source: codeView contents string class: class line: codeView cursorLine column: codeView cursorCol
 
     "Created: / 02-10-2013 / 13:32:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-01-2014 / 23:20:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-05-2014 / 17:00:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-complete: mode source: source class: class line: lineNrArg column: colNrArg 
+complete: mode source: source class: class line: lineNrArg column: colNrArg
     | inferencer lineNr colNr |
 
     mode == #method ifTrue:[
@@ -479,16 +433,16 @@
     "Modified: / 24-09-2013 / 02:15:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-completeAtLine:line column:col collector:coll 
+completeAtLine:line column:col collector:coll
     "find most possible codeCompletion object"
 
     | nodeToPosition |
 
     collector := coll.
-    (collector tree isNil or:[collector tree == #Error]) ifTrue:[ 
-        ^ nil 
+    (collector tree isNil or:[collector tree == #Error]) ifTrue:[
+        ^ nil
     ].
-    nodeToPosition := SmalltalkParseNodeFinder new 
+    nodeToPosition := SmalltalkParseNodeFinder new
                         findNodeIn: collector source tree: collector tree comments: collector parser commentPositions
                         line: line column: col.
     context node: nodeToPosition key position: nodeToPosition value.
@@ -523,9 +477,9 @@
     "Created: / 26-11-2011 / 17:07:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-completeIn:node 
+completeIn:node
     "return collection which can be afterNode"
-    
+
     node isVariableNode ifTrue:[
         self completeInVariableNode:node.
         ^ self.
@@ -542,7 +496,7 @@
     "Modified: / 08-04-2014 / 20:52:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-completeInMessageNode:node 
+completeInMessageNode:node
     | parent |
 
 
@@ -555,7 +509,7 @@
     "Modified (format): / 08-04-2014 / 21:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-completeInVariableNode:node 
+completeInVariableNode:node
     node name first isUppercase ifTrue:[
         self addGlobalsStartingWith:node name.
         self addClassVariables.
@@ -572,12 +526,12 @@
     | i |
 
     i := 0.
-    [ 
+    [
         i := aString indexOf: $: startingAt: i + 1.
-        i ~~ 0 
-    ] whileTrue:[ 
-        aString size > i ifTrue:[ 
-            (aString at: i + 1) ~~ $: ifTrue:[ 
+        i ~~ 0
+    ] whileTrue:[
+        aString size > i ifTrue:[
+            (aString at: i + 1) ~~ $: ifTrue:[
                 ^ true
             ].
         ].
--- a/SmallSense__SmalltalkInferencer.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__SmalltalkInferencer.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 Object subclass:#SmalltalkInferencer
-	instanceVariableNames:'type class classInfo source parser parserClass tree'
+	instanceVariableNames:'type class classInfo source parser parserClass tree environment'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Smalltalk-Types-Inference'
@@ -76,6 +76,14 @@
 
 !SmalltalkInferencer methodsFor:'accessing'!
 
+environment
+    ^ environment
+!
+
+environment:something
+    environment := something.
+!
+
 klass
     ^ class
 
--- a/SmallSense__SmalltalkLintHighlighter.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__SmalltalkLintHighlighter.st	Thu Jun 19 11:33:05 2014 +0100
@@ -254,3 +254,10 @@
     "Modified: / 17-09-2013 / 15:24:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SmalltalkLintHighlighter class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/SmallSense__SmalltalkParseNodeFinder.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__SmalltalkParseNodeFinder.st	Thu Jun 19 11:33:05 2014 +0100
@@ -35,7 +35,7 @@
     [
         i < comments size and:[ (s := comments at:i) notNil ]
     ] whileTrue:[
-        e := "s + "(comments at:i + 1) - 1.
+        e := "s + "(comments at:i + 1)" - 1".
         (pos between:s and:e) ifTrue:[
             ^ nil -> pos.
         ].
@@ -48,7 +48,7 @@
     ^ (match ? previous) -> pos.
 
     "Created: / 29-01-2014 / 10:20:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 08-04-2014 / 14:26:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-06-2014 / 16:04:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkParseNodeFinder methodsFor:'visiting'!
--- a/SmallSense__SmalltalkParserTests.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__SmalltalkParserTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -6,7 +6,7 @@
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
-	category:'SmallSense-Tests'
+	category:'SmallSense-Tests-Obsolete'
 !
 
 
--- a/SmallSense__SnippetPO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__SnippetPO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 PO subclass:#SnippetPO
-	instanceVariableNames:''
+	instanceVariableNames:'value'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-PO'
@@ -12,11 +12,32 @@
 
 !SnippetPO methodsFor:'accessing'!
 
-subject:aString
-    subject := aString.
-    name := aString
+label
+    "Return a text to be displayed. The label may be cached
+     `label` instvar."
+
+    ^ value
+
+    "Created: / 20-05-2014 / 11:30:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stringToCompleteForLanguage:aProgrammingLanguage
+    "Answers a string to complete"
 
-    "Created: / 19-10-2013 / 21:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    ^ value
+
+    "Created: / 20-05-2014 / 11:33:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+value
+    ^ value
+!
+
+value:aString
+    value := aString.
+
+    "Created: / 20-05-2014 / 10:08:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-05-2014 / 11:34:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SnippetPO methodsFor:'testing'!
--- a/SmallSense__TestCase.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__TestCase.st	Thu Jun 19 11:33:05 2014 +0100
@@ -6,7 +6,7 @@
 	instanceVariableNames:'u v'
 	classVariableNames:''
 	poolDictionaries:''
-	category:'SmallSense-Tests'
+	category:'SmallSense-Tests-Obsolete'
 !
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__TokenPatternMatcher.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,151 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Regex::RxMatcher subclass:#TokenPatternMatcher
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Utils-Matcher'
+!
+
+!TokenPatternMatcher class methodsFor:'documentation'!
+
+documentation
+"
+    A custom regex-like matcher to match token streams.
+
+    [author:]
+        Jan Vrany <jan.vrany@fit.cvut.cz>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+! !
+
+!TokenPatternMatcher methodsFor:'accessing'!
+
+subexpression: subIndex
+    "returns the matches for a parenthized subexpression.
+     notice that non-matching subexpressions deliver an empty matchString;
+     also be careful with nested parnethesis.
+     With index==1, you get the whole matchString"
+
+    | originalPosition start end reply |
+
+    originalPosition := self position.
+    start := self subBeginning: subIndex.
+    end := self subEnd: subIndex.
+    (start isNil or: [end isNil]) ifTrue: [^''].
+    reply := (Array new: end first - start first) writeStream.
+    self position: start.
+    start first to: end first - 1 do: [:ignored | reply nextPut: stream next].
+    self position: originalPosition.
+    ^reply contents
+
+    "
+     |matcher|
+
+     matcher := Regex::RxMatcher new 
+                    initializeFromString:'(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]+(:isDigit::isDigit:?)[ ]*,[ ]*19(:isDigit::isDigit:)'
+                    ignoreCase:false.
+     (matcher matches:'Aug 6, 1996') ifTrue:[
+        matcher subexpression:2
+     ] ifFalse:[
+        self error.
+     ].                       
+    "
+
+    "Created: / 06-05-2014 / 15:46:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-06-2014 / 17:33:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternMatcher methodsFor:'double dispatch'!
+
+syntaxToken: tokenNode
+    | type value |
+
+    type := tokenNode type.
+    value := tokenNode value.
+
+    ^ Regex::RxmPredicate new predicate:
+        [:token |
+            (token isSymbol or:[token isCharacter]) ifTrue:[ 
+                (type == token) and:[ value isNil or:[value == token ] ]
+            ] ifFalse:[ 
+                (type == token type) and:[ value isNil or:[value = token value]  ]
+            ].
+        ].
+
+    "Created: / 06-05-2014 / 14:38:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-05-2014 / 15:59:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+syntaxTokenSet: tokenSetNode
+    | tokens|
+
+    tokens := tokenSetNode tokens.
+
+    ^ Regex::RxmPredicate new predicate:
+        [:token |
+            | matches |
+            matches := tokens anySatisfy:[:tokenNode |
+                | type value |
+
+                type := tokenNode type.
+                value := tokenNode value.
+                (token isSymbol or:[token isCharacter]) ifTrue:[ 
+                    (type = token) and:[ value isNil or:[value == token ] ]
+                ] ifFalse:[ 
+                    (type = token type) and:[ value isNil or:[value = token value]  ]
+                ].
+            ].
+            tokenSetNode negated ifTrue:[ 
+                matches := matches not.
+            ].
+            matches.
+        ].
+
+    "Created: / 09-05-2014 / 16:22:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternMatcher methodsFor:'initialize-release'!
+
+initialize: syntaxTreeRoot ignoreCase: aBoolean
+        "Compile myself for the regex with the specified syntax tree.
+        See comment and `building' protocol in this class and 
+        #dispatchTo: methods in syntax tree components for details 
+        on double-dispatch building. 
+        The argument is supposedly a RxsRegex."
+
+        ignoreCase := aBoolean.
+        self buildFrom: syntaxTreeRoot.
+"/        startOptimizer := RxMatchOptimizer new initialize: syntaxTreeRoot ignoreCase: aBoolean
+
+    "Created: / 06-05-2014 / 14:39:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternMatcher methodsFor:'streaming'!
+
+position
+    ^ Array with: stream position with: stream sourceStream position
+
+    "Created: / 13-06-2014 / 16:52:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+position: positionsPair 
+    [
+        stream position:positionsPair first.
+    ] on: Stream positionErrorSignal do:[
+        "/ No that much tokens in backlog, reset backlog
+        "/ and set source stream's position
+        stream position: positionsPair first sourcePosition: positionsPair second.
+    ]
+
+    "Created: / 13-06-2014 / 16:53:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__TokenPatternMatcherTests.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,149 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Smalltalk::TestCase subclass:#TokenPatternMatcherTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Tests'
+!
+
+!TokenPatternMatcherTests methodsFor:'tests'!
+
+test_01
+
+    | pattern matcher |
+
+    pattern := SmallSense::TokenPatternParser parse: '][[:Keyword=do\::]]'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '] do:'))).
+    self deny:   (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: 'self matches do:'))).
+
+    "Created: / 06-05-2014 / 16:29:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 09-05-2014 / 16:36:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_02
+
+    | pattern matcher |
+
+    pattern := SmallSense::TokenPatternParser parse: '\[ ( (\:[[:Identifier:]])+ \| )? \.'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '[ .'))).
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '[ :arg1 | .'))).
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '[ :arg1 :arg2 | .'))).
+
+    self deny: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '[ :arg1 arg2 | .'))).
+
+    "Created: / 06-05-2014 / 17:04:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 09-05-2014 / 17:27:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_03a
+
+    | pattern matcher |
+
+    pattern := SmallSense::TokenPatternParser parse: '[[:import:]] ( [[:Identifier:]](.[[:Identifier:]])*\.?\*? )?'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import '))).
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList'))).
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.concurent.ArrayList'))).
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.*'))).
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.'))).
+
+    "Created: / 14-05-2014 / 16:13:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_03b
+
+    | pattern stream matcher matches match |
+
+    pattern := SmallSense::TokenPatternParser parse: '[[:import:]] ( [[:Identifier:]](.[[:Identifier:]])*\.?\*? )?'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+
+    stream := SmallSense::TokenStream on: (JavaScanner for: 'import ').
+
+    matches := matcher matchesOnStream: stream.
+    self assert: matches size == 1.
+    match := matches first.
+    self assert: match size == 1.
+    self assert: match first type == #import.
+
+    stream reset.
+
+    matches := matcher matchesOnStream: stream.
+    self assert: matches size == 1.
+    match := matches first.
+    self assert: match size == 1.
+    self assert: match first type == #import.
+
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList'))).
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.concurent.ArrayList'))).
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.*'))).
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.'))).
+
+    "Created: / 14-05-2014 / 16:15:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_03c
+
+    | pattern stream matcher matches match |
+
+    pattern := SmallSense::TokenPatternParser parse: '[[:import:]] ( [[:Identifier:]](.[[:Identifier:]])*\.?\*? )?'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+
+    stream := SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.*').
+
+    matches := matcher matchesOnStream: stream.
+    self assert: matches size == 1.
+    match := matches first.
+    self assert: match size == 8.
+    self assert: match first type == #import.
+    self assert: match second type == #Identifier.
+    self assert: match third type == $..
+    self assert: match last type == $*.
+
+
+
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList'))).
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.concurent.ArrayList'))).
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.*'))).
+"/    self assert: (matcher searchStream: (SmallSense::TokenStream on: (JavaScanner for: 'import java.util.ArrayList.'))).
+
+    "Created: / 14-05-2014 / 16:20:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_04a 
+    "Test of cursor special token (CARRET)"
+
+    | pattern matcher |
+
+    pattern := SmallSense::TokenPatternParser parse: '][[:Keyword=do\::]] [[:CARET:]]'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '] do: [:each |  ] ') cursor:6 )).
+    self deny: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '] do: [:each |  ] ') cursor:8 )).
+
+    "Created: / 15-05-2014 / 16:24:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_04b 
+    "Test of cursor special token (CARRET)"
+
+    | pattern matcher |
+
+    pattern := SmallSense::TokenPatternParser parse: '\[ [[:CARET:]] \]'.
+    matcher := SmallSense::TokenPatternMatcher for: pattern.
+
+    self assert: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '[  ]') cursor:2 )).
+    self deny: (matcher searchStream: (SmallSense::TokenStream on: (Scanner for: '[ :hello') cursor:2 )).
+
+    "Created: / 15-05-2014 / 16:25:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__TokenPatternParser.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,137 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Regex::RxParser subclass:#TokenPatternParser
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Utils-Matcher'
+!
+
+Regex::RxCharSetParser subclass:#TokenSpecParser
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:TokenPatternParser
+!
+
+!TokenPatternParser class methodsFor:'documentation'!
+
+documentation
+"
+    A parser to parse token patterns
+
+    [author:]
+        Jan Vrany <jan.vrany@fit.cvut.cz>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+! !
+
+!TokenPatternParser class methodsFor:'parsing'!
+
+parse: anArrayOrStream
+    ^ self new parse: anArrayOrStream
+
+    "Created: / 02-05-2014 / 18:56:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternParser methodsFor:'private'!
+
+characterSetFrom: setSpec
+        "<setSpec> is what goes between the brackets in a charset regex
+        (a String). Make a string containing all characters the spec specifies.
+        Spec is never empty."
+
+        | negated spec |
+        spec := ReadStream on: setSpec.
+        spec peek = $^
+                ifTrue:         [negated := true.
+                                spec next]
+                ifFalse:        [negated := false].
+        ^ TokenPatternTokenSet new
+                initializeElements: (TokenSpecParser on: spec) parse
+                negated: negated
+
+    "Created: / 09-05-2014 / 15:48:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+next
+    "Advance the input storing the just read character
+    as the lookahead."
+
+    "/ Overriden here to allow for spaces (to increase readability)
+
+    input atEnd ifTrue: [
+        lookahead := #epsilon.
+    ] ifFalse:[ 
+        input skipSeparators.
+        lookahead := input next
+    ].
+
+    "Created: / 09-05-2014 / 17:24:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternParser methodsFor:'recursive descent'!
+
+atom
+    | atom |
+
+    atom := super atom.
+    (atom isKindOf:Regex::RxsCharacter) ifTrue:[
+        atom := TokenPatternToken new type:atom character.
+    ].
+    ^ atom
+
+    "Created: / 09-05-2014 / 15:56:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternParser::TokenSpecParser methodsFor:'parsing'!
+
+parseNamedSet
+    | type value done out |
+
+    self
+        match:$[;
+        match:$:.
+    done := false.
+    out := '' writeStream.
+    [ done ] whileFalse:[ 
+        lookahead == $\ ifTrue:[ 
+            "/ Escape sequence
+            lookahead := source next.
+            out nextPut: lookahead.
+        ] ifFalse:[ 
+            lookahead == $: ifTrue:[ 
+                done := true.
+            ] ifFalse:[ 
+                lookahead == $= ifTrue:[ 
+                    type := out contents.
+                    out reset.
+                ] ifFalse:[ 
+                    out nextPut: lookahead.
+                ].
+            ].
+        ].
+        lookahead := source next.
+    ].
+    type isNil ifTrue:[ 
+        type := out contents.
+    ] ifFalse:[
+        value := out contents.
+    ].
+    self match:$].
+
+    elements add:((TokenPatternToken new)
+                type:type;
+                value:value)
+
+    "Modified: / 09-05-2014 / 16:35:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__TokenPatternToken.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,57 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Regex::RxsNode subclass:#TokenPatternToken
+	instanceVariableNames:'type value'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Utils-Matcher'
+!
+
+!TokenPatternToken methodsFor:'accessing'!
+
+type
+    ^ type
+!
+
+type:something
+    type := something.
+!
+
+value
+    ^ value
+!
+
+value:something
+    value := something.
+! !
+
+!TokenPatternToken methodsFor:'double dispatch'!
+
+dispatchTo: matcher
+     "Inform the matcher of the kind of the node, and it
+      will do whatever it has to."
+
+     ^matcher syntaxToken: self
+
+    "Created: / 06-05-2014 / 14:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternToken methodsFor:'initialization'!
+
+initializeTyoe: t value: v
+    type := t.
+    value := v
+
+    "Created: / 02-05-2014 / 21:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenPatternToken methodsFor:'testing'!
+
+isEnumerable
+    ^ false
+
+    "Created: / 09-05-2014 / 16:10:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__TokenPatternTokenSet.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,28 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Regex::RxsCharSet subclass:#TokenPatternTokenSet
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Utils-Matcher'
+!
+
+!TokenPatternTokenSet methodsFor:'accessing'!
+
+dispatchTo: aMatcher
+        "Inform the matcher of the kind of the node, and it
+        will do whatever it has to."
+
+        ^aMatcher syntaxTokenSet: self
+
+    "Created: / 09-05-2014 / 16:18:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+tokens
+    ^ elements
+
+    "Created: / 09-05-2014 / 16:20:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__TokenStream.st	Thu Jun 19 11:33:05 2014 +0100
@@ -0,0 +1,321 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Object subclass:#TokenStream
+	instanceVariableNames:'scanner scannerSourceReadLimit tokens last position full
+		positionMax positionOfCursor caretTokenReported'
+	classVariableNames:'BacklogSize'
+	poolDictionaries:''
+	category:'SmallSense-Utils-Matcher'
+!
+
+Object subclass:#Token
+	instanceVariableNames:'type value startPosition endPosition'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:TokenStream
+!
+
+!TokenStream class methodsFor:'documentation'!
+
+documentation
+"
+    A custom read-only stream that return high-level tokens produced
+    by underlying scanner object. The scanner must conform to API of
+    Scanner class.
+
+    Additionaly, when a cursor position is provided, TokenStream returns
+    a virtual token with type #CARET.
+
+    [author:]
+        Jan Vrany <jan.vrany@fit.cvut.cz>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+        Scanner
+        TokenPatternMatcher.
+
+"
+! !
+
+!TokenStream class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    "/ please change as required (and remove this comment)
+
+    BacklogSize := 100.
+
+    "Modified: / 07-08-2013 / 01:47:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenStream class methodsFor:'instance creation'!
+
+on: scanner
+    ^ self new initializeOn: scanner cursor: nil
+
+    "Created: / 06-05-2014 / 15:25:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 15:08:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+on: scanner cursor: cursor
+    ^ self new initializeOn: scanner cursor: cursor
+
+    "Created: / 15-05-2014 / 15:08:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenStream methodsFor:'accessing'!
+
+sourceStream
+    ^ scanner sourceStream
+
+    "Created: / 07-08-2013 / 01:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenStream methodsFor:'initialization'!
+
+initializeOn: scannerObject
+    ^ self initializeOn: scannerObject cursor: nil
+
+    "Created: / 06-05-2014 / 15:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 15:08:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+initializeOn: scannerArg cursor: positionOfCursorArg
+    scanner := scannerArg.
+    positionOfCursor := positionOfCursorArg.
+    tokens := Array new: BacklogSize.
+    last := 0.
+    full := false.
+    position := 0.
+    positionMax := 0.
+    caretTokenReported := false.
+
+    positionOfCursor notNil ifTrue:[ 
+        scannerArg sourceStream isExternalStream ifTrue:[ 
+            self error: 'Cursor reporting us supported only on internal streams'.
+        ].
+        scannerSourceReadLimit := scannerArg sourceStream readLimit.
+        scannerArg sourceStream readLimit: (positionOfCursor min: scannerSourceReadLimit)
+    ].
+
+    "Created: / 15-05-2014 / 15:07:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 17:55:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenStream methodsFor:'stream api'!
+
+atEnd
+    ^ self peek type == #EOF
+
+    "Created: / 14-03-2012 / 22:53:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-08-2013 / 01:49:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+contents
+    ^ Array streamContents:[ :s | 
+        [ self atEnd ] whileFalse:[ 
+            s nextPut: self next
+        ].
+    ].
+
+    "Created: / 15-05-2014 / 07:49:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+next
+    | i t |
+    position < positionMax ifTrue:[
+        i := last - (positionMax - position) + 1.
+        i <= 0 ifTrue:[
+            i := tokens size + i.
+        ].
+        position := position + 1.
+        ^ tokens at: i.
+    ].
+    scanner nextToken.
+    t := scanner token.
+    "/ Smalltalk / JavaScript scanners does not return token objects, sigh...
+    (t isCharacter or:[ t isString ]) ifTrue:[ 
+        t := Token new
+                type: scanner tokenType;
+                value: scanner token;
+                startPosition: scanner tokenStartPosition;
+                endPosition: scanner tokenEndPosition;        
+                yourself
+    ].
+    t isNil ifTrue:[ 
+        t := Token new
+                type: #EOF;
+                yourself
+    ].
+    t type == #EOF ifTrue:[ 
+        (caretTokenReported not and:[scanner sourceStream position == positionOfCursor]) ifTrue:[ 
+            t type: #CARET.
+            t value: $|.
+            t startPosition: positionOfCursor.
+            t endPosition: positionOfCursor.
+            caretTokenReported := true.
+            scanner sourceStream readLimit: scannerSourceReadLimit.
+        ].
+    ].
+    position := positionMax := positionMax + 1.
+    last := last + 1.
+    last > tokens size ifTrue:[ 
+        full ifFalse:[ full := true ].
+        last := 1 
+    ].
+    tokens at: last put: t.
+    ^ t
+
+    "Created: / 14-03-2012 / 22:53:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-05-2014 / 17:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+next: anInteger 
+    "Answer up to anInteger elements of my collection. Overridden for efficiency."
+
+    ^ self shouldNotImplement
+
+    "Modified: / 06-05-2014 / 15:51:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+peek
+    | t |
+
+    t := self next.
+    position := position - 1.
+    ^ t
+
+    "Modified: / 07-08-2013 / 01:12:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+position
+    ^position
+
+    "Created: / 14-03-2012 / 22:52:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-08-2013 / 01:06:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+position: anInteger
+    (positionMax - anInteger) > (tokens size) ifTrue:[
+        Stream positionErrorSignal raiseErrorString:'Not that much tokens in backlog!! Icrease it and try again'.
+        ^ self.
+    ].
+    position := anInteger.
+
+    "Modified: / 13-06-2014 / 16:54:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+position: tokenPosition sourcePosition: sourcePosition
+    position := positionMax := tokenPosition.
+    tokens := tokens class new: tokens size.
+    full := false.
+
+    scanner sourceStream position: sourcePosition.
+    positionOfCursor notNil ifTrue:[
+        sourcePosition < positionOfCursor ifTrue:[
+            scanner sourceStream readLimit: (positionOfCursor min: scannerSourceReadLimit).
+            caretTokenReported := false.
+        ].
+    ].
+
+    "Created: / 13-06-2014 / 17:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+reset
+    (positionMax) > (tokens size) ifFalse:[
+        scanner sourceStream reset.    
+    ].
+    position := 0.
+
+    "Created: / 14-05-2014 / 16:19:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-06-2014 / 16:47:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skipSeparators
+    self halt.
+
+    "Created: / 15-03-2012 / 10:35:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-08-2013 / 01:15:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+uncheckedPeek
+    "An unchecked version of peek that throws an error if we try to peek over the end of the stream, even faster than #peek."
+
+    ^ self peek
+
+    "Modified: / 14-03-2012 / 22:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenStream::Token methodsFor:'accessing'!
+
+endPosition
+    ^ endPosition
+!
+
+endPosition:something
+    endPosition := something.
+!
+
+startPosition
+    ^ startPosition
+!
+
+startPosition:something
+    startPosition := something.
+!
+
+stopPosition
+    ^ endPosition
+
+    "Created: / 04-04-2013 / 00:32:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+type
+    ^ type
+!
+
+type:something
+    type := something.
+!
+
+value
+    ^ value
+!
+
+value:something
+    value := something.
+! !
+
+!TokenStream::Token methodsFor:'printing & storing'!
+
+printOn:aStream
+    "append a printed representation if the receiver to the argument, aStream"
+
+    aStream nextPut: ${.
+    type printOn:aStream.
+    aStream nextPutAll:' - '.
+    value printOn:aStream.
+    aStream nextPutAll:' <'.
+    startPosition printOn:aStream.
+    aStream nextPutAll:'-'.
+    endPosition printOn:aStream.
+    aStream nextPutAll:'>}'.
+
+    "Modified: / 06-05-2014 / 15:33:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TokenStream class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
+
+TokenStream initialize!
--- a/SmallSense__VariablePO.st	Sat May 10 12:08:16 2014 +0100
+++ b/SmallSense__VariablePO.st	Thu Jun 19 11:33:05 2014 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: SmallSense }"
 
 PO subclass:#VariablePO
-	instanceVariableNames:'class type'
+	instanceVariableNames:'class type name'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Core-Interface-PO'
@@ -55,13 +55,30 @@
     "Created: / 06-04-2011 / 16:51:42 / Jakub <zelenja7@fel.cvut.cz>"
 !
 
-stringToCompleteForLanguage: language
+label
+    ^ name
+
+    "Created: / 20-05-2014 / 11:30:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+name
+    ^ name
 
+    "Created: / 20-05-2014 / 11:38:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+name: aString
+    name := aString
+
+    "Created: / 20-05-2014 / 11:37:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+stringToCompleteForLanguage:aProgrammingLanguage
     "Answers a string to complete"
 
-    ^name "/, ' '
+    ^ name
 
-    "Created: / 31-03-2014 / 23:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 20-05-2014 / 11:33:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 type:something
--- a/abbrev.stc	Sat May 10 12:08:16 2014 +0100
+++ b/abbrev.stc	Thu Jun 19 11:33:05 2014 +0100
@@ -2,18 +2,20 @@
 # this file is needed for stc to be able to compile modules independently.
 # it provides information about a classes filename, category and especially namespace.
 SmallSense::AbstractDIalog SmallSense__AbstractDIalog jv:smallsense 'SmallSense-Core-Interface-Search' 1
-SmallSense::BaseTestClass SmallSense__BaseTestClass jv:smallsense 'SmallSense-Tests' 1
+SmallSense::BaseTestClass SmallSense__BaseTestClass jv:smallsense 'SmallSense-Tests-Obsolete' 1
 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::CompletionEngineTests SmallSense__CompletionEngineTests jv:smallsense 'SmallSense-Tests' 1
 SmallSense::CompletionResult SmallSense__CompletionResult jv:smallsense 'SmallSense-Core' 0
 SmallSense::CompletionView SmallSense__CompletionView jv:smallsense 'SmallSense-Core-Interface' 2
 SmallSense::CriticsWindow SmallSense__CriticsWindow jv:smallsense 'SmallSense-Core-Interface' 1
 SmallSense::EditService SmallSense__EditService jv:smallsense 'SmallSense-Core-Services' 0
 SmallSense::EditSupport SmallSense__EditSupport jv:smallsense 'SmallSense-Core-Services' 0
 SmallSense::Info SmallSense__Info jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
+SmallSense::JavaCompletionEngineEnvironmentResource SmallSense__JavaCompletionEngineEnvironmentResource jv:smallsense 'SmallSense-Tests' 1
 SmallSense::Manager SmallSense__Manager jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
 SmallSense::PO SmallSense__PO jv:smallsense 'SmallSense-Core-Interface-PO' 0
 SmallSense::ParseTreeIndex SmallSense__ParseTreeIndex jv:smallsense 'SmallSense-Core-Index' 0
@@ -31,36 +33,48 @@
 SmallSense::SmalltalkQuickFixer SmallSense__SmalltalkQuickFixer jv:smallsense 'SmallSense-Smalltalk-Lint' 0
 SmallSense::SmalltalkSyntaxHighlighter SmallSense__SmalltalkSyntaxHighlighter jv:smallsense 'SmallSense-Smalltalk' 3
 SmallSense::SmalltalkUnacceptedMethodEnvironment SmallSense__SmalltalkUnacceptedMethodEnvironment jv:smallsense 'SmallSense-Smalltalk-Lint' 0
-SmallSense::TestCase SmallSense__TestCase jv:smallsense 'SmallSense-Tests' 1
+SmallSense::TestCase SmallSense__TestCase jv:smallsense 'SmallSense-Tests-Obsolete' 1
+SmallSense::TokenPatternMatcher SmallSense__TokenPatternMatcher jv:smallsense 'SmallSense-Utils-Matcher' 0
+SmallSense::TokenPatternMatcherTests SmallSense__TokenPatternMatcherTests jv:smallsense 'SmallSense-Tests' 1
+SmallSense::TokenPatternParser SmallSense__TokenPatternParser jv:smallsense 'SmallSense-Utils-Matcher' 0
+SmallSense::TokenPatternToken SmallSense__TokenPatternToken jv:smallsense 'SmallSense-Utils-Matcher' 0
+SmallSense::TokenPatternTokenSet SmallSense__TokenPatternTokenSet jv:smallsense 'SmallSense-Utils-Matcher' 0
+SmallSense::TokenStream SmallSense__TokenStream jv:smallsense 'SmallSense-Utils-Matcher' 0
 SmallSense::Type SmallSense__Type jv:smallsense 'SmallSense-Smalltalk-Types' 0
 SmallSense::TypeHolder SmallSense__TypeHolder jv:smallsense 'SmallSense-Smalltalk-Types' 0
 jv_smallsense jv_smallsense jv:smallsense '* Projects & Packages *' 3
 SmallSense::AbstractSearchDialog SmallSense__AbstractSearchDialog jv:smallsense 'SmallSense-Core-Interface-Search' 3
+SmallSense::AbstractJavaCompletionEngine SmallSense__AbstractJavaCompletionEngine jv:smallsense 'SmallSense-Java' 0
+SmallSense::AbstractJavaCompletionEngineTests SmallSense__AbstractJavaCompletionEngineTests jv:smallsense 'SmallSense-Tests' 1
 SmallSense::ClassInfo SmallSense__ClassInfo jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
 SmallSense::ClassPO SmallSense__ClassPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
 SmallSense::ClassType SmallSense__ClassType jv:smallsense 'SmallSense-Smalltalk-Types' 0
 SmallSense::ConstantPO SmallSense__ConstantPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
-SmallSense::FinderTests SmallSense__FinderTests jv:smallsense 'SmallSense-Tests' 1
+SmallSense::FinderTests SmallSense__FinderTests jv:smallsense 'SmallSense-Tests-Obsolete' 1
 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::JavaImportPO SmallSense__JavaImportPO jv:smallsense 'SmallSense-Java-Interface-PO' 0
 SmallSense::MethodInfo SmallSense__MethodInfo jv:smallsense 'SmallSense-Smalltalk-Types-Info' 0
 SmallSense::MethodPO SmallSense__MethodPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
 SmallSense::PackagePO SmallSense__PackagePO jv:smallsense 'SmallSense-Core-Interface-PO' 0
-SmallSense::RecognizerTests SmallSense__RecognizerTests jv:smallsense 'SmallSense-Tests' 1
+SmallSense::RecognizerTests SmallSense__RecognizerTests jv:smallsense 'SmallSense-Tests-Obsolete' 1
 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
-SmallSense::SmalltalkParserTests SmallSense__SmalltalkParserTests jv:smallsense 'SmallSense-Tests' 1
+SmallSense::SmalltalkParserTests SmallSense__SmalltalkParserTests jv:smallsense 'SmallSense-Tests-Obsolete' 1
 SmallSense::SnippetPO SmallSense__SnippetPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
 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::ClassSearchDialog SmallSense__ClassSearchDialog jv:smallsense 'SmallSense-Core-Interface-Search' 3
-SmallSense::GroovyCompletionEngineSimple SmallSense__GroovyCompletionEngineSimple jv:smallsense 'SmallSense-Groovy' 0
+SmallSense::AbstractJavaCompletionEngineSimple SmallSense__AbstractJavaCompletionEngineSimple jv:smallsense 'SmallSense-Java' 2
+SmallSense::GroovyCompletionEngineSimpleTests SmallSense__GroovyCompletionEngineSimpleTests jv:smallsense 'SmallSense-Tests' 1
 SmallSense::GroovyEditSupport SmallSense__GroovyEditSupport jv:smallsense 'SmallSense-Groovy' 0
+SmallSense::JavaCompletionEngine SmallSense__JavaCompletionEngine jv:smallsense 'SmallSense-Java' 0
+SmallSense::JavaConstructorPO SmallSense__JavaConstructorPO jv:smallsense 'SmallSense-Java-Interface-PO' 0
 SmallSense::MethodKeywordRestPO SmallSense__MethodKeywordRestPO jv:smallsense 'SmallSense-Core-Interface-PO' 0
 SmallSense::MethodSearchDialog SmallSense__MethodSearchDialog jv:smallsense 'SmallSense-Core-Interface-Search' 3
 SmallSense::PackageSearchDialog SmallSense__PackageSearchDialog jv:smallsense 'SmallSense-Core-Interface-Search' 3
+SmallSense::JavaCompletionEngineSimple SmallSense__JavaCompletionEngineSimple jv:smallsense 'SmallSense-Java' 2
+SmallSense::GroovyCompletionEngineSimple SmallSense__GroovyCompletionEngineSimple jv:smallsense 'SmallSense-Groovy' 2
--- a/bc.mak	Sat May 10 12:08:16 2014 +0100
+++ b/bc.mak	Thu Jun 19 11:33:05 2014 +0100
@@ -34,7 +34,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libhtml -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libwidg2
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\goodies\regex -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libhtml -I$(INCLUDE_TOP)\stx\libjava -I$(INCLUDE_TOP)\stx\libjava\tools -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libwidg2
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
@@ -53,6 +53,7 @@
 	pushd ..\..\stx\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\goodies\refactoryBrowser\helpers & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\goodies\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\stx\goodies\regex & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
 	pushd ..\..\stx\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
@@ -93,7 +94,7 @@
 $(OUTDIR)SmallSense__CompletionController.$(O) SmallSense__CompletionController.$(H): SmallSense__CompletionController.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextViewCompletionSupport.$(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\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SortedCollection.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__CompletionView.$(O) SmallSense__CompletionView.$(H): SmallSense__CompletionView.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__CompletionView.$(O) SmallSense__CompletionView.$(H): SmallSense__CompletionView.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__CriticsWindow.$(O) SmallSense__CriticsWindow.$(H): SmallSense__CriticsWindow.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__EditService.$(O) SmallSense__EditService.$(H): SmallSense__EditService.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__EditSupport.$(O) SmallSense__EditSupport.$(H): SmallSense__EditSupport.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -115,16 +116,21 @@
 $(OUTDIR)SmallSense__SmalltalkQuickFixer.$(O) SmallSense__SmalltalkQuickFixer.$(H): SmallSense__SmalltalkQuickFixer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkSyntaxHighlighter.$(O) SmallSense__SmalltalkSyntaxHighlighter.$(H): SmallSense__SmalltalkSyntaxHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__SmalltalkUnacceptedMethodEnvironment.$(O) SmallSense__SmalltalkUnacceptedMethodEnvironment.$(H): SmallSense__SmalltalkUnacceptedMethodEnvironment.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers\BrowserEnvironment.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternMatcher.$(O) SmallSense__TokenPatternMatcher.$(H): SmallSense__TokenPatternMatcher.st $(INCLUDE_TOP)\stx\goodies\regex\RxMatcher.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternParser.$(O) SmallSense__TokenPatternParser.$(H): SmallSense__TokenPatternParser.st $(INCLUDE_TOP)\stx\goodies\regex\RxCharSetParser.$(H) $(INCLUDE_TOP)\stx\goodies\regex\RxParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternToken.$(O) SmallSense__TokenPatternToken.$(H): SmallSense__TokenPatternToken.st $(INCLUDE_TOP)\stx\goodies\regex\RxsNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenPatternTokenSet.$(O) SmallSense__TokenPatternTokenSet.$(H): SmallSense__TokenPatternTokenSet.st $(INCLUDE_TOP)\stx\goodies\regex\RxsCharSet.$(H) $(INCLUDE_TOP)\stx\goodies\regex\RxsNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__TokenStream.$(O) SmallSense__TokenStream.$(H): SmallSense__TokenStream.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__Type.$(O) SmallSense__Type.$(H): SmallSense__Type.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__TypeHolder.$(O) SmallSense__TypeHolder.$(H): SmallSense__TypeHolder.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)jv_smallsense.$(O) jv_smallsense.$(H): jv_smallsense.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__AbstractSearchDialog.$(O) SmallSense__AbstractSearchDialog.$(H): SmallSense__AbstractSearchDialog.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__AbstractJavaCompletionEngine.$(O) SmallSense__AbstractJavaCompletionEngine.$(H): SmallSense__AbstractJavaCompletionEngine.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ClassInfo.$(O) SmallSense__ClassInfo.$(H): SmallSense__ClassInfo.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__Info.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ClassPO.$(O) SmallSense__ClassPO.$(H): SmallSense__ClassPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(STCHDR)
 $(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\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(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__JavaImportPO.$(O) SmallSense__JavaImportPO.$(H): SmallSense__JavaImportPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(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)
@@ -139,12 +145,17 @@
 $(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\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__ClassSearchDialog.$(O) SmallSense__ClassSearchDialog.$(H): SmallSense__ClassSearchDialog.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__AbstractJavaCompletionEngineSimple.$(O) SmallSense__AbstractJavaCompletionEngineSimple.$(H): SmallSense__AbstractJavaCompletionEngineSimple.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractJavaCompletionEngine.$(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__EditSupport.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__JavaEditSupport.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaCompletionEngine.$(O) SmallSense__JavaCompletionEngine.$(H): SmallSense__JavaCompletionEngine.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaConstructorPO.$(O) SmallSense__JavaConstructorPO.$(H): SmallSense__JavaConstructorPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__MethodPO.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodKeywordRestPO.$(O) SmallSense__MethodKeywordRestPO.$(H): SmallSense__MethodKeywordRestPO.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__MethodPO.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__PO.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__MethodSearchDialog.$(O) SmallSense__MethodSearchDialog.$(H): SmallSense__MethodSearchDialog.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)SmallSense__PackageSearchDialog.$(O) SmallSense__PackageSearchDialog.$(H): SmallSense__PackageSearchDialog.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBTransformationRule.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libcomp\AssignmentNode.$(H) $(INCLUDE_TOP)\stx\libcomp\BlockNode.$(H) $(INCLUDE_TOP)\stx\libcomp\MessageNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseErrorNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimaryNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimitiveNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ReturnNode.$(H) $(INCLUDE_TOP)\stx\libcomp\StatementNode.$(H) $(INCLUDE_TOP)\stx\libcomp\VariableNode.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentFrame.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentView.$(H) $(INCLUDE_TOP)\stx\libtool\SystemBrowser.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NavigationState.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\ModalBox.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\StandardSystemView.$(H) $(INCLUDE_TOP)\stx\libview\TopView.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libwidg\DialogBox.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextView.$(H) $(INCLUDE_TOP)\stx\libwidg\ListView.$(H) $(INCLUDE_TOP)\stx\libwidg\TextCollector.$(H) $(INCLUDE_TOP)\stx\libwidg\TextView.$(H) $(INCLUDE_TOP)\stx\libwidg\Workspace.$(H) $(INCLUDE_TOP)\stx\libwidg2\DoWhatIMeanSupport.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__JavaCompletionEngineSimple.$(O) SmallSense__JavaCompletionEngineSimple.$(H): SmallSense__JavaCompletionEngineSimple.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\jv\smallsense\SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBTransformationRule.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libcomp\AssignmentNode.$(H) $(INCLUDE_TOP)\stx\libcomp\BlockNode.$(H) $(INCLUDE_TOP)\stx\libcomp\MessageNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseErrorNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimaryNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimitiveNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ReturnNode.$(H) $(INCLUDE_TOP)\stx\libcomp\StatementNode.$(H) $(INCLUDE_TOP)\stx\libcomp\VariableNode.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentFrame.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentView.$(H) $(INCLUDE_TOP)\stx\libtool\SystemBrowser.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NavigationState.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextView.$(H) $(INCLUDE_TOP)\stx\libwidg\ListView.$(H) $(INCLUDE_TOP)\stx\libwidg\TextCollector.$(H) $(INCLUDE_TOP)\stx\libwidg\TextView.$(H) $(INCLUDE_TOP)\stx\libwidg\Workspace.$(H) $(INCLUDE_TOP)\stx\libwidg2\DoWhatIMeanSupport.$(H) $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
 
--- a/jv_smallsense.st	Sat May 10 12:08:16 2014 +0100
+++ b/jv_smallsense.st	Thu Jun 19 11:33:05 2014 +0100
@@ -25,6 +25,23 @@
     "Modified: / 02-09-2013 / 12:29:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!jv_smallsense class methodsFor:'accessing - tests'!
+
+excludedFromTestSuite
+    "List of testcases and/or tests excluded from testsuite.
+     Entries maybe ClassName or #(ClassName testName)
+    "
+    ^ #(
+        #'SmallSense::BaseTestClass'
+        #'SmallSense::TestCase'
+        #'SmallSense::FinderTests'
+        #'SmallSense::RecognizerTests'
+        #'SmallSense::SmalltalkParserTests'
+    )
+
+    "Created: / 23-05-2014 / 12:49:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !jv_smallsense class methodsFor:'description'!
 
 excludedFromPreRequisites
@@ -46,7 +63,8 @@
     ^ #(
         #'stx:goodies/refactoryBrowser/helpers'    "BrowserEnvironment - superclass of SmallSense::SmalltalkUnacceptedMethodEnvironment "
         #'stx:goodies/refactoryBrowser/lint'    "RBLintRule - extended "
-        #'stx:goodies/sunit'    "TestAsserter - superclass of SmallSense::BaseTestClass "
+        #'stx:goodies/regex'    "Regex::RxCharSetParser - superclass of SmallSense::TokenPatternParser::TokenSpecParser "
+        #'stx:goodies/sunit'    "TestAsserter - superclass of SmallSense::AbstractJavaCompletionEngineTests "
         #'stx:libbasic'    "Collection - extended "
         #'stx:libcomp'    "AbstractSyntaxHighlighter - superclass of SmallSense::SmalltalkParser "
         #'stx:libhtml'    "HTMLDocumentFrame - extended "
@@ -58,32 +76,6 @@
     )
 !
 
-preRequisites
-    "list all required packages.
-     This list can be maintained manually or (better) generated and
-     updated by scanning the superclass hierarchies and looking for
-     global variable accesses. (the browser has a menu function for that)
-     Howevery, often too much is found, and you may want to explicitely
-     exclude individual packages in the #excludedFromPrerequisites method."
-
-    ^ #(
-        #'stx:goodies/refactoryBrowser/helpers'    "BrowserEnvironment - superclass of SmallSenseUnacceptedMethodEnvironment "
-        #'stx:goodies/refactoryBrowser/lint'    "RBLintRule - superclass of extended RBTransformationRule "
-        #'stx:goodies/roeltyper'    "TypeCollector - superclass of SmallSenseTypeCollector "
-        #'stx:goodies/sunit'
-        #'stx:libbasic'    "Collection - superclass of SmallSenseTypeCollectorCache "
-        #'stx:libbasic2'    "CacheDictionary - superclass of SmallSenseTypeCollectorCache "
-        #'stx:libbasic3'    "ChangeSet - referenced by RBTransformationRule>>fixes: "
-        #'stx:libcomp'    "Parser - superclass of SmallSenseAbstractInstvarInterfaceExtractor "
-        #'stx:libhtml'    "HTMLDocumentFrame - superclass of extended HTMLDocumentView "
-        #'stx:libtool'    "Tools::BackgroundSourceProcessingService - superclass of SmallSenseService "
-        #'stx:libview'    "DeviceGraphicsContext - superclass of extended HTMLDocumentFrame "
-        #'stx:libview2'    "SimpleDialog - superclass of SmallSenseCompletionWindow "
-        #'stx:libwidg'
-        #'stx:libwidg2'    "HierarchicalItem - superclass of SmallSenseParseNodeInspector::ParseNodeItem "
-    )
-!
-
 referencedPreRequisites
     "list packages which are a prerequisite, because they contain
      classes which are referenced by my classes.
@@ -95,8 +87,8 @@
         #'stx:goodies/refactoryBrowser/parser'    "RBFormatter - referenced by SmallSense::SmalltalkEditSupport>>electricInsertSnippetAfterDoubleColon "
         #'stx:libbasic2'    "BackgroundJob - referenced by SmallSense::AbstractSearchDialog>>initialize "
         #'stx:libbasic3'    "ChangeSet - referenced by RBTransformationRule>>fixes: "
-        #'stx:libjava'    "JavaClass - referenced by SmallSense::CodeNavigationService::Navigator>>navigateToTypeReference: "
-        #'stx:libjava/tools'    "JavaScanner - referenced by SmallSense::JavaCompletionEngineSimple>>completeSimple "
+        #'stx:libjava'    "Java - referenced by SmallSense::JavaCompletionEngineEnvironmentResource>>tearDown "
+        #'stx:libjava/tools'    "GroovyScanner - referenced by SmallSense::GroovyCompletionEngineSimple>>scannerClass "
     )
 !
 
@@ -168,12 +160,14 @@
         #'SmallSense::CompletionContext'
         #'SmallSense::CompletionController'
         #'SmallSense::CompletionEngine'
+        (#'SmallSense::CompletionEngineTests' autoload)
         #'SmallSense::CompletionResult'
         #'SmallSense::CompletionView'
         #'SmallSense::CriticsWindow'
         #'SmallSense::EditService'
         #'SmallSense::EditSupport'
         #'SmallSense::Info'
+        (#'SmallSense::JavaCompletionEngineEnvironmentResource' autoload)
         #'SmallSense::Manager'
         #'SmallSense::PO'
         #'SmallSense::ParseTreeIndex'
@@ -192,17 +186,24 @@
         #'SmallSense::SmalltalkSyntaxHighlighter'
         #'SmallSense::SmalltalkUnacceptedMethodEnvironment'
         (#'SmallSense::TestCase' autoload)
+        #'SmallSense::TokenPatternMatcher'
+        (#'SmallSense::TokenPatternMatcherTests' autoload)
+        #'SmallSense::TokenPatternParser'
+        #'SmallSense::TokenPatternToken'
+        #'SmallSense::TokenPatternTokenSet'
+        #'SmallSense::TokenStream'
         #'SmallSense::Type'
         #'SmallSense::TypeHolder'
         #'jv_smallsense'
         #'SmallSense::AbstractSearchDialog'
+        #'SmallSense::AbstractJavaCompletionEngine'
+        (#'SmallSense::AbstractJavaCompletionEngineTests' autoload)
         #'SmallSense::ClassInfo'
         #'SmallSense::ClassPO'
         #'SmallSense::ClassType'
         #'SmallSense::ConstantPO'
         (#'SmallSense::FinderTests' autoload)
         #'SmallSense::GenericEditSupport'
-        #'SmallSense::JavaCompletionEngineSimple'
         #'SmallSense::JavaEditSupport'
         #'SmallSense::JavaImportPO'
         #'SmallSense::MethodInfo'
@@ -219,11 +220,16 @@
         #'SmallSense::UnknownType'
         #'SmallSense::VariablePO'
         #'SmallSense::ClassSearchDialog'
-        #'SmallSense::GroovyCompletionEngineSimple'
+        #'SmallSense::AbstractJavaCompletionEngineSimple'
+        (#'SmallSense::GroovyCompletionEngineSimpleTests' autoload)
         #'SmallSense::GroovyEditSupport'
+        #'SmallSense::JavaCompletionEngine'
+        #'SmallSense::JavaConstructorPO'
         #'SmallSense::MethodKeywordRestPO'
         #'SmallSense::MethodSearchDialog'
         #'SmallSense::PackageSearchDialog'
+        #'SmallSense::JavaCompletionEngineSimple'
+        #'SmallSense::GroovyCompletionEngineSimple'
     )
 !
 
@@ -343,8 +349,12 @@
     "Swizzle all methods annotated as <swizzle:>"
 
     Swizzled ifTrue:[ ^ self ].
-    self extensionMethods do:[:m|self swizzle: m].
-    Swizzled := true.
+    [
+        self extensionMethods do:[:m|self swizzle: m].
+        Swizzled := true.
+    ] on: Error do:[:ex |
+        Logger log: ('Cannot swizzle: %1' bindWith: ex description) severity: #error
+    ].
 
 
     "
--- a/libInit.cc	Sat May 10 12:08:16 2014 +0100
+++ b/libInit.cc	Thu Jun 19 11:33:05 2014 +0100
@@ -56,16 +56,21 @@
 _SmallSense__SmalltalkQuickFixer_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkSyntaxHighlighter_Init(pass,__pRT__,snd);
 _SmallSense__SmalltalkUnacceptedMethodEnvironment_Init(pass,__pRT__,snd);
+_SmallSense__TokenPatternMatcher_Init(pass,__pRT__,snd);
+_SmallSense__TokenPatternParser_Init(pass,__pRT__,snd);
+_SmallSense__TokenPatternToken_Init(pass,__pRT__,snd);
+_SmallSense__TokenPatternTokenSet_Init(pass,__pRT__,snd);
+_SmallSense__TokenStream_Init(pass,__pRT__,snd);
 _SmallSense__Type_Init(pass,__pRT__,snd);
 _SmallSense__TypeHolder_Init(pass,__pRT__,snd);
 _jv_137smallsense_Init(pass,__pRT__,snd);
 _SmallSense__AbstractSearchDialog_Init(pass,__pRT__,snd);
+_SmallSense__AbstractJavaCompletionEngine_Init(pass,__pRT__,snd);
 _SmallSense__ClassInfo_Init(pass,__pRT__,snd);
 _SmallSense__ClassPO_Init(pass,__pRT__,snd);
 _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__JavaImportPO_Init(pass,__pRT__,snd);
 _SmallSense__MethodInfo_Init(pass,__pRT__,snd);
@@ -80,11 +85,15 @@
 _SmallSense__UnknownType_Init(pass,__pRT__,snd);
 _SmallSense__VariablePO_Init(pass,__pRT__,snd);
 _SmallSense__ClassSearchDialog_Init(pass,__pRT__,snd);
-_SmallSense__GroovyCompletionEngineSimple_Init(pass,__pRT__,snd);
+_SmallSense__AbstractJavaCompletionEngineSimple_Init(pass,__pRT__,snd);
 _SmallSense__GroovyEditSupport_Init(pass,__pRT__,snd);
+_SmallSense__JavaCompletionEngine_Init(pass,__pRT__,snd);
+_SmallSense__JavaConstructorPO_Init(pass,__pRT__,snd);
 _SmallSense__MethodKeywordRestPO_Init(pass,__pRT__,snd);
 _SmallSense__MethodSearchDialog_Init(pass,__pRT__,snd);
 _SmallSense__PackageSearchDialog_Init(pass,__pRT__,snd);
+_SmallSense__JavaCompletionEngineSimple_Init(pass,__pRT__,snd);
+_SmallSense__GroovyCompletionEngineSimple_Init(pass,__pRT__,snd);
 
 _jv_137smallsense_extensions_Init(pass,__pRT__,snd);
 __END_PACKAGE__();
--- a/smallsense.rc	Sat May 10 12:08:16 2014 +0100
+++ b/smallsense.rc	Thu Jun 19 11:33:05 2014 +0100
@@ -4,7 +4,7 @@
 //
 VS_VERSION_INFO VERSIONINFO
   FILEVERSION     6,2,32767,32767
-  PRODUCTVERSION  6,2,3,0
+  PRODUCTVERSION  6,2,4,0
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
   FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
@@ -24,8 +24,8 @@
       VALUE "InternalName", "jv:smallsense\0"
       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", "Sat, 10 May 2014 11:05:47 GMT\0"
+      VALUE "ProductVersion", "6.2.4.0\0"
+      VALUE "ProductDate", "Fri, 13 Jun 2014 23:27:23 GMT\0"
     END
 
   END