diff options
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/html.rs | 1 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/tags.rs | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ra_ide/src/syntax_highlighting/html.rs index ff0eeeb52..edfe61f39 100644 --- a/crates/ra_ide/src/syntax_highlighting/html.rs +++ b/crates/ra_ide/src/syntax_highlighting/html.rs | |||
@@ -76,6 +76,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
76 | .type_param { color: #DFAF8F; } | 76 | .type_param { color: #DFAF8F; } |
77 | .attribute { color: #94BFF3; } | 77 | .attribute { color: #94BFF3; } |
78 | .numeric_literal { color: #BFEBBF; } | 78 | .numeric_literal { color: #BFEBBF; } |
79 | .bool_literal { color: #BFE6EB; } | ||
79 | .macro { color: #94BFF3; } | 80 | .macro { color: #94BFF3; } |
80 | .module { color: #AFD8AF; } | 81 | .module { color: #AFD8AF; } |
81 | .variable { color: #DCDCCC; } | 82 | .variable { color: #DCDCCC; } |
diff --git a/crates/ra_ide/src/syntax_highlighting/tags.rs b/crates/ra_ide/src/syntax_highlighting/tags.rs index be1a0f12b..46c718c91 100644 --- a/crates/ra_ide/src/syntax_highlighting/tags.rs +++ b/crates/ra_ide/src/syntax_highlighting/tags.rs | |||
@@ -15,6 +15,7 @@ pub struct HighlightModifiers(u32); | |||
15 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] | 15 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] |
16 | pub enum HighlightTag { | 16 | pub enum HighlightTag { |
17 | Attribute, | 17 | Attribute, |
18 | BoolLiteral, | ||
18 | BuiltinType, | 19 | BuiltinType, |
19 | ByteLiteral, | 20 | ByteLiteral, |
20 | CharLiteral, | 21 | CharLiteral, |
@@ -29,6 +30,7 @@ pub enum HighlightTag { | |||
29 | Macro, | 30 | Macro, |
30 | Module, | 31 | Module, |
31 | NumericLiteral, | 32 | NumericLiteral, |
33 | SelfKeyword, | ||
32 | SelfType, | 34 | SelfType, |
33 | Static, | 35 | Static, |
34 | StringLiteral, | 36 | StringLiteral, |
@@ -45,8 +47,10 @@ pub enum HighlightTag { | |||
45 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] | 47 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] |
46 | #[repr(u8)] | 48 | #[repr(u8)] |
47 | pub enum HighlightModifier { | 49 | pub enum HighlightModifier { |
50 | /// Used to differentiate individual elements within attributes. | ||
51 | Attribute = 0, | ||
48 | /// Used with keywords like `if` and `break`. | 52 | /// Used with keywords like `if` and `break`. |
49 | ControlFlow = 0, | 53 | ControlFlow, |
50 | /// `foo` in `fn foo(x: i32)` is a definition, `foo` in `foo(90 + 2)` is | 54 | /// `foo` in `fn foo(x: i32)` is a definition, `foo` in `foo(90 + 2)` is |
51 | /// not. | 55 | /// not. |
52 | Definition, | 56 | Definition, |
@@ -58,6 +62,7 @@ impl HighlightTag { | |||
58 | fn as_str(self) -> &'static str { | 62 | fn as_str(self) -> &'static str { |
59 | match self { | 63 | match self { |
60 | HighlightTag::Attribute => "attribute", | 64 | HighlightTag::Attribute => "attribute", |
65 | HighlightTag::BoolLiteral => "bool_literal", | ||
61 | HighlightTag::BuiltinType => "builtin_type", | 66 | HighlightTag::BuiltinType => "builtin_type", |
62 | HighlightTag::ByteLiteral => "byte_literal", | 67 | HighlightTag::ByteLiteral => "byte_literal", |
63 | HighlightTag::CharLiteral => "char_literal", | 68 | HighlightTag::CharLiteral => "char_literal", |
@@ -72,6 +77,7 @@ impl HighlightTag { | |||
72 | HighlightTag::Macro => "macro", | 77 | HighlightTag::Macro => "macro", |
73 | HighlightTag::Module => "module", | 78 | HighlightTag::Module => "module", |
74 | HighlightTag::NumericLiteral => "numeric_literal", | 79 | HighlightTag::NumericLiteral => "numeric_literal", |
80 | HighlightTag::SelfKeyword => "self_keyword", | ||
75 | HighlightTag::SelfType => "self_type", | 81 | HighlightTag::SelfType => "self_type", |
76 | HighlightTag::Static => "static", | 82 | HighlightTag::Static => "static", |
77 | HighlightTag::StringLiteral => "string_literal", | 83 | HighlightTag::StringLiteral => "string_literal", |
@@ -95,6 +101,7 @@ impl fmt::Display for HighlightTag { | |||
95 | 101 | ||
96 | impl HighlightModifier { | 102 | impl HighlightModifier { |
97 | const ALL: &'static [HighlightModifier] = &[ | 103 | const ALL: &'static [HighlightModifier] = &[ |
104 | HighlightModifier::Attribute, | ||
98 | HighlightModifier::ControlFlow, | 105 | HighlightModifier::ControlFlow, |
99 | HighlightModifier::Definition, | 106 | HighlightModifier::Definition, |
100 | HighlightModifier::Mutable, | 107 | HighlightModifier::Mutable, |
@@ -103,6 +110,7 @@ impl HighlightModifier { | |||
103 | 110 | ||
104 | fn as_str(self) -> &'static str { | 111 | fn as_str(self) -> &'static str { |
105 | match self { | 112 | match self { |
113 | HighlightModifier::Attribute => "attribute", | ||
106 | HighlightModifier::ControlFlow => "control", | 114 | HighlightModifier::ControlFlow => "control", |
107 | HighlightModifier::Definition => "declaration", | 115 | HighlightModifier::Definition => "declaration", |
108 | HighlightModifier::Mutable => "mutable", | 116 | HighlightModifier::Mutable => "mutable", |