Skip to content

Commit 60a58b1

Browse files
committed
#49 identify hard-coded colors; remove hard-coded black
1 parent b519fe9 commit 60a58b1

File tree

1 file changed

+10
-6
lines changed
  • chromedevtools/plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/editors

1 file changed

+10
-6
lines changed

chromedevtools/plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/editors/JsCodeScanner.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@
2121

2222
/**
2323
* JavaScript code scanner for source code highlighting.
24+
* @author Chromium Authors
25+
* @author Paul Verest
2426
*/
2527
public class JsCodeScanner extends BufferedRuleBasedScanner {
2628

2729
private Token commentToken;
2830

2931
private final TextAttribute commentAttribute =
30-
new TextAttribute(EditorColors.getColor(new RGB(63, 127, 95)), null, SWT.NORMAL);
32+
new TextAttribute(EditorColors.getColor(new RGB(63, 127, 95)), null, SWT.NORMAL); //! hard-coded
3133

3234
private final TextAttribute jsDocAttribute =
33-
new TextAttribute(EditorColors.getColor(new RGB(127,127,159)), null, SWT.NORMAL);
35+
new TextAttribute(EditorColors.getColor(new RGB(127,127,159)), null, SWT.NORMAL); //! hard-coded
3436

3537
public JsCodeScanner() {
3638
createRules();
@@ -49,22 +51,22 @@ public TextAttribute getJsDocAttribute() {
4951
*/
5052
private void createRules() {
5153
Token keywordToken = new Token(
52-
new TextAttribute(EditorColors.getColor(new RGB(127, 0, 85)), null, SWT.BOLD));
54+
new TextAttribute(EditorColors.getColor(new RGB(127, 0, 85)), null, SWT.BOLD)); //! hard-coded
5355

5456
commentToken = new Token(commentAttribute);
5557

5658
Token jsDocToken = new Token(jsDocAttribute);
5759

5860
Token stringToken = new Token(
59-
new TextAttribute(EditorColors.getColor(new RGB(42, 0, 255)), null, SWT.NORMAL));
61+
new TextAttribute(EditorColors.getColor(new RGB(42, 0, 255)), null, SWT.NORMAL)); //! hard-coded
6062

6163
RGB blackRgb = new RGB(0, 0, 0);
6264

6365
Token numberToken = new Token(
64-
new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));
66+
new TextAttribute(null, null, SWT.NORMAL)); //EditorColors.getColor(blackRgb) //! hard-coded
6567

6668
Token normalToken = new Token(
67-
new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));
69+
new TextAttribute(null, null, SWT.NORMAL)); //EditorColors.getColor(blackRgb) //! hard-coded
6870
setDefaultReturnToken(normalToken);
6971

7072
setRules(new IRule[] {
@@ -120,6 +122,8 @@ private static class KeywordRule extends WordRule {
120122
"void", //$NON-NLS-1$
121123
"while", //$NON-NLS-1$
122124
"with", //$NON-NLS-1$
125+
//+ @since 0.10
126+
"yield", //$NON-NLS-1$
123127

124128
// Highlight important qualifiers
125129
"__proto__", //$NON-NLS-1$

0 commit comments

Comments
 (0)