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