SmallSense__EditService.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 25 Oct 2017 23:42:41 +0100
changeset 1058 6d4bf422a7dd
parent 1027 13a835555b48
child 1072 a44c741ee5ef
permissions -rw-r--r--
Fix subscript out of bounds error in Smalltalk inderences ...caused by missing size-check when analysing typed prefix.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     1
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     2
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 308
diff changeset
     3
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
     4
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     5
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
     6
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
     7
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
     8
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
     9
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    10
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
    11
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
    12
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
    13
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
    14
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    15
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
    16
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
    17
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
    18
"
249
8bc64027b189 Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 237
diff changeset
    19
"{ Package: 'stx:goodies/smallsense' }"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
"{ NameSpace: SmallSense }"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
Tools::CodeViewService subclass:#EditService
205
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
    24
	instanceVariableNames:'environment support'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	classVariableNames:''
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
67
020b7461b15e Package structure reorganization.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 64
diff changeset
    27
	category:'SmallSense-Core-Services'
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    30
!EditService class methodsFor:'documentation'!
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    31
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    32
copyright
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
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 308
diff changeset
    35
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
    36
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    37
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
    38
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
    39
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
    40
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
    41
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    42
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
    43
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
    44
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
    45
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
    46
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    47
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
    48
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
    49
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
    50
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    51
! !
83
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
    52
86
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    53
!EditService class methodsFor:'initialization'!
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    54
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    55
initialize
173
7c742ed3ed6a - SmallSense::EditService
Claus Gittinger
parents: 108
diff changeset
    56
    Smalltalk addStartBlock:[
7c742ed3ed6a - SmallSense::EditService
Claus Gittinger
parents: 108
diff changeset
    57
        Screen current notNil ifTrue:[
7c742ed3ed6a - SmallSense::EditService
Claus Gittinger
parents: 108
diff changeset
    58
            | map |
1027
13a835555b48 Keyboard mapping: code updated to catch up with `KeyboardMap`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 458
diff changeset
    59
            
173
7c742ed3ed6a - SmallSense::EditService
Claus Gittinger
parents: 108
diff changeset
    60
            map := Screen current keyboardMap.
1027
13a835555b48 Keyboard mapping: code updated to catch up with `KeyboardMap`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 458
diff changeset
    61
            (map bindingForLogical:#CodeCompletion) isNil ifTrue:[
13a835555b48 Keyboard mapping: code updated to catch up with `KeyboardMap`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 458
diff changeset
    62
                (map hasMappingFor: #'Ctrl ') ifFalse:[
13a835555b48 Keyboard mapping: code updated to catch up with `KeyboardMap`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 458
diff changeset
    63
                    map bindValue:#CodeCompletion to: #'Ctrl '.
13a835555b48 Keyboard mapping: code updated to catch up with `KeyboardMap`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 458
diff changeset
    64
                ].
173
7c742ed3ed6a - SmallSense::EditService
Claus Gittinger
parents: 108
diff changeset
    65
            ].
7c742ed3ed6a - SmallSense::EditService
Claus Gittinger
parents: 108
diff changeset
    66
       ]
86
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    67
    ]
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    68
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    69
    "Created: / 17-09-2013 / 15:23:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    70
! !
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    71
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
!EditService class methodsFor:'accessing'!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
label
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
    "Answers a short label - for UI"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
    ^'SmallSense - Edit Support'
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
    "Created: / 27-07-2013 / 22:35:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
308
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    82
!EditService class methodsFor:'testing'!
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    83
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    84
isAvailable
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    85
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    86
    ^false
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    87
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    88
    "Created: / 28-11-2014 / 15:41:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    89
!
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
308
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    91
isAvailableFor: applicationClass
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
308
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    93
    "Returns true if given service may be used in
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    94
     given application class."
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
308
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    96
    ^false
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    97
8a605d737807 Removed all but one swizzled methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
    98
    "Created: / 28-11-2014 / 15:41:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
205
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   101
!EditService methodsFor:'accessing'!
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   102
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   103
environment
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   104
    "Return an system environment for completion."
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   105
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   106
    ^ environment ? Smalltalk
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   107
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   108
    "Modified: / 13-05-2014 / 12:02:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   109
!
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   110
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   111
environment:aSystemEnvironment
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   112
    "Sets an envirronment for completion. Only classes and/or methods in
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   113
     the environment are offered for completion"
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   114
    environment := aSystemEnvironment.
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   115
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   116
    "Modified (comment): / 13-05-2014 / 11:55:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
218
0f5b160ecb9d Let the CompletionController itself to instantiate completion engine.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
   117
!
0f5b160ecb9d Let the CompletionController itself to instantiate completion engine.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
   118
0f5b160ecb9d Let the CompletionController itself to instantiate completion engine.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
   119
support
0f5b160ecb9d Let the CompletionController itself to instantiate completion engine.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
   120
    ^ support
205
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   121
! !
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   122
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
!EditService methodsFor:'accessing-views'!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
codeView
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
    ^ codeView
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
gutterView
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
    ^ gutterView
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
textView
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
    ^ textView
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
!EditService methodsFor:'change & update'!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
update:something with:aParameter from:changedObject
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
    "Invoked when an object that I depend upon sends a change notification."
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
    changedObject == codeView ifTrue:[
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
        (#(methodHolder classHolder languageHolder) includes: something) ifTrue:[
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
            aParameter key removeDependent: self.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
            aParameter value addDependent: self.                         
83
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   146
        ].
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
    ].
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
    (changedObject == codeView languageHolder 
83
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   150
        or:[changedObject == codeView classHolder
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   151
        or:[changedObject == codeView methodHolder]]) ifTrue:[
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   152
        self updateSupport.
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
        ^self.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
    ].
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
    super update:something with:aParameter from:changedObject
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
83
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   158
    "Modified: / 16-09-2013 / 16:36:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   159
!
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   160
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   161
updateSupport
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   162
    | lang |
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   163
456
2837a6da2a89 Bug fix: install SmallSense completion controller even if electric edit support off.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   164
    support language ~~ (lang := codeView language) ifTrue:[
2837a6da2a89 Bug fix: install SmallSense completion controller even if electric edit support off.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   165
        self updateSupport: (EditSupport forLanguage: lang).
83
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   166
    ].
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   167
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   168
    "Created: / 16-09-2013 / 16:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
456
2837a6da2a89 Bug fix: install SmallSense completion controller even if electric edit support off.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   169
    "Modified: / 02-05-2015 / 21:52:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
205
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   170
!
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   171
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   172
updateSupport: anEditSupport
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   173
    support := anEditSupport.
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   174
    support initializeForService: self.
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   175
43bee6463c53 Introduced notion of `environment` to completion context.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   176
    "Created: / 13-05-2014 / 14:49:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
!EditService methodsFor:'event handling'!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
keyPress: key x:x y:y in: view
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
    "Handles an event in given view (a subview of codeView).
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
     If the method returns true, the event will not be processed
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
     by the view."
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
458
de41bf2025c0 Tests: fixed few bugs in electring edit support. More tests pass now.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 456
diff changeset
   187
    ^ support notNil 
de41bf2025c0 Tests: fixed few bugs in electring edit support. More tests pass now.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 456
diff changeset
   188
        ifTrue:[support keyPress: key x:x y:y in: view]
de41bf2025c0 Tests: fixed few bugs in electring edit support. More tests pass now.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 456
diff changeset
   189
        ifFalse:[false]
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
    "Created: / 07-03-2010 / 09:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
458
de41bf2025c0 Tests: fixed few bugs in electring edit support. More tests pass now.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 456
diff changeset
   192
    "Modified: / 04-05-2015 / 00:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
!EditService methodsFor:'registering'!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
registerIn: aCodeView
177
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   198
    UserPreferences current smallSenseEnabled ifTrue:[
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   199
        super registerIn: aCodeView.
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   200
        aCodeView languageHolder addDependent: self.
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   201
        aCodeView classHolder    addDependent: self.
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   202
        aCodeView methodHolder   addDependent: self.
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   203
        support := EditSupport forLanguage: aCodeView language.
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   204
        support initializeForService: self.
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   205
    ] ifFalse:[ 
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   206
        "/ If not enabled, remove itself from set of services,
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   207
        "/ see Tools::CodeView2>>registerService:
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   208
        "/ Bad API, has to be fixed in CodeView2...
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   209
        aCodeView services remove: self ifAbsent:[ ]
be588b60f4b2 Added preference to enable/disable SmallSense completion.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 173
diff changeset
   210
    ].
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
    "Created: / 24-07-2013 / 23:13:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
237
5c5e94e2fb00 Bugfix in EditService>>unregister: call super unregister at the end of the unregister method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   213
    "Modified: / 13-06-2014 / 14:15:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
!
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
unregister
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
    "Uninstall myself from my codeView"
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
    codeView languageHolder removeDependent: self.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
    codeView classHolder    removeDependent: self.
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
    codeView methodHolder   removeDependent: self.
237
5c5e94e2fb00 Bugfix in EditService>>unregister: call super unregister at the end of the unregister method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   222
    super unregister
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
    "Created: / 24-07-2013 / 23:14:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
237
5c5e94e2fb00 Bugfix in EditService>>unregister: call super unregister at the end of the unregister method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   225
    "Modified: / 13-06-2014 / 14:17:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
! !
2257d7223898 All classes moved to namespace SmallSense.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
83
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   228
!EditService class methodsFor:'documentation'!
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   229
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   230
version_HG
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   231
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   232
    ^ '$Changeset: <not expanded> $'
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   233
! !
e02330ae1fe4 Bugfix in EditService: correctly react on classHolder/methodHolder changes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 67
diff changeset
   234
86
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
   235
3b615594edf6 Fixed Lint service to work on CVS Smalltalk/X...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
   236
EditService initialize!