author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 02 Aug 2013 16:40:58 +0100 | |
changeset 47 | 547d48a49dbd |
parent 42 | 48307f46ff8e |
child 48 | 1ff5ddc8dc9c |
permissions | -rw-r--r-- |
42
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'jv:smallsense' }" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
Tools::CodeHighlightingService subclass:#SmallSenseSyntaxHighlightingService |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
instanceVariableNames:'' |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
classVariableNames:'' |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
category:'SmallSense-Services' |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
!SmallSenseSyntaxHighlightingService class methodsFor:'accessing'! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
12 |
label |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
"Answers a short label - for UI" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
^'SmallSense - Syntax Highlighting' |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
"Created: / 27-07-2013 / 22:46:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
! ! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
!SmallSenseSyntaxHighlightingService methodsFor:'change & update'! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
sourceChanged:force |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
^self sourceChanged: force from: nil to: nil. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
"Created: / 27-07-2013 / 22:52:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
sourceChanged:force from:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
"Called when codeview's text changes" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
31 |
(force or:[codeView reallyModified]) ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
32 |
self process |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
33 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
"Created: / 27-07-2013 / 22:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
36 |
! ! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
37 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
38 |
!SmallSenseSyntaxHighlightingService methodsFor:'event handling'! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
39 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
linesDeletedFrom:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
self sourceChanged:true from:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
42 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
43 |
"Created: / 27-07-2013 / 22:51:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
44 |
! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
45 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
46 |
linesInsertedFrom:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
47 |
self sourceChanged:true from:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
"Created: / 27-07-2013 / 22:51:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
50 |
! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
51 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
52 |
linesModifiedFrom:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
self sourceChanged:true from:start to:end |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
"Created: / 27-07-2013 / 22:50:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
! ! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
!SmallSenseSyntaxHighlightingService methodsFor:'private'! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
process: delayed |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
|oldCode oldCodeList newCode elements cls mthd highlighterClasses| |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
done := false. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
65 |
modified := false. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
66 |
codeView syntaxElements: nil. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
codeView syntaxElementSelection: nil. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
69 |
highlighterClasses := self syntaxHighlighters. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
70 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
71 |
cls := codeView klass. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
(cls notNil and:[cls isObsolete]) ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
cls isMeta ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
cls := (Smalltalk at:cls theNonMetaclass name) class |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
] ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
cls := Smalltalk at:cls name |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
77 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
78 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
79 |
mthd := codeView methodHolder value. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
80 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
81 |
"textView" modified ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
82 |
oldCodeList := textView list copy. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
83 |
"textView" modified ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
84 |
oldCodeList isNil ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
85 |
oldCode := oldCodeList asStringWithoutEmphasis. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
86 |
"textView" modified ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
87 |
Screen currentScreenQuerySignal answer:codeView device |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
88 |
do:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
89 |
Parser parseErrorSignal handle:[:ex | |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
90 |
|errMsg| |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
91 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
92 |
errMsg := ex description asStringCollection first asString. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
93 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
94 |
"/ Transcript topView raiseDeiconified. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
95 |
"/ Transcript showCR:'ParseError: ', ex description. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
96 |
"/ self halt. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
97 |
"/ self showInfo:(errMsg colorizeAllWith:Color red). |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
98 |
newCode := nil. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
99 |
] do:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
| codeAspect | |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
101 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
elements := ParseTreeIndex new. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
newCode := oldCode asText. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
codeAspect := codeView codeAspect. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
105 |
codeAspect == SyntaxHighlighter codeAspectMethod ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
106 |
highlighterClasses do:[:e|newCode := e formatMethod:mthd source:newCode in:cls using:syntaxPreferences elementsInto: elements]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
107 |
] ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
108 |
codeAspect == (SyntaxHighlighter codeAspectExpression) ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
109 |
highlighterClasses do:[:e|newCode := e formatExpression:newCode in:cls elementsInto: elements]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
110 |
] ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
111 |
codeView codeAspect == #classDefinition ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
112 |
highlighterClasses do:[:e|newCode := e formatClassDefinition:newCode in:cls elementsInto: elements]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
113 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
114 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
115 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
116 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
117 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
118 |
newCode notNil ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
119 |
"textView" modified ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
120 |
newCode ~= oldCodeList ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
121 |
newCode := newCode asStringCollection. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
122 |
"textView" modified ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
123 |
done := true. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
124 |
textView notNil ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
125 |
"/ must add this event - and not been interrupted |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
126 |
"/ by any arriving key-event. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
127 |
"/ self showInfo:nil. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
128 |
delayed ifTrue:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
129 |
codeView sensor |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
130 |
pushUserEvent:#setHighlightedCode:elements: |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
131 |
for:self |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
132 |
withArguments:(Array with:newCode with: elements). |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
133 |
"/self delayedUpdateBufferLabelWithCheckIfModified |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
134 |
] ifFalse:[ |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
135 |
textView contents: newCode. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
136 |
codeView syntaxElements: elements. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
137 |
gutterView invalidate. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
138 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
139 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
140 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
141 |
]. |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
142 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
143 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
144 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
145 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
146 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
147 |
] |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
148 |
|
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
149 |
"Created: / 27-07-2013 / 22:53:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
150 |
! ! |
48307f46ff8e
Edit support cut off to a new service. Added SmallSense syntax highlighting service.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
151 |