SmallSense__CompletionEngineTests.st
author convert-repo
Wed, 11 Dec 2019 04:28:36 +0000
changeset 1116 b51ace366efc
parent 447 2d45c613a5bd
permissions -rw-r--r--
update tags
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
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 273
diff changeset
     5
Copyright (C) 2013-2015 Jan Vrany
252
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
395
25ed27eaeaae Completion: added support for SmallSense completion in an inspector views.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    26
	instanceVariableNames:'engine context result codeView'
234
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
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 273
diff changeset
    37
Copyright (C) 2013-2015 Jan Vrany
252
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>"
447
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    79
!
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    80
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    81
completionLanguage
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    82
    ^ self subclassResponsibility
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    83
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    84
    "Created: / 07-03-2015 / 10:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
! !
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
!CompletionEngineTests methodsFor:'running'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
setUp
395
25ed27eaeaae Completion: added support for SmallSense completion in an inspector views.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    90
    | service support  |
25ed27eaeaae Completion: added support for SmallSense completion in an inspector views.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    91
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    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
    93
    codeView := Tools::CodeView2 new.
447
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
    94
    codeView languageHolder value: self completionLanguage.
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
    service := EditService new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
    service registerIn: codeView.  
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    support := GenericEditSupport new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    service updateSupport: support.  
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
    context := CompletionContext new.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    context support: support.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
    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
   102
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
    "Created: / 22-05-2014 / 16:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
447
2d45c613a5bd Completion: fix in Smalltalk completion - include last double colon for keyword selectors
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 395
diff changeset
   104
    "Modified: / 07-03-2015 / 10:36:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
!
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
tearDown
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
    engine := context := nil
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
    "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
   111
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
!CompletionEngineTests methodsFor:'utilities'!
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
complete: aString
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
     | list textView |
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
    list := aString asStringCollection.
395
25ed27eaeaae Completion: added support for SmallSense completion in an inspector views.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   119
    textView := codeView textView.
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
    textView list: list.
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
    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
   122
        | line cursorCol |
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
        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
   125
        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
   126
        cursorCol ~~ 0 ifTrue:[ 
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
            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
   128
            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
   129
            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
   130
        ].
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
    ].
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
    ^ 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
   133
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
    "Created: / 22-05-2014 / 16:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
395
25ed27eaeaae Completion: added support for SmallSense completion in an inspector views.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   135
    "Modified: / 12-02-2015 / 00:10:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
234
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
! !
97857872ee47 Initial set of tests for GroovyCompletionEngineSimple (along with some fixes)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
238
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   138
!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
   139
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   140
version_HG
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   141
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   142
    ^ '$Changeset: <not expanded> $'
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   143
! !
d5a32e41181f Fixes for token matcher: correctly (re)set position backwards.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 234
diff changeset
   144