Tools__CodeHighlightingService.st
author Claus Gittinger <cg@exept.de>
Fri, 11 Jan 2013 10:56:42 +0100
changeset 12099 d3315fdc1c92
parent 11705 6f107a6cac2d
child 12401 4714b9640528
child 12637 9476b20e1a4c
permissions -rw-r--r--
class: Tools::CodeHighlightingService changed: #process:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10077
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
     2
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
10440
ad79e93dc9b7 no need to access BackgroundJob via Smalltalk - the bug
Claus Gittinger <cg@exept.de>
parents: 10439
diff changeset
     3
	      All Rights Reserved
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10077
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
     5
Permission is hereby granted, free of charge, to any person
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
     6
obtaining a copy of this software and associated documentation
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
     7
files (the 'Software'), to deal in the Software without
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
     8
restriction, including without limitation the rights to use,
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
     9
copy, modify, merge, publish, distribute, sublicense, and/or sell
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    10
copies of the Software, and to permit persons to whom the
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    11
Software is furnished to do so, subject to the following
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    12
conditions:
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    13
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    14
The above copyright notice and this permission notice shall be
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    15
included in all copies or substantial portions of the Software.
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    16
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    19
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    21
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    22
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    23
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    24
OTHER DEALINGS IN THE SOFTWARE.
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
    30
BackgroundSourceProcessingService subclass:#CodeHighlightingService
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
    31
	instanceVariableNames:''
10439
6a41520db1be variable renamed in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
    32
	classVariableNames:''
6a41520db1be variable renamed in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
    33
	poolDictionaries:''
6a41520db1be variable renamed in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
    34
	category:'Interface-CodeView'
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!CodeHighlightingService class methodsFor:'documentation'!
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
copyright
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
10077
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    41
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
10440
ad79e93dc9b7 no need to access BackgroundJob via Smalltalk - the bug
Claus Gittinger <cg@exept.de>
parents: 10439
diff changeset
    42
	      All Rights Reserved
10077
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    43
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    44
Permission is hereby granted, free of charge, to any person
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    45
obtaining a copy of this software and associated documentation
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    46
files (the 'Software'), to deal in the Software without
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    47
restriction, including without limitation the rights to use,
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    48
copy, modify, merge, publish, distribute, sublicense, and/or sell
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    49
copies of the Software, and to permit persons to whom the
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    50
Software is furnished to do so, subject to the following
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    51
conditions:
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
10077
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    53
The above copyright notice and this permission notice shall be
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    54
included in all copies or substantial portions of the Software.
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    55
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    56
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    57
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    58
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    59
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    60
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    61
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    62
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
d2b07a20c425 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9980
diff changeset
    63
OTHER DEALINGS IN THE SOFTWARE.
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!CodeHighlightingService class methodsFor:'accessing'!
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
label
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    "Answers short label - for UI"
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    ^'Syntax Highlighting'
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "Created: / 07-03-2010 / 14:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
! !
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    78
!CodeHighlightingService methodsFor:'accessing'!
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    79
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    80
syntaxHighlighter
10721
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    81
    | app lang highlighter |
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    82
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    83
    "First, ask application..."
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    84
    app := codeView application.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    85
    app notNil ifTrue:[
10721
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    86
        | mthd class |
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    87
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    88
        mthd := codeView methodHolder value.
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    89
        (mthd notNil and:[app respondsTo: #syntaxHighlighterForMethod:]) ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    90
            highlighter := app syntaxHighlighterForMethod:mthd.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    91
        ] ifFalse:[
11617
20c6592bdc20 changed:
Claus Gittinger <cg@exept.de>
parents: 11611
diff changeset
    92
            class := codeView classHolder value.
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    93
            (class notNil and:[app respondsTo: #syntaxHighlighterForClass:]) ifTrue:[                        
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    94
                highlighter := app syntaxHighlighterForClass: class.
10721
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    95
            ] ifFalse:[
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    96
                (class notNil and:[app respondsTo: #syntaxHighlighter]) ifTrue:[                        
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    97
                    highlighter := app syntaxHighlighterClass.
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
    98
                ].
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
    99
            ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   100
        ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   101
    ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   102
    "App did not provide any highlighter..."
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   103
    highlighter isNil ifTrue:[        
11544
e82e2d8be007 changed: #syntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 11384
diff changeset
   104
        highlighter := (lang := codeView language) isNil
e82e2d8be007 changed: #syntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 11384
diff changeset
   105
                        ifTrue:[nil]
e82e2d8be007 changed: #syntaxHighlighter
Claus Gittinger <cg@exept.de>
parents: 11384
diff changeset
   106
                        ifFalse:[lang syntaxHighlighterClass].
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   107
    ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   108
    "HACK!!!!!!"
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   109
    highlighter == SyntaxHighlighter ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   110
        highlighter := SyntaxHighlighter2
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   111
    ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   112
    ^ highlighter
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   113
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   114
    "Created: / 05-08-2011 / 10:48:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10729
f4109bfaad31 fix in #syntaxHighlighter
vrany
parents: 10721
diff changeset
   115
    "Modified: / 28-09-2011 / 00:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11617
20c6592bdc20 changed:
Claus Gittinger <cg@exept.de>
parents: 11611
diff changeset
   116
    "Modified: / 19-07-2012 / 13:03:21 / cg"
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   117
!
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   118
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   119
syntaxHighlighters
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   120
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   121
    | highlighters |
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   122
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   123
    highlighters := OrderedCollection new: 4.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   124
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   125
    codeView services do:[:service|
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   126
        | highlighter |
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   127
        highlighter := service syntaxHighlighter.        
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   128
        highlighter notNil ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   129
            "HACK, since AbstractSyntaxHighlighter overwrite
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   130
             emphasis instead of adding it..."
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   131
            (highlighter isKindOf: AbstractSyntaxHighlighter class) ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   132
                highlighters addFirst: highlighter                    
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   133
            ] ifFalse:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   134
                highlighters add: highlighter
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   135
            ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   136
        ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   137
    ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   138
    ^highlighters
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   139
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   140
    "Created: / 05-08-2011 / 10:49:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11611
1b0c55028de1 comment/format
Claus Gittinger <cg@exept.de>
parents: 11544
diff changeset
   141
    "Modified: / 19-07-2012 / 12:58:48 / cg"
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   142
! !
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   143
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   144
!CodeHighlightingService methodsFor:'acessing-defaults'!
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   146
defaultJobName
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   147
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   148
    ^'CodeView2''s syntax highlighting job'
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   149
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   150
    "Created: / 24-01-2012 / 12:06:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   151
! !
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   152
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!CodeHighlightingService methodsFor:'private'!
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   155
process
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   156
    "(Re)starts the processing job. Should be called whenever a source 
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   157
     must be (re)processed."
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   159
    | highlighters |
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
10721
6813188d742b comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents: 10710
diff changeset
   161
    (highlighters := self syntaxHighlighters) isEmptyOrNil ifTrue:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   162
        "No higlighter, nothing to do"
10968
5e738ee1cd2a No highlighting by default (either method or language must be set)
vrany
parents: 10961
diff changeset
   163
        ^self
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   164
    ].
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   166
    super process.
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   167
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   168
    "Modified: / 07-07-2011 / 12:26:12 / Jan Vrany <jan.vrant@fit.cvut,cz>"
10968
5e738ee1cd2a No highlighting by default (either method or language must be set)
vrany
parents: 10961
diff changeset
   169
    "Modified: / 26-09-2011 / 15:40:23 / cg"
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   170
    "Created: / 24-01-2012 / 12:11:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   171
!
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   172
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   173
process: delayed
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   174
    |oldCode oldCodeList newCode elements cls mthd highlighterClasses|
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   175
12099
d3315fdc1c92 class: Tools::CodeHighlightingService
Claus Gittinger <cg@exept.de>
parents: 11705
diff changeset
   176
    codeView topView class == DebugView ifTrue:[^ self].
11617
20c6592bdc20 changed:
Claus Gittinger <cg@exept.de>
parents: 11611
diff changeset
   177
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   178
    done := false.
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   179
    modified := false.
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   180
    codeView syntaxElements: nil.
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   181
    codeView syntaxElementSelection: nil.
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   182
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   183
    highlighterClasses := self syntaxHighlighters.
10149
d390c010293f changed:
Claus Gittinger <cg@exept.de>
parents: 10077
diff changeset
   184
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   185
    cls := codeView klass.
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   186
    (cls notNil and:[cls isObsolete]) ifTrue:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   187
        cls isMeta ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   188
            cls := (Smalltalk at:cls theNonMetaclass name) class
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   189
        ] ifFalse:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   190
            cls := Smalltalk at:cls name
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   191
        ].
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   192
    ].
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   193
    mthd := codeView methodHolder value.
10149
d390c010293f changed:
Claus Gittinger <cg@exept.de>
parents: 10077
diff changeset
   194
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   195
    "textView" modified ifFalse:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   196
        oldCodeList := textView list copy.
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   197
        "textView" modified ifFalse:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   198
            oldCodeList isNil ifFalse:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   199
                oldCode := oldCodeList asStringWithoutEmphasis.
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   200
                "textView" modified ifFalse:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   201
                    Screen currentScreenQuerySignal answer:codeView device
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   202
                    do:[
12099
d3315fdc1c92 class: Tools::CodeHighlightingService
Claus Gittinger <cg@exept.de>
parents: 11705
diff changeset
   203
                        Parser parseErrorSignal handle:[:ex |
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   204
                            |errMsg|
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   206
                            errMsg := ex description asStringCollection first asString.
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   208
                            "/ Transcript topView raiseDeiconified.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   209
                            "/ Transcript showCR:'ParseError: ', ex description.
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
"/ self halt.
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   211
                            "/ self showInfo:(errMsg colorizeAllWith:Color red).
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   212
                            newCode := nil.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   213
                        ] do:[
11705
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   214
                            |codeAspect|
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   215
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   216
                            elements := SortedCollection new.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   217
                            newCode := oldCode asText.
11705
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   218
                            codeAspect := codeView codeAspect.
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   219
                            codeAspect == SyntaxHighlighter codeAspectMethod ifTrue:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   220
                                highlighterClasses do:[:e|newCode := e formatMethod:mthd source:newCode in:cls using: nil elementsInto: elements].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   221
                            ] ifFalse:[
11705
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   222
                                codeAspect == (SyntaxHighlighter codeAspectExpression) ifTrue:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   223
                                    highlighterClasses do:[:e|newCode := e formatExpression:newCode in:cls elementsInto: elements].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   224
                                ] ifFalse:[
11705
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   225
                                    codeAspect == (SyntaxHighlighter codeAspectClassDefinition) ifTrue:[
11384
4e791a36cfaf changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11181
diff changeset
   226
                                        highlighterClasses do:[:e|newCode := e formatClassDefinition:newCode string in:cls elementsInto: elements].
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   227
                                    ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   228
                                ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   229
                            ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   230
                        ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   231
                    ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   232
                    newCode notNil ifTrue:[
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   233
                        "textView" modified ifFalse:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   234
                            newCode ~= oldCodeList ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   235
                                newCode := newCode asStringCollection.
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   236
                                "textView" modified ifFalse:[
10486
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   237
                                    done := true.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   238
                                    textView notNil ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   239
                                        "/ must add this event - and not been interrupted
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   240
                                        "/ by any arriving key-event.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   241
                                        "/ self showInfo:nil.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   242
                                        delayed ifTrue:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   243
                                            codeView sensor
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   244
                                                pushUserEvent:#setHighlightedCode:elements:
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   245
                                                for:self
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   246
                                                withArguments:(Array with:newCode with: elements).
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   247
                                                "/self delayedUpdateBufferLabelWithCheckIfModified
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   248
                                        ] ifFalse:[
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   249
                                            textView contents: newCode.
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   250
                                        ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   251
                                    ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   252
                                ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   253
                            ].
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   254
                        ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   255
                    ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   256
                ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   257
            ]
ecf02903122f SmallLint UI improvements
vrany
parents: 10440
diff changeset
   258
        ]
10420
ed96d3da2be7 - CodeHighlightingService refactored to use
vrany
parents: 10410
diff changeset
   259
    ]
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
10710
5aa37ab3189e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10701
diff changeset
   261
    "Modified: / 16-09-2011 / 17:01:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   262
    "Created: / 24-01-2012 / 12:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11705
6f107a6cac2d changed: #process:
Claus Gittinger <cg@exept.de>
parents: 11617
diff changeset
   263
    "Modified: / 27-07-2012 / 22:23:16 / cg"
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   264
!
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   265
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   266
setHighlightedCode:newCode elements: elements
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   267
    "the background synhighlighter has generated new colored text,
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   268
     with highlighted syntax.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   269
     If there have been no modifications in the meantime, install it."
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   270
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   271
    |firstShown lastShown cursorWasOn anyChange newLines l replaceAction list|
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   272
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   273
    "textView" modified ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   274
        "/ new input arrived in the meantime
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   276
        ^ self
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   277
    ].
11611
1b0c55028de1 comment/format
Claus Gittinger <cg@exept.de>
parents: 11544
diff changeset
   278
    done ifFalse:[
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   279
        "/ another coloring process has already been started.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   280
        "/ ignore this (leftover) code.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   281
        ^ self
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   282
    ].
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   283
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   284
    firstShown := textView firstLineShown.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   285
    lastShown := textView lastLineShown.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   286
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   287
    replaceAction := [:lNr :line |
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   288
            |oldLine|
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   289
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   290
            oldLine :=  list at:lNr ifAbsent:nil.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   291
            oldLine notNil ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   292
                line notNil ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   293
                    "/ this check is needed - there is a race
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   294
                    "/ when the text is converted. This detects the
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   295
                    "/ resulting error.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   296
                    "/ Certainly a kludge.
10410
0d8eaf28b7a9 Fixes for debugger
vrany
parents: 10353
diff changeset
   297
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   298
                    oldLine string = line string ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   299
                        oldLine emphasis ~= line emphasis ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   300
                            textView modifiedChannel removeDependent:self.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   301
                            list at:lNr put:line.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   302
                            textView modifiedChannel addDependent:self.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   303
                            (lNr between:firstShown and:lastShown) ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   304
                                anyChange ifFalse:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   305
                                    anyChange := true.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   306
                                    cursorWasOn := textView hideCursor
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   307
                                ].
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   308
                                textView redrawLine:lNr
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   309
                            ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   310
                        ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   311
                    ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   312
                ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   313
            ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   314
        ].
10410
0d8eaf28b7a9 Fixes for debugger
vrany
parents: 10353
diff changeset
   315
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   316
    anyChange := false.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   317
    newLines := newCode asStringCollection.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   318
    list := textView list.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   319
    list isNil ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   320
        textView list:newLines.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   321
    ] ifFalse:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   322
        "/ the cursor line first - that's where your eyes are ...
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   323
        (l := textView cursorLine) notNil ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   324
            l <= newLines size ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   325
                replaceAction value:l value:(newLines at:l)
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   326
            ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   327
        ].
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   328
        newLines keysAndValuesDo:replaceAction.
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   329
        anyChange ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   330
            cursorWasOn ifTrue:[
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   331
                textView showCursor
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   332
            ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   333
        ]
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   334
    ].
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   335
    codeView syntaxElements: elements
10410
0d8eaf28b7a9 Fixes for debugger
vrany
parents: 10353
diff changeset
   336
11181
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   337
    "Modified: / 09-10-2006 / 11:50:17 / cg"
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   338
    "Created: / 14-02-2010 / 16:10:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f04a38c369c9 CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents: 11171
diff changeset
   339
    "Modified: / 16-09-2011 / 17:33:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11611
1b0c55028de1 comment/format
Claus Gittinger <cg@exept.de>
parents: 11544
diff changeset
   340
    "Modified (format): / 19-07-2012 / 12:07:05 / cg"
10410
0d8eaf28b7a9 Fixes for debugger
vrany
parents: 10353
diff changeset
   341
! !
0d8eaf28b7a9 Fixes for debugger
vrany
parents: 10353
diff changeset
   342
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
!CodeHighlightingService class methodsFor:'documentation'!
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
10497
aab867178a6f fixes for code highlighting
vrany
parents: 10486
diff changeset
   345
version
12099
d3315fdc1c92 class: Tools::CodeHighlightingService
Claus Gittinger <cg@exept.de>
parents: 11705
diff changeset
   346
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeHighlightingService.st,v 1.36 2013-01-11 09:56:42 cg Exp $'
10497
aab867178a6f fixes for code highlighting
vrany
parents: 10486
diff changeset
   347
!
aab867178a6f fixes for code highlighting
vrany
parents: 10486
diff changeset
   348
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
version_CVS
12099
d3315fdc1c92 class: Tools::CodeHighlightingService
Claus Gittinger <cg@exept.de>
parents: 11705
diff changeset
   350
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeHighlightingService.st,v 1.36 2013-01-11 09:56:42 cg Exp $'
9980
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
!
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
version_SVN
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
    ^ '§Id: Tools__CodeHighlightingService.st 7715 2011-04-10 16:32:58Z vranyj1 §'
cf0d7a8b54e9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
! !
12099
d3315fdc1c92 class: Tools::CodeHighlightingService
Claus Gittinger <cg@exept.de>
parents: 11705
diff changeset
   356