SmallSense__CodeHighlightingService.st
author Claus Gittinger <cg@exept.de>
Mon, 15 Jul 2019 15:33:58 +0200
branchcvs_MAIN
changeset 1091 8c18b8f6ff0c
parent 1086 7c310120c9dd
permissions -rw-r--r--
#OTHER by cg unneeded subProjects method removed (already inherited)
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
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     3
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     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: 193
diff changeset
    19
"{ Package: 'stx:goodies/smallsense' }"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
"{ NameSpace: SmallSense }"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
Tools::CodeHighlightingService subclass:#CodeHighlightingService
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	instanceVariableNames:'lastLineFromChanged lastLineToChanged lastContentsList'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	classVariableNames:''
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	category:'SmallSense-Core-Services'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
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
!CodeHighlightingService 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
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    35
Copyright (C) 2013-2014 Jan Vrany
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    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
! !
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
!CodeHighlightingService class methodsFor:'accessing'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
label
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    "Answers a short label - for UI"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    ^'SmallSense - Code Highlighting'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    "Created: / 27-07-2013 / 22:46:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    "Modified: / 23-09-2013 / 10:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
!CodeHighlightingService methodsFor:'accessing'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
syntaxHighlighter
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
    | highlighter |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
    highlighter := super syntaxHighlighter.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    highlighter == SyntaxHighlighter ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
        ^ SmalltalkSyntaxHighlighter
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    highlighter == SyntaxHighlighter2 ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
        ^ SmalltalkSyntaxHighlighter
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    ^ highlighter
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    "Created: / 26-08-2013 / 09:26:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
!CodeHighlightingService methodsFor:'change & update'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
sourceChanged:force
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
    ^self sourceChanged: force from: nil to: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    "Created: / 27-07-2013 / 22:52:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
sourceChanged:force from:start to:end    
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
    "Called when codeview's text changes"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    (force or:[codeView reallyModified]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
        (start notNil and: [end notNil and:[start > end]]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
            lastLineFromChanged  := lastLineToChanged := nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
            lastLineFromChanged := start.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
            lastLineToChanged := end.   
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
        self process
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    "Created: / 27-07-2013 / 22:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
    "Modified: / 03-08-2013 / 13:00:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
update:aspect with:param from:sender
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
    "Invoked when an object that I depend upon sends a change notification."
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
    textView notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
        (sender == textView and:[aspect == #sizeOfContents]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
"/            self halt.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
"/            lastContentsList ~~ textView list ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
"/                lastContentsList := textView list.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
"/                self sourceChanged:true.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
"/                textView instVarNamed: #suppressNotifications put: false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
"/            ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
            ^self.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
        ].  
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
    super update:aspect with:param from:sender
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
    "Modified: / 03-08-2013 / 12:39:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
!CodeHighlightingService methodsFor:'event handling'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
linesDeletedFrom:start to:end 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
    self sourceChanged:true from:start to:end
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
    "Created: / 27-07-2013 / 22:51:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
264
c9e4dc3cf39c Tweak in CodeHighlightingService: force full rehighlight when more than one line is modified.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   131
    "Modified: / 07-08-2014 / 01:41:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
linesInsertedFrom:start to:end 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
    self sourceChanged:true from:start to:end
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
    "Created: / 27-07-2013 / 22:51:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
264
c9e4dc3cf39c Tweak in CodeHighlightingService: force full rehighlight when more than one line is modified.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   138
    "Modified: / 07-08-2014 / 01:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
linesModifiedFrom:start to:end 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
    self sourceChanged:true from:start to:end
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
    "Created: / 27-07-2013 / 22:50:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
!CodeHighlightingService methodsFor:'initialization'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
initialize
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
    job := (Smalltalk at:#BackgroundQueueProcessingJob) 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
                named:self defaultJobName
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
                on:[:interval |
880
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   153
                    ControlInterrupt handle:[:ex |
1007
60cc13ef0a9c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 994
diff changeset
   154
                        (codeView topView notNil and:[ codeView topView isDebugView]) ifTrue:[
994
31a9769be125 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   155
                            'CodeHighlighter [info]: halt ignored in debugger''s syntax job' errorPrintCR.
880
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   156
                            ex proceed.
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   157
                        ].
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   158
                        ex reject.
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   159
                    ] do:[
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   160
                        Error handle:[:ex |
994
31a9769be125 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   161
                            ('CodeHighlighter [info]: Error caught while processing source: ',ex description) errorPrintCR.
31a9769be125 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   162
                            ex suspendedContext fullPrintAll.
880
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   163
                            (Dialog confirm:('Error while processing source:\\',ex description,'\\Debug ?') withCRs)
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   164
                            ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   165
                                ex reject.
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   166
                            ]
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   167
                        ] do:[
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   168
                            self process:true changed: interval
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
                        ]
880
Claus Gittinger <cg@exept.de>
parents: 864
diff changeset
   170
                    ].
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
                ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
    "Created: / 03-08-2013 / 11:08:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
!CodeHighlightingService methodsFor:'private'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
setHighlightedLine: line at: lineNr
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
    |firstShown lastShown anyChange replaceAction list|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
    "textView" modified ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
        "/ new input arrived in the meantime
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
        ^ self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
"/    done ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
"/        "/ another coloring process has already been started.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   188
"/        "/ ignore this (leftover) code.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   189
"/        ^ self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
"/    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
    firstShown := textView firstLineShown.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
    lastShown := textView lastLineShown.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
    replaceAction := [:lNr :line |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
            |oldLine|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
            oldLine :=  list at:lNr ifAbsent:nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
            oldLine notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
                line notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
                    "/ this check is needed - there is a race
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
                    "/ when the text is converted. This detects the
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
                    "/ resulting error.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
                    "/ Certainly a kludge.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
                    oldLine string = line string ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
                        | i |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   209
                        "JV@2012-02-01: Remove any emphasis on leading whitespace"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
                        "(presumably created by LintHighlighter)"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
                        i := line string indexOfNonSeparator.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
                        i > 1 ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
                            | e |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
                            (e := (line emphasisAt: i - 1)) notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
                                line emphasisFrom: 1 to: i - 1 remove: e.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
                            ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
                        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
                        oldLine emphasis ~= line emphasis ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
                            textView modifiedChannel removeDependent:self.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
                            list at:lNr put:line.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
                            textView modifiedChannel addDependent:self.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
                            (lNr between:firstShown and:lastShown) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   225
                                anyChange ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
                                    anyChange := true.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
                                ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
                                textView redrawLine:lNr
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
                            ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   232
                ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
            ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   234
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   235
    list := textView list.  
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   236
    replaceAction value: lineNr value: line.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   237
    gutterView invalidate.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   239
"/    Transcript showCR:'--> rehighlighted ', self identityHash printString.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   240
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   241
    "Created: / 03-08-2013 / 23:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
    "Modified: / 04-08-2013 / 00:55:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   244
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   245
!CodeHighlightingService methodsFor:'processing'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   246
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   247
process
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
    "(Re)starts the processing job. Should be called whenever a source 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   249
     must be (re)processed."
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   251
    | browser |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   253
    (self syntaxHighlighters isEmptyOrNil) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   254
        "No higlighter, nothing to do"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
        ^self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   256
    ].   
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   257
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   258
    "/ this clobbers the codeViews modified state; therefore, we have to remember
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   259
    "/ this info somewhere ...
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
    (browser := codeView browser) notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
        textView modified ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
            browser navigationState realModifiedState: true
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
        textView modifiedChannel setValue:false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
    ].
970
7c53ed9c6799 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 880
diff changeset
   266
    self clearScrollbarBackground.
7c53ed9c6799 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 880
diff changeset
   267
    
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   268
    ((lastLineFromChanged isNil and:[lastLineToChanged isNil]) 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   269
        or:[lastLineFromChanged == 1 and:[lastLineToChanged == textView size]]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   270
        job stopAndRemoveAll.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   271
        job add: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   272
    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   273
        job add:(lastLineFromChanged to:lastLineToChanged).
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   274
    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   275
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   276
    "Created: / 03-08-2013 / 11:07:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
    "Modified: / 06-08-2013 / 03:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   278
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   279
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   280
process: delayed
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   281
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
    ^self process: delayed changed: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   284
    "Created: / 27-07-2013 / 22:53:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285
    "Modified: / 03-08-2013 / 11:11:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   286
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   287
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   288
process: delayed changed: interval
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   289
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   290
    |oldCode oldCodeList newCode newCodeList newCodeRefetch newCodeListRefetch elements cls mthd highlighters|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   291
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   292
    done := false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   293
    modified := false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   294
    codeView syntaxElements: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   295
    codeView syntaxElementSelection: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   296
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   297
    highlighters := self syntaxHighlighters.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   298
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   299
    cls := codeView klass.
1086
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   300
    cls isBridgeProxy ifFalse:[ 
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   301
        (cls notNil and:[cls isObsolete]) ifTrue:[
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   302
            cls isMeta ifTrue:[
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   303
                cls := (Smalltalk at:cls theNonMetaclass name) class
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   304
            ] ifFalse:[
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   305
                cls := Smalltalk at:cls name
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   306
            ].
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   307
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   308
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   309
    mthd := codeView methodHolder value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   310
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   311
    "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   312
        oldCodeList := textView list copy.
151
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   313
        "/ Sometimes oldCodeList is not a string collection
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   314
        "/ but Array (usually with one nil element). In that case
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   315
        "/ #asStringWithoutEmphasis fails, so check & convert it here.
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   316
        (oldCodeList notNil and:[oldCodeList isStringCollection not]) ifTrue:[
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   317
            oldCodeList := oldCodeList asStringCollection.
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   318
        ].
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   319
        "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   320
            oldCodeList notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   321
                oldCode := oldCodeList asStringWithoutEmphasis.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   322
                "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   323
                    Screen currentScreenQuerySignal answer:codeView device do:[
1069
1729ead0ff95 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 1007
diff changeset
   324
                        ParseError handle:[:ex |
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   325
"/                            |errMsg|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   326
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   327
"/                            errMsg := ex description asStringCollection first asString.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   328
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   329
                            "/ Transcript topView raiseDeiconified.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   330
                            "/ Transcript showCR:'ParseError: ', ex description.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   331
"/ self halt.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   332
                            "/ self showInfo:(errMsg colorizeAllWith:Color red).
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   333
                            newCode := nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   334
                        ] do:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   335
                            | codeAspect |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   336
                            
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   337
                            elements := ParseTreeIndex new.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   338
                            codeAspect := codeView codeAspect.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   339
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   340
                            "/ switch codeAspect
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   341
                            "/ case method
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   342
                                codeAspect == SyntaxHighlighter codeAspectMethod ifTrue:[
264
c9e4dc3cf39c Tweak in CodeHighlightingService: force full rehighlight when more than one line is modified.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   343
                                    (interval notNil and:[interval size == 1 and:[highlighters first respondsTo:#formatMethod:source:line:number:in:using:]]) ifTrue:[
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   344
                                        newCodeList := oldCodeList.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   345
                                        newCode := newCodeList asString.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   346
                                    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   347
                                        newCodeList := oldCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   348
                                        newCode := oldCode asText. 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   349
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   350
                                    newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   351
                                    newCodeRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   352
                                    highlighters do:[:h|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   353
                                        (interval notNil and:[h respondsTo:#formatMethod:source:line:number:in:using:]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   354
                                            newCodeListRefetch value.   
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   355
                                            interval do:[:lnr |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   356
                                                | ln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   357
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   358
                                                ln := newCodeList at: lnr ifAbsent:[nil].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   359
                                                ln notEmptyOrNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   360
                                                    | nln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   361
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   362
                                                    nln := h formatMethod:mthd source:newCode line: ln string number: lnr in:cls using:syntaxPreferences.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   363
                                                    nln ~~ ln ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   364
                                                        delayed ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   365
                                                            codeView sensor 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   366
                                                                pushUserEvent:#setHighlightedLine:at:
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   367
                                                                for:self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   368
                                                                withArguments:(Array with:nln with: lnr).                                                                                                                                                                                                                     
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   369
                                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   370
                                                           self setHighlightedLine: nln at: lnr.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   371
                                                        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   372
                                                        newCodeList at: lnr put: nln.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   373
                                                       newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   374
                                                       newCodeRefetch := [ newCode := newCodeList asString. newCodeListRefetch := [] ].   
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   375
                                                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   376
                                                ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   377
                                            ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   378
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   379
                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   380
                                            newCodeRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   381
                                            newCode := h formatMethod:mthd source:newCode in:cls using:syntaxPreferences elementsInto: elements.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   382
                                            newCodeListRefetch := [ newCodeList := newCode asStringCollection. newCodeRefetch := [] ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   383
                                            newCodeRefetch := [  ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   384
                                        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   385
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   386
                                ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   387
                            "/ case expession
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   388
                                codeAspect == (SyntaxHighlighter codeAspectExpression) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   389
                                    newCodeList := oldCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   390
                                    newCode := oldCode asText.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   391
                                    highlighters do:[:h|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   392
                                        newCodeRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   393
                                        newCode := h formatExpression:newCode in:cls elementsInto: elements.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   394
                                        newCodeListRefetch := [ newCodeList := newCode asStringCollection. newCodeRefetch := [] ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   395
                                        newCodeRefetch := [  ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   396
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   397
                                ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   398
                            "/case class definition
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   399
                               codeView codeAspect == #classDefinition ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   400
                                    (interval notNil and:[highlighters first respondsTo:#formatClassDefinition:line:number:in:]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   401
                                         newCodeList := oldCodeList.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   402
                                         newCode := newCodeList asString.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   403
                                    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   404
                                         newCodeList := oldCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   405
                                         newCode := oldCode asText. 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   406
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   407
                                    newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   408
                                    newCodeRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   409
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   410
                                    highlighters do:[:h|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   411
                                       (interval notNil and:[h respondsTo:#formatClassDefinition:line:number:in:]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   412
                                            newCodeListRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   413
                                            interval do:[:lnr |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   414
                                                | ln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   415
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   416
                                                ln := oldCodeList at: lnr ifAbsent:[nil].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   417
                                                ln notEmptyOrNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   418
                                                    | nln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   419
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   420
                                                    nln := h formatClassDefinition:newCode line: ln string number: lnr in:cls.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   421
                                                    nln ~~ ln ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   422
                                                        delayed ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   423
                                                            codeView sensor 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   424
                                                                pushUserEvent:#setHighlightedLine:at:
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   425
                                                                for:self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   426
                                                                withArguments:(Array with:nln with: lnr).                                                                                                 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   427
                                                       ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   428
                                                           self setHighlightedLine: nln at: lnr.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   429
                                                       ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   430
                                                       newCodeList at: lnr put: nln.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   431
                                                       newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   432
                                                       newCodeRefetch := [ newCode := newCodeList asString. newCodeListRefetch := [] ].   
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   433
                                                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   434
                                                ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   435
                                            ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   436
                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   437
                                            newCodeRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   438
                                            newCode := h formatClassDefinition:newCode in:cls elementsInto: elements.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   439
                                            newCodeListRefetch := [ newCodeList := newCode asStringCollection. newCodeRefetch := [] ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   440
                                            newCodeRefetch := [  ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   441
                                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   442
                                   ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   443
                               ]]].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   444
                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   445
                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   446
                    newCode notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   447
                        "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   448
                            newCode ~= oldCodeList ifTrue:[
193
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   449
                                | newCodeText |
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   450
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   451
                                newCodeText := newCode.
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   452
                                newCode := newCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   453
                                "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   454
                                    done := true.
193
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   455
                                    elements source: newCodeText.
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   456
                                    textView notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   457
                                        "/ must add this event - and not been interrupted
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   458
                                        "/ by any arriving key-event.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   459
                                        "/ self showInfo:nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   460
                                        delayed ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   461
                                            codeView sensor
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   462
                                                pushUserEvent:#setHighlightedCode:elements:
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   463
                                                for:self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   464
                                                withArguments:(Array with:newCode with: elements).
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   465
                                                "/self delayedUpdateBufferLabelWithCheckIfModified
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   466
                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   467
                                            textView contents: newCode.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   468
                                            codeView syntaxElements: elements.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   469
                                            gutterView invalidate.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   470
                                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   471
                                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   472
                                ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   473
                            ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   474
                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   475
                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   476
                ] "/ ---
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   477
            ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   478
        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   479
    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   480
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   481
    "Created: / 03-08-2013 / 11:11:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
264
c9e4dc3cf39c Tweak in CodeHighlightingService: force full rehighlight when more than one line is modified.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 252
diff changeset
   482
    "Modified: / 07-08-2014 / 01:41:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1086
7c310120c9dd #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
   483
    "Modified: / 08-05-2019 / 01:39:35 / Claus Gittinger"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   484
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   485
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   486
!CodeHighlightingService class methodsFor:'documentation'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   487
864
a770d6723f4e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   488
version_CVS
a770d6723f4e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   489
a770d6723f4e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   490
    ^ '$Header$'
a770d6723f4e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   491
!
a770d6723f4e added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   492
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   493
version_HG
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   494
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   495
    ^ '$Changeset: <not expanded> $'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   496
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   497