diff options
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/html.rs | 5 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/injection.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/tags.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/tests.rs | 10 |
4 files changed, 18 insertions, 3 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ra_ide/src/syntax_highlighting/html.rs index 0c74f7370..0be55bca9 100644 --- a/crates/ra_ide/src/syntax_highlighting/html.rs +++ b/crates/ra_ide/src/syntax_highlighting/html.rs | |||
@@ -83,14 +83,15 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd | |||
83 | .bool_literal { color: #BFE6EB; } | 83 | .bool_literal { color: #BFE6EB; } |
84 | .macro { color: #94BFF3; } | 84 | .macro { color: #94BFF3; } |
85 | .module { color: #AFD8AF; } | 85 | .module { color: #AFD8AF; } |
86 | .value_param { color: #DCDCCC; } | ||
86 | .variable { color: #DCDCCC; } | 87 | .variable { color: #DCDCCC; } |
87 | .format_specifier { color: #CC696B; } | 88 | .format_specifier { color: #CC696B; } |
88 | .mutable { text-decoration: underline; } | 89 | .mutable { text-decoration: underline; } |
89 | .unresolved_reference { color: #FC5555; } | ||
90 | .escape_sequence { color: #94BFF3; } | 90 | .escape_sequence { color: #94BFF3; } |
91 | |||
92 | .keyword { color: #F0DFAF; font-weight: bold; } | 91 | .keyword { color: #F0DFAF; font-weight: bold; } |
93 | .keyword.unsafe { color: #BC8383; font-weight: bold; } | 92 | .keyword.unsafe { color: #BC8383; font-weight: bold; } |
94 | .control { font-style: italic; } | 93 | .control { font-style: italic; } |
94 | |||
95 | .unresolved_reference { color: #FC5555; text-decoration: wavy underline; } | ||
95 | </style> | 96 | </style> |
96 | "; | 97 | "; |
diff --git a/crates/ra_ide/src/syntax_highlighting/injection.rs b/crates/ra_ide/src/syntax_highlighting/injection.rs index 181c21256..8665b480f 100644 --- a/crates/ra_ide/src/syntax_highlighting/injection.rs +++ b/crates/ra_ide/src/syntax_highlighting/injection.rs | |||
@@ -25,7 +25,7 @@ pub(super) fn highlight_injection( | |||
25 | return None; | 25 | return None; |
26 | } | 26 | } |
27 | let value = literal.value()?; | 27 | let value = literal.value()?; |
28 | let (analysis, tmp_file_id) = Analysis::from_single_file(value); | 28 | let (analysis, tmp_file_id) = Analysis::from_single_file(value.into_owned()); |
29 | 29 | ||
30 | if let Some(range) = literal.open_quote_text_range() { | 30 | if let Some(range) = literal.open_quote_text_range() { |
31 | acc.add(HighlightedRange { | 31 | acc.add(HighlightedRange { |
diff --git a/crates/ra_ide/src/syntax_highlighting/tags.rs b/crates/ra_ide/src/syntax_highlighting/tags.rs index 13d9dd195..49ec94bdc 100644 --- a/crates/ra_ide/src/syntax_highlighting/tags.rs +++ b/crates/ra_ide/src/syntax_highlighting/tags.rs | |||
@@ -32,6 +32,7 @@ pub enum HighlightTag { | |||
32 | Macro, | 32 | Macro, |
33 | Module, | 33 | Module, |
34 | NumericLiteral, | 34 | NumericLiteral, |
35 | Punctuation, | ||
35 | SelfKeyword, | 36 | SelfKeyword, |
36 | SelfType, | 37 | SelfType, |
37 | Static, | 38 | Static, |
@@ -41,6 +42,7 @@ pub enum HighlightTag { | |||
41 | TypeAlias, | 42 | TypeAlias, |
42 | TypeParam, | 43 | TypeParam, |
43 | Union, | 44 | Union, |
45 | ValueParam, | ||
44 | Local, | 46 | Local, |
45 | UnresolvedReference, | 47 | UnresolvedReference, |
46 | FormatSpecifier, | 48 | FormatSpecifier, |
@@ -82,6 +84,7 @@ impl HighlightTag { | |||
82 | HighlightTag::Generic => "generic", | 84 | HighlightTag::Generic => "generic", |
83 | HighlightTag::Keyword => "keyword", | 85 | HighlightTag::Keyword => "keyword", |
84 | HighlightTag::Lifetime => "lifetime", | 86 | HighlightTag::Lifetime => "lifetime", |
87 | HighlightTag::Punctuation => "punctuation", | ||
85 | HighlightTag::Macro => "macro", | 88 | HighlightTag::Macro => "macro", |
86 | HighlightTag::Module => "module", | 89 | HighlightTag::Module => "module", |
87 | HighlightTag::NumericLiteral => "numeric_literal", | 90 | HighlightTag::NumericLiteral => "numeric_literal", |
@@ -95,6 +98,7 @@ impl HighlightTag { | |||
95 | HighlightTag::TypeAlias => "type_alias", | 98 | HighlightTag::TypeAlias => "type_alias", |
96 | HighlightTag::TypeParam => "type_param", | 99 | HighlightTag::TypeParam => "type_param", |
97 | HighlightTag::Union => "union", | 100 | HighlightTag::Union => "union", |
101 | HighlightTag::ValueParam => "value_param", | ||
98 | HighlightTag::Local => "variable", | 102 | HighlightTag::Local => "variable", |
99 | HighlightTag::UnresolvedReference => "unresolved_reference", | 103 | HighlightTag::UnresolvedReference => "unresolved_reference", |
100 | } | 104 | } |
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index aa7c887d6..87a6e2523 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs | |||
@@ -25,6 +25,16 @@ impl Bar for Foo { | |||
25 | } | 25 | } |
26 | } | 26 | } |
27 | 27 | ||
28 | impl Foo { | ||
29 | fn baz(mut self) -> i32 { | ||
30 | self.x | ||
31 | } | ||
32 | |||
33 | fn qux(&mut self) { | ||
34 | self.x = 0; | ||
35 | } | ||
36 | } | ||
37 | |||
28 | static mut STATIC_MUT: i32 = 0; | 38 | static mut STATIC_MUT: i32 = 0; |
29 | 39 | ||
30 | fn foo<'a, T>() -> T { | 40 | fn foo<'a, T>() -> T { |