SmallSense__CompletionEngineTests.st
author Claus Gittinger <cg@exept.de>
Fri, 18 Nov 2016 11:56:15 +0100
branchcvs_MAIN
changeset 996 f5c13fa1943d
parent 273 404662b42ddf
child 374 e65bd2bf892a
permissions -rw-r--r--
#OTHER by cg documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Encoding: utf8 }"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     3
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     4
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     5
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     6
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     7
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     8
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     9
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    10
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    11
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    12
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    13
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    15
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    16
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    17
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    18
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    20
"
249
8bc64027b189 Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 238
diff changeset
    21
"{ Package: 'stx:goodies/smallsense' }"
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
"{ NameSpace: SmallSense }"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
273
404662b42ddf Added AbstractTestCase which saves/restores preferences in setUp/tearDown...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    25
AbstractTestCase subclass:#CompletionEngineTests
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	instanceVariableNames:'engine context result'
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	classVariableNames:''
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
	poolDictionaries:''
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
	category:'SmallSense-Tests'
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    32
!CompletionEngineTests class methodsFor:'documentation'!
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    33
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    34
copyright
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    35
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    36
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    37
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    38
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    39
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    41
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    42
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    43
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    44
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    47
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    48
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    50
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    52
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    53
! !
238
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
    54
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
!CompletionEngineTests class methodsFor:'queries'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
isAbstract
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    "Return if this class is an abstract class.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
     True is returned here for myself only; false for subclasses.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
     Abstract subclasses must redefine again."
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    ^ self == SmallSense::CompletionEngineTests.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
!CompletionEngineTests methodsFor:'accessing'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
environment
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
   ^ Smalltalk
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    "Created: / 22-05-2014 / 16:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
!CompletionEngineTests methodsFor:'accessing-classes'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
completionEngineClass
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    ^ self subclassResponsibility
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    "Created: / 22-05-2014 / 16:38:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
!CompletionEngineTests methodsFor:'running'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
setUp
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
    | service support codeView |
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
    engine := self completionEngineClass new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
    codeView := Tools::CodeView2 new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
    service := EditService new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
    service registerIn: codeView.  
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
    support := GenericEditSupport new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
    service updateSupport: support.  
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    context := CompletionContext new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    context support: support.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
    context environment: self environment.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
    "Created: / 22-05-2014 / 16:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
tearDown
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    engine := context := nil
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    "Created: / 22-05-2014 / 16:51:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
!CompletionEngineTests methodsFor:'utilities'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
complete: aString
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
     | list textView |
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
    list := aString asStringCollection.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
    textView := context codeView textView.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
    textView list: list.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
    1 to: list size do:[:i |  
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
        | line cursorCol |
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
        line := list at: i.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
        cursorCol := line indexOf: '┃' first.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
        cursorCol ~~ 0 ifTrue:[ 
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
            line := (line copyTo: cursorCol - 1) , (line copyFrom: cursorCol + 1).
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
            list at: i put: line.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
            textView setCursorLine: i; setCursorCol: cursorCol.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
        ].
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
    ].
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
    ^ result := engine complete: context
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
    "Created: / 22-05-2014 / 16:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
238
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   129
!CompletionEngineTests class methodsFor:'documentation'!
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   130
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   131
version_HG
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   132
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   133
    ^ '$Changeset: <not expanded> $'
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   134
! !
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   135