author | convert-repo |
Wed, 11 Dec 2019 04:28:36 +0000 | |
changeset 1116 | b51ace366efc |
parent 1072 | a44c741ee5ef |
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 |
374
e65bd2bf892a
Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
264
diff
changeset
|
3 |
Copyright (C) 2013-2015 Jan Vrany |
1072 | 4 |
Copyright (C) 2016 Jan Vrany |
252
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
5 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
6 |
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
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
11 |
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
|
12 |
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
|
13 |
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
|
14 |
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
|
15 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
16 |
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
|
17 |
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
|
18 |
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
|
19 |
" |
249
8bc64027b189
Package renamed to stx:goodies/smallsense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
20 |
"{ 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
|
21 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
"{ NameSpace: SmallSense }" |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
Tools::CodeHighlightingService subclass:#CodeHighlightingService |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
instanceVariableNames:'lastLineFromChanged lastLineToChanged lastContentsList' |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
classVariableNames:'' |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
poolDictionaries:'' |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
category:'SmallSense-Core-Services' |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
|
252
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
31 |
!CodeHighlightingService class methodsFor:'documentation'! |
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
32 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
33 |
copyright |
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
34 |
" |
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
35 |
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
|
36 |
Copyright (C) 2013-2015 Jan Vrany |
1072 | 37 |
Copyright (C) 2016 Jan Vrany |
252
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
38 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
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
|
48 |
|
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
49 |
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
|
50 |
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
|
51 |
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
|
52 |
" |
feba6ee5c814
Added copyright notice and license information (LGPL2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
249
diff
changeset
|
53 |
! ! |
99
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 |
!CodeHighlightingService class methodsFor:'accessing'! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
label |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
"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
|
59 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
^'SmallSense - Code Highlighting' |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
"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
|
63 |
"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
|
64 |
! ! |
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 |
!CodeHighlightingService methodsFor:'accessing'! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
syntaxHighlighter |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
69 |
| highlighter | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
70 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
71 |
highlighter := super syntaxHighlighter. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
highlighter == SyntaxHighlighter ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
^ SmalltalkSyntaxHighlighter |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
highlighter == SyntaxHighlighter2 ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
^ SmalltalkSyntaxHighlighter |
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 |
^ highlighter |
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 |
"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
|
81 |
! ! |
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 |
!CodeHighlightingService methodsFor:'change & update'! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
84 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
85 |
sourceChanged:force |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
86 |
^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
|
87 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
88 |
"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
|
89 |
! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
90 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
91 |
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
|
92 |
"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
|
93 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
94 |
(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
|
95 |
(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
|
96 |
lastLineFromChanged := lastLineToChanged := nil. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
97 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
98 |
lastLineFromChanged := start. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
99 |
lastLineToChanged := end. |
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 |
self process |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
"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
|
105 |
"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
|
106 |
! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
107 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
108 |
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
|
109 |
"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
|
110 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
111 |
textView notNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
112 |
(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
|
113 |
"/ self halt. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
114 |
"/ lastContentsList ~~ textView list ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
115 |
"/ lastContentsList := textView list. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
116 |
"/ self sourceChanged:true. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
117 |
"/ 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
|
118 |
"/ ]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
119 |
^self. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
120 |
]. |
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 |
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
|
123 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
124 |
"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
|
125 |
! ! |
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 |
!CodeHighlightingService methodsFor:'event handling'! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
128 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
129 |
linesDeletedFrom:start to:end |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
130 |
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
|
131 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
132 |
"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
|
133 |
"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
|
134 |
! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
135 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
136 |
linesInsertedFrom:start to:end |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
137 |
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
|
138 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
139 |
"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
|
140 |
"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
|
141 |
! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
142 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
143 |
linesModifiedFrom:start to:end |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
144 |
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
|
145 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
146 |
"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
|
147 |
! ! |
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 |
!CodeHighlightingService methodsFor:'initialization'! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
150 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
151 |
initialize |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
152 |
job := (Smalltalk at:#BackgroundQueueProcessingJob) |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
153 |
named:self defaultJobName |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
154 |
on:[:interval | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
155 |
Error handle:[:ex | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
156 |
(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
|
157 |
ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
158 |
ex reject. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
159 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
160 |
] do:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
161 |
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
|
162 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
163 |
]. |
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 |
"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
|
166 |
! ! |
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 |
!CodeHighlightingService methodsFor:'private'! |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
169 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
170 |
setHighlightedLine: line at: lineNr |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
171 |
|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
|
172 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
173 |
"textView" modified ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
174 |
"/ 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
|
175 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
176 |
^ self |
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 |
"/ done ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
179 |
"/ "/ 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
|
180 |
"/ "/ ignore this (leftover) code. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
181 |
"/ ^ self |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
182 |
"/ ]. |
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 |
firstShown := textView firstLineShown. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
185 |
lastShown := textView lastLineShown. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
186 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
187 |
replaceAction := [:lNr :line | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
188 |
|oldLine| |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
189 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
190 |
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
|
191 |
oldLine notNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
192 |
line notNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
193 |
"/ 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
|
194 |
"/ 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
|
195 |
"/ resulting error. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
196 |
"/ Certainly a kludge. |
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 string = line string ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
199 |
| i | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
200 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
201 |
"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
|
202 |
"(presumably created by LintHighlighter)" |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
203 |
i := line string indexOfNonSeparator. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
204 |
i > 1 ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
205 |
| e | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
206 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
207 |
(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
|
208 |
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
|
209 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
210 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
211 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
212 |
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
|
213 |
textView modifiedChannel removeDependent:self. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
214 |
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
|
215 |
textView modifiedChannel addDependent:self. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
216 |
(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
|
217 |
anyChange ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
218 |
anyChange := true. |
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 |
textView redrawLine:lNr |
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 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
226 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
227 |
list := textView list. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
228 |
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
|
229 |
gutterView invalidate. |
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 |
"/ 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
|
232 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
233 |
"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
|
234 |
"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
|
235 |
! ! |
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 |
!CodeHighlightingService methodsFor:'processing'! |
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 |
process |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
240 |
"(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
|
241 |
must be (re)processed." |
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 |
| browser | |
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 |
(self syntaxHighlighters isEmptyOrNil) ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
246 |
"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
|
247 |
^self |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
248 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
249 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
250 |
"/ 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
|
251 |
"/ this info somewhere ... |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
252 |
(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
|
253 |
textView modified ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
254 |
browser navigationState realModifiedState: true |
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 |
textView modifiedChannel setValue:false. |
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 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
259 |
((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
|
260 |
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
|
261 |
job stopAndRemoveAll. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
262 |
job add: nil. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
263 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
264 |
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
|
265 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
266 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
267 |
"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
|
268 |
"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
|
269 |
! |
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 |
process: delayed |
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 |
^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
|
274 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
275 |
"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
|
276 |
"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
|
277 |
! |
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 |
process: delayed changed: interval |
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 |
|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
|
282 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
283 |
done := false. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
284 |
modified := false. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
285 |
codeView syntaxElements: nil. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
286 |
codeView syntaxElementSelection: nil. |
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 |
highlighters := self syntaxHighlighters. |
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 |
cls := codeView klass. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
291 |
(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
|
292 |
cls isMeta ifTrue:[ |
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 theNonMetaclass name) class |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
294 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
295 |
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
|
296 |
]. |
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 |
mthd := codeView methodHolder value. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
299 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
300 |
"textView" modified ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
301 |
oldCodeList := textView list copy. |
151
4dd02316ea4e
Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
99
diff
changeset
|
302 |
"/ 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
|
303 |
"/ 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
|
304 |
"/ #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
|
305 |
(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
|
306 |
oldCodeList := oldCodeList asStringCollection. |
4dd02316ea4e
Fix in SmallSense::CodeHighlightingService>>process:delayed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
99
diff
changeset
|
307 |
]. |
99
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
308 |
"textView" modified ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
309 |
oldCodeList notNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
310 |
oldCode := oldCodeList asStringWithoutEmphasis. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
311 |
"textView" modified ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
312 |
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
|
313 |
Parser parseErrorSignal handle:[:ex | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
314 |
"/ |errMsg| |
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 |
"/ 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
|
317 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
318 |
"/ Transcript topView raiseDeiconified. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
319 |
"/ 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
|
320 |
"/ self halt. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
321 |
"/ 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
|
322 |
newCode := nil. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
323 |
] do:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
324 |
| codeAspect | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
325 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
326 |
elements := ParseTreeIndex new. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
327 |
codeAspect := codeView codeAspect. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
328 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
329 |
"/ switch codeAspect |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
330 |
"/ case method |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
331 |
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
|
332 |
(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
|
333 |
newCodeList := oldCodeList. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
334 |
newCode := newCodeList asString. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
335 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
336 |
newCodeList := oldCode asStringCollection. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
337 |
newCode := oldCode asText. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
338 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
339 |
newCodeListRefetch := []. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
340 |
newCodeRefetch := []. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
341 |
highlighters do:[:h| |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
342 |
(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
|
343 |
newCodeListRefetch value. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
344 |
interval do:[:lnr | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
345 |
| ln | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
346 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
347 |
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
|
348 |
ln notEmptyOrNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
349 |
| nln | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
350 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
351 |
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
|
352 |
nln ~~ ln ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
353 |
delayed ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
354 |
codeView sensor |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
355 |
pushUserEvent:#setHighlightedLine:at: |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
356 |
for:self |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
357 |
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
|
358 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
359 |
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
|
360 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
361 |
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
|
362 |
newCodeListRefetch := []. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
363 |
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
|
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 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
367 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
368 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
369 |
newCodeRefetch value. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
370 |
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
|
371 |
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
|
372 |
newCodeRefetch := [ ]. |
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 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
376 |
"/ case expession |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
377 |
codeAspect == (SyntaxHighlighter codeAspectExpression) ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
378 |
newCodeList := oldCode asStringCollection. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
379 |
newCode := oldCode asText. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
380 |
highlighters do:[:h| |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
381 |
newCodeRefetch value. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
382 |
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
|
383 |
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
|
384 |
newCodeRefetch := [ ]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
385 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
386 |
] ifFalse:[ |
921
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
387 |
"/ case statements |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
388 |
codeAspect == (SyntaxHighlighter codeAspectStatements) ifTrue:[ |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
389 |
newCodeList := oldCode asStringCollection. |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
390 |
newCode := oldCode asText. |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
391 |
highlighters do:[:h| |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
392 |
(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
|
393 |
newCodeRefetch value. |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
394 |
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
|
395 |
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
|
396 |
newCodeRefetch := [ ]. |
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 |
]. |
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
399 |
|
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
400 |
] ifFalse:[ |
99
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
401 |
"/case class definition |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
402 |
codeView codeAspect == #classDefinition ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
403 |
(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
|
404 |
newCodeList := oldCodeList. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
405 |
newCode := newCodeList asString. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
406 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
407 |
newCodeList := oldCode asStringCollection. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
408 |
newCode := oldCode asText. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
409 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
410 |
newCodeListRefetch := []. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
411 |
newCodeRefetch := []. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
412 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
413 |
highlighters do:[:h| |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
414 |
(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
|
415 |
newCodeListRefetch value. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
416 |
interval do:[:lnr | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
417 |
| ln | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
418 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
419 |
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
|
420 |
ln notEmptyOrNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
421 |
| nln | |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
422 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
423 |
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
|
424 |
nln ~~ ln ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
425 |
delayed ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
426 |
codeView sensor |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
427 |
pushUserEvent:#setHighlightedLine:at: |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
428 |
for:self |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
429 |
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
|
430 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
431 |
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
|
432 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
433 |
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
|
434 |
newCodeListRefetch := []. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
435 |
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
|
436 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
437 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
438 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
439 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
440 |
newCodeRefetch value. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
441 |
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
|
442 |
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
|
443 |
newCodeRefetch := [ ]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
444 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
445 |
]. |
921
e5e7de67b496
Added support for highlighting of a statement list
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
374
diff
changeset
|
446 |
]]]]. |
99
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
447 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
448 |
]. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
449 |
newCode notNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
450 |
"textView" modified ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
451 |
newCode ~= oldCodeList ifTrue:[ |
193
c0c4605b3791
Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
452 |
| newCodeText | |
c0c4605b3791
Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
453 |
|
c0c4605b3791
Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
454 |
newCodeText := newCode. |
99
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
455 |
newCode := newCode asStringCollection. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
456 |
"textView" modified ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
457 |
done := true. |
193
c0c4605b3791
Keep (highlighter) source in ParseTreeIndex
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
458 |
elements source: newCodeText. |
99
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
459 |
textView notNil ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
460 |
"/ 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
|
461 |
"/ 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
|
462 |
"/ self showInfo:nil. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
463 |
delayed ifTrue:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
464 |
codeView sensor |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
465 |
pushUserEvent:#setHighlightedCode:elements: |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
466 |
for:self |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
467 |
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
|
468 |
"/self delayedUpdateBufferLabelWithCheckIfModified |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
469 |
] ifFalse:[ |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
470 |
textView contents: newCode. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
471 |
codeView syntaxElements: elements. |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
472 |
gutterView invalidate. |
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 |
] |
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
483 |
|
6943778c2db7
SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
484 |
"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
|
485 |
"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
|
486 |
! ! |
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 |
!CodeHighlightingService class methodsFor:'documentation'! |
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 |
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 |