Tools__CodeCompletionService.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 29 Aug 2013 12:20:29 +0100
branchjv
changeset 13468 444ac2aa4fd6
parent 13250 0decde6c459d
child 13491 b3afe831ff0a
permissions -rw-r--r--
Hack: do not include Java language in language-menu. Java is funny - we don't have an evaluator for Java but we have to define evaluatorClass to return GroovyEvaluator to be able to inspect code in debugger/inspector. Hence this hack. We may need something like evaluatorClassForInspector/Debugger.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10075
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     2
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     3
              All Rights Reserved
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10075
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     5
Permission is hereby granted, free of charge, to any person
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     6
obtaining a copy of this software and associated documentation
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     7
files (the 'Software'), to deal in the Software without
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     8
restriction, including without limitation the rights to use,
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
     9
copy, modify, merge, publish, distribute, sublicense, and/or sell
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    10
copies of the Software, and to permit persons to whom the
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    11
Software is furnished to do so, subject to the following
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    12
conditions:
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    13
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    14
The above copyright notice and this permission notice shall be
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    15
included in all copies or substantial portions of the Software.
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    16
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    19
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    21
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    22
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    23
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    24
OTHER DEALINGS IN THE SOFTWARE.
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
CodeViewService subclass:#CodeCompletionService
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	instanceVariableNames:''
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
	classVariableNames:''
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
	poolDictionaries:''
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
	category:'Interface-CodeView'
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!CodeCompletionService class methodsFor:'documentation'!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
copyright
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
10075
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    41
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    42
              All Rights Reserved
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    43
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    44
Permission is hereby granted, free of charge, to any person
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    45
obtaining a copy of this software and associated documentation
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    46
files (the 'Software'), to deal in the Software without
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    47
restriction, including without limitation the rights to use,
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    48
copy, modify, merge, publish, distribute, sublicense, and/or sell
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    49
copies of the Software, and to permit persons to whom the
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    50
Software is furnished to do so, subject to the following
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    51
conditions:
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
10075
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    53
The above copyright notice and this permission notice shall be
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    54
included in all copies or substantial portions of the Software.
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    55
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    56
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    57
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    58
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    59
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    60
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    61
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    62
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9678631201b9 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9981
diff changeset
    63
OTHER DEALINGS IN THE SOFTWARE.
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!CodeCompletionService class methodsFor:'accessing'!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
label
13100
ee16ab69a969 class: Tools::LintService
Claus Gittinger <cg@exept.de>
parents: 10413
diff changeset
    70
    "Answers a short label - for UI"
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    ^'Code Completion'
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "Created: / 07-03-2010 / 14:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
! !
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
!CodeCompletionService class methodsFor:'testing'!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
isAvailable
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    "CodeCompletionService is superseded by SmallSense"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
10259
45e2c87eddaf Merged with JV's branch
vrany
parents: 10075
diff changeset
    83
    "^(Smalltalk at:#SmallSenseService) isNil"
45e2c87eddaf Merged with JV's branch
vrany
parents: 10075
diff changeset
    84
10274
baa3a285f686 changed: #isAvailable
Claus Gittinger <cg@exept.de>
parents: 10259
diff changeset
    85
    "Sure, it is broken, but we need it!!"
10302
c24d8afc3661 changed: #isAvailable
vrany
parents: 10274
diff changeset
    86
    "JV2011-07-09: And I preferr SmallSense: this should work for both
c24d8afc3661 changed: #isAvailable
vrany
parents: 10274
diff changeset
    87
     unless SmallSense is loaded in your image"
10259
45e2c87eddaf Merged with JV's branch
vrany
parents: 10075
diff changeset
    88
10302
c24d8afc3661 changed: #isAvailable
vrany
parents: 10274
diff changeset
    89
    ^(Smalltalk at:#SmallSenseService) isNil.
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    "Created: / 03-04-2011 / 23:08:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10274
baa3a285f686 changed: #isAvailable
Claus Gittinger <cg@exept.de>
parents: 10259
diff changeset
    92
    "Modified: / 08-07-2011 / 08:42:52 / cg"
10413
87cc499c0b60 Fixes for debugger
vrany
parents: 10302
diff changeset
    93
    "Modified: / 27-07-2011 / 11:47:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13204
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
    94
!
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
    95
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
    96
isUsefulFor:aCodeView
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
    97
    "this filters useful services.
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
    98
     Redefined to return true for myself - not for subclasses"
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
    99
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
   100
    ^ self == Tools::CodeCompletionService
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
   101
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
   102
    "Created: / 22-07-2013 / 13:59:54 / cg"
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
! !
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
!CodeCompletionService methodsFor:'event handling'!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
keyPress: key x:x y:y in: view
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    "Handles an event in given view (a subview of codeView).
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
     If the method returns true, the event will not be processed
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
     by the view."
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    (view == textView and:[key == #'CodeCompletion']) ifTrue:
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
        [self complete. ^true].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    ^false
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    "Created: / 07-03-2010 / 09:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
! !
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!CodeCompletionService methodsFor:'private'!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
complete
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    |cls 
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
"/     crsrPos interval node checkedNode
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
"/     char start stop selectorSoFar matchingSelectors
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    |
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    codeView languageHolder value == SmalltalkLanguage instance   
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
        ifFalse:[^self].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    cls := codeView classHolder value.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    cls isNil ifTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
        self showInfo:'No class'.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
        ^ self.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    UserInformation handle:[:ex |
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
        codeView showInfo:(ex messageText).
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
        ex proceed.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    ] do:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        codeView withWaitCursorDo:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
            DoWhatIMeanSupport codeCompletionForClass:cls codeView:textView.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        ]
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    ^ self.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
"/
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
"/    interval := self selectedInterval.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
"/    interval isEmpty ifTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
"/        crsrPos := codeView characterPositionOfCursor - 1.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
"/        char := codeView characterUnderCursor.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
"/        [crsrPos > 1 and:[char isSeparator or:['.' includes:char]]] whileTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
"/            crsrPos := crsrPos - 1.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
"/            char := codeView characterAtCharacterPosition:crsrPos.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
"/        ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
"/        interval := crsrPos to:crsrPos.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
"/    ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
"/
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
"/    node := self findNodeForInterval:interval allowErrors:true.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
"/    [node isNil] whileTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
"/        "/ expand to the left ...
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
"/        interval start > 1 ifFalse:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
"/            self showInfo:'No parseNode found'.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
"/            ^ self.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
"/        ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
"/        interval start:(interval start - 1).
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
"/        node := self findNodeForInterval:interval allowErrors:true.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
"/    ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
"/
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
"/    node isVariable ifTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
"/        self codeCompletionForVariable:node inClass:cls.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
"/        ^ self.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
"/    ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
"/
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
"/    checkedNode := node.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
"/    [checkedNode notNil] whileTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
"/        checkedNode isMessage ifTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
"/            self codeCompletionForMessage:checkedNode inClass:cls.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
"/            ^ self
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
"/        ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
"/        checkedNode isMethod ifTrue:[
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
"/            self codeCompletionForMethod:checkedNode inClass:cls.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
"/            ^ self.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
"/        ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
"/        checkedNode := checkedNode parent.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
"/    ].
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
"/
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
"/    self showInfo:'Node is neither variable nor message.'.
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    "Modified: / 04-07-2006 / 18:48:26 / fm"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    "Modified: / 20-11-2006 / 12:30:59 / cg"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "Created: / 07-03-2010 / 09:37:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
! !
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!CodeCompletionService class methodsFor:'documentation'!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
version_CVS
13204
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
   197
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeCompletionService.st,v 1.8 2013-07-22 12:02:14 cg Exp $'
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   200
version_HG
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   201
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   202
    ^ '$Changeset: <not expanded> $'
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   203
!
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   204
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
version_SVN
13204
7dbb1dd9c4af class: Tools::XXXService
Claus Gittinger <cg@exept.de>
parents: 13100
diff changeset
   206
    ^ '$Id: Tools__CodeCompletionService.st,v 1.8 2013-07-22 12:02:14 cg Exp $'
9981
eae0ede9097e initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
! !
13100
ee16ab69a969 class: Tools::LintService
Claus Gittinger <cg@exept.de>
parents: 10413
diff changeset
   208