--- a/tools/JavaSourceHighlighter.st Wed Sep 11 03:01:48 2013 +0100
+++ b/tools/JavaSourceHighlighter.st Wed Sep 11 11:35:14 2013 +0100
@@ -31,7 +31,8 @@
Object subclass:#Marker
instanceVariableNames:'highlighter'
classVariableNames:'MARK_KEYWORD MARK_NUMBER MARK_STRING MARK_CHARACTER MARK_COMMENT
- MARK_JAVADOC MARK_KEYWORD_FLOW'
+ MARK_JAVADOC MARK_KEYWORD_FLOW MARK_SELECTOR MARK_FIELD
+ MARK_FIELD_ASSIGNED MARK_LOCAL MARK_CLASS'
poolDictionaries:''
privateIn:JavaSourceHighlighter
!
@@ -346,9 +347,28 @@
!JavaSourceHighlighter methodsFor:'queries'!
doLexicalHighlightingOnly
+ "/ For now, in debugger always use lexical highlighting. Makes highlighter debugging easier"
+
+ | process wgroups |
+
+ process := Processor activeProcess.
+ wgroups := WindowGroup scheduledWindowGroups.
+ [ process notNil ] whileTrue:[
+ | groups wg |
+ groups := wgroups select:[:wg | wg process == process ].
+ groups notEmpty ifTrue:[
+ wg := groups detect:[:wg | wg isModal] ifNone:nil.
+ wg isNil ifTrue:[
+ wg := groups anElement
+ ].
+ (wg mainView class == DebugView) ifTrue:[ ^ true ]
+ ].
+ process := process parentProcess.
+ ].
^ false
"Created: / 09-09-2013 / 02:25:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 11-09-2013 / 03:39:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaSourceHighlighter methodsFor:'syntax detection'!
@@ -588,6 +608,19 @@
"Modified: / 17-03-2012 / 13:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+markSelectorFrom:pos1 to:pos2
+ | fg em |
+
+ fg := preferences selectorColor.
+ em := preferences selectorEmphasis.
+
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:em color:fg
+
+ "Created: / 11-09-2013 / 05:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
markSelfFrom:pos1 to:pos2
self
markFrom:pos1 to:pos2
@@ -666,15 +699,20 @@
self lookupObject: JavaLookup instance.
- MARK_KEYWORD := 1.
- MARK_NUMBER := 2.
- MARK_STRING := 3.
- MARK_CHARACTER := 4.
- MARK_COMMENT := 5.
- MARK_JAVADOC := 6.
- MARK_KEYWORD_FLOW := 7.
+ MARK_KEYWORD := 1.
+ MARK_NUMBER := 2.
+ MARK_STRING := 3.
+ MARK_CHARACTER := 4.
+ MARK_COMMENT := 5.
+ MARK_JAVADOC := 6.
+ MARK_KEYWORD_FLOW := 7.
+ MARK_SELECTOR := 8.
+ MARK_FIELD := 9.
+ MARK_FIELD_ASSIGNED := 10.
+ MARK_LOCAL := 11.
+ MARK_CLASS := 12.
- "Modified: / 05-09-2013 / 03:14:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 11-09-2013 / 01:45:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
@@ -698,8 +736,10 @@
kind == MARK_COMMENT ifTrue:[ ^ highlighter markCommentFrom: pos1 + 1 to: pos2 + 1 ].
kind == MARK_JAVADOC ifTrue:[ ^ highlighter markCommentFrom: pos1 + 1 to: pos2 + 1 ].
+ kind == MARK_SELECTOR ifTrue:[ ^ highlighter markSelectorFrom: pos1 + 1 to: pos2 + 1 ].
+
"Created: / 05-09-2013 / 03:03:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 05-09-2013 / 09:07:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 11-09-2013 / 01:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaSourceHighlighter::Scanner methodsFor:'accessing'!