SmallSense__CodeHighlightingService.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 25 Oct 2017 23:42:41 +0100
changeset 1058 6d4bf422a7dd
parent 921 e5e7de67b496
child 1072 a44c741ee5ef
permissions -rw-r--r--
Fix subscript out of bounds error in Smalltalk inderences ...caused by missing size-check when analysing typed prefix.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     1
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     2
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
     3
Copyright (C) 2013-2015 Jan Vrany
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     4
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     5
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     6
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     7
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     8
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
     9
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    10
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    13
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    14
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    15
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    16
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    18
"
249
8bc64027b189 Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 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
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
    35
Copyright (C) 2013-2015 Jan Vrany
252
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    36
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    37
This library is free software; you can redistribute it and/or
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    38
modify it under the terms of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    39
License as published by the Free Software Foundation; either
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    40
version 2.1 of the License. 
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    41
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    42
This library is distributed in the hope that it will be useful,
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    43
but WITHOUT ANY WARRANTY; without even the implied warranty of
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    44
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    45
Lesser General Public License for more details.
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    46
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    47
You should have received a copy of the GNU Lesser General Public
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    48
License along with this library; if not, write to the Free Software
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    49
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    50
"
feba6ee5c814 Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 249
diff changeset
    51
! !
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 |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
                    Error handle:[:ex |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
                        (Dialog confirm:('Error while processing source:\\',ex description,'\\Debug ?') withCRs)
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
                        ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
                            ex reject.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
                    ] do:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
                        self process:true changed: interval
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
                ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
    "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
   164
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
!CodeHighlightingService methodsFor:'private'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
setHighlightedLine: line at: lineNr
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
    |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
   170
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
    "textView" modified ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
        "/ 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
   173
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
        ^ self
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
"/    done ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
"/        "/ 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
   178
"/        "/ ignore this (leftover) code.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
"/        ^ self
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
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
    firstShown := textView firstLineShown.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
    lastShown := textView lastLineShown.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
    replaceAction := [:lNr :line |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
            |oldLine|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   188
            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
   189
            oldLine notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
                line notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
                    "/ 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
   192
                    "/ 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
   193
                    "/ resulting error.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
                    "/ Certainly a kludge.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
                    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
   197
                        | i |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
                        "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
   200
                        "(presumably created by LintHighlighter)"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
                        i := line string indexOfNonSeparator.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
                        i > 1 ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
                            | e |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
                            (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
   206
                                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
   207
                            ]
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
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
                        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
   211
                            textView modifiedChannel removeDependent:self.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
                            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
   213
                            textView modifiedChannel addDependent:self.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
                            (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
   215
                                anyChange ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
                                    anyChange := true.
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
                                textView redrawLine:lNr
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
                        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
                ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
            ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   225
    list := textView list.  
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
    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
   227
    gutterView invalidate.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
"/    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
   230
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
    "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
   232
    "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
   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
!CodeHighlightingService methodsFor:'processing'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   236
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   237
process
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
    "(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
   239
     must be (re)processed."
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
    | browser |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
    (self syntaxHighlighters isEmptyOrNil) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   244
        "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
   245
        ^self
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
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
    "/ 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
   249
    "/ this info somewhere ...
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
    (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
   251
        textView modified ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
            browser navigationState realModifiedState: true
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   253
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   254
        textView modifiedChannel setValue:false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
    ].
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
    ((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
   258
        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
   259
        job stopAndRemoveAll.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
        job add: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
        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
   263
    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
    "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
   266
    "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
   267
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   268
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   269
process: delayed
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   270
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   271
    ^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
   272
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   273
    "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
   274
    "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
   275
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   276
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
process: delayed changed: interval
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
    |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
   280
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   281
    done := false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
    modified := false.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
    codeView syntaxElements: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   284
    codeView syntaxElementSelection: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   286
    highlighters := self syntaxHighlighters.
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
    cls := codeView klass.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   289
    (cls notNil and:[cls isObsolete]) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   290
        cls isMeta ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   291
            cls := (Smalltalk at:cls theNonMetaclass name) class
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   292
        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   293
            cls := Smalltalk at:cls name
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   294
        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   295
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   296
    mthd := codeView methodHolder value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   297
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   298
    "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   299
        oldCodeList := textView list copy.
151
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   300
        "/ 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
   301
        "/ 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
   302
        "/ #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
   303
        (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
   304
            oldCodeList := oldCodeList asStringCollection.
4dd02316ea4e Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
   305
        ].
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   306
        "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   307
            oldCodeList notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   308
                oldCode := oldCodeList asStringWithoutEmphasis.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   309
                "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   310
                    Screen currentScreenQuerySignal answer:codeView device do:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   311
                        Parser parseErrorSignal handle:[:ex |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   312
"/                            |errMsg|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   313
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   314
"/                            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
   315
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   316
                            "/ Transcript topView raiseDeiconified.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   317
                            "/ 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
   318
"/ self halt.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   319
                            "/ 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
   320
                            newCode := nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   321
                        ] do:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   322
                            | codeAspect |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   323
                            
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   324
                            elements := ParseTreeIndex new.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   325
                            codeAspect := codeView codeAspect.
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
                            "/ switch codeAspect
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   328
                            "/ case method
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   329
                                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
   330
                                    (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
   331
                                        newCodeList := oldCodeList.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   332
                                        newCode := newCodeList asString.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   333
                                    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   334
                                        newCodeList := oldCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   335
                                        newCode := oldCode asText. 
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
                                    newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   338
                                    newCodeRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   339
                                    highlighters do:[:h|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   340
                                        (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
   341
                                            newCodeListRefetch value.   
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   342
                                            interval do:[:lnr |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   343
                                                | ln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   344
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   345
                                                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
   346
                                                ln notEmptyOrNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   347
                                                    | nln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   348
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   349
                                                    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
   350
                                                    nln ~~ ln ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   351
                                                        delayed ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   352
                                                            codeView sensor 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   353
                                                                pushUserEvent:#setHighlightedLine:at:
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   354
                                                                for:self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   355
                                                                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
   356
                                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   357
                                                           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
   358
                                                        ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   359
                                                        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
   360
                                                       newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   361
                                                       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
   362
                                                    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   363
                                                ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   364
                                            ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   365
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   366
                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   367
                                            newCodeRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   368
                                            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
   369
                                            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
   370
                                            newCodeRefetch := [  ].
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
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   373
                                ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   374
                            "/ case expession
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   375
                                codeAspect == (SyntaxHighlighter codeAspectExpression) ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   376
                                    newCodeList := oldCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   377
                                    newCode := oldCode asText.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   378
                                    highlighters do:[:h|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   379
                                        newCodeRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   380
                                        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
   381
                                        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
   382
                                        newCodeRefetch := [  ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   383
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   384
                                ] ifFalse:[
921
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   385
                            "/ case statements
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   386
                                codeAspect == (SyntaxHighlighter codeAspectStatements) ifTrue:[
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   387
                                    newCodeList := oldCode asStringCollection.
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   388
                                    newCode := oldCode asText.
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   389
                                    highlighters do:[:h|
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   390
                                        (h respondsTo:#formatStatements:in:elementsInto:) ifTrue:[ 
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   391
                                            newCodeRefetch value.
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   392
                                            newCode := h formatStatements:newCode in:cls elementsInto: elements.
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   393
                                            newCodeListRefetch := [ newCodeList := newCode asStringCollection. newCodeRefetch := [] ].
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   394
                                            newCodeRefetch := [  ].
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   395
                                        ]
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   396
                                    ].
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   397
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   398
                                ] ifFalse:[
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   399
                            "/case class definition
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   400
                               codeView codeAspect == #classDefinition ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   401
                                    (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
   402
                                         newCodeList := oldCodeList.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   403
                                         newCode := newCodeList asString.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   404
                                    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   405
                                         newCodeList := oldCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   406
                                         newCode := oldCode asText. 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   407
                                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   408
                                    newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   409
                                    newCodeRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   410
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   411
                                    highlighters do:[:h|
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   412
                                       (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
   413
                                            newCodeListRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   414
                                            interval do:[:lnr |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   415
                                                | ln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   416
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   417
                                                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
   418
                                                ln notEmptyOrNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   419
                                                    | nln |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   420
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   421
                                                    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
   422
                                                    nln ~~ ln ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   423
                                                        delayed ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   424
                                                            codeView sensor 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   425
                                                                pushUserEvent:#setHighlightedLine:at:
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   426
                                                                for:self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   427
                                                                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
   428
                                                       ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   429
                                                           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
   430
                                                       ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   431
                                                       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
   432
                                                       newCodeListRefetch := [].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   433
                                                       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
   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
                                            ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   437
                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   438
                                            newCodeRefetch value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   439
                                            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
   440
                                            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
   441
                                            newCodeRefetch := [  ].
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
                                   ].
921
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   444
                               ]]]].
99
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
                    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   447
                    newCode notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   448
                        "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   449
                            newCode ~= oldCodeList ifTrue:[
193
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   450
                                | newCodeText |
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   451
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   452
                                newCodeText := newCode.
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   453
                                newCode := newCode asStringCollection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   454
                                "textView" modified ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   455
                                    done := true.
193
c0c4605b3791 Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   456
                                    elements source: newCodeText.
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   457
                                    textView notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   458
                                        "/ 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
   459
                                        "/ 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
   460
                                        "/ self showInfo:nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   461
                                        delayed ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   462
                                            codeView sensor
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   463
                                                pushUserEvent:#setHighlightedCode:elements:
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   464
                                                for:self
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   465
                                                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
   466
                                                "/self delayedUpdateBufferLabelWithCheckIfModified
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   467
                                        ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   468
                                            textView contents: newCode.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   469
                                            codeView syntaxElements: elements.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   470
                                            gutterView invalidate.
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
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   482
    "Created: / 03-08-2013 / 11:11:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
921
e5e7de67b496 Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   483
    "Modified: / 22-02-2016 / 21:08:11 / 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
   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
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   488
version_HG
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   489
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   490
    ^ '$Changeset: <not expanded> $'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   491
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   492