diff --git a/crates/ide/src/syntax_highlighting/injection.rs b/crates/ide/src/syntax_highlighting/injection.rs index e97d1be1aa8..9eb184c74bf 100644 --- a/crates/ide/src/syntax_highlighting/injection.rs +++ b/crates/ide/src/syntax_highlighting/injection.rs @@ -179,6 +179,5 @@ pub(super) fn highlight_doc_comment( stack.add(comment); } stack.pop_and_inject(None); - stack - .pop_and_inject(Some(Highlight::from(HighlightTag::Generic) | HighlightModifier::Injected)); + stack.pop_and_inject(Some(Highlight::from(HighlightTag::Dummy) | HighlightModifier::Injected)); } diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index 1b3b31747e6..e07cfb43fe6 100644 --- a/crates/ide/src/syntax_highlighting/tags.rs +++ b/crates/ide/src/syntax_highlighting/tags.rs @@ -33,8 +33,8 @@ pub enum HighlightTag { Operator, UnresolvedReference, - // FIXME: this one is random and don't fit with the others - Generic, + // For things which don't have proper Tag, but want to use modifiers. + Dummy, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -90,7 +90,7 @@ impl HighlightTag { HighlightTag::Comment => "comment", HighlightTag::EscapeSequence => "escape_sequence", HighlightTag::FormatSpecifier => "format_specifier", - HighlightTag::Generic => "generic", + HighlightTag::Dummy => "dummy", HighlightTag::Keyword => "keyword", HighlightTag::Punctuation => "punctuation", HighlightTag::NumericLiteral => "numeric_literal", diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html index 882c529d88f..56aba43e86b 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html @@ -36,7 +36,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
/// ```
-/// let _ = "early doctests should not go boom";
+/// let _ = "early doctests should not go boom";
/// ```
struct Foo {
bar: bool,
@@ -50,8 +50,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
/// # Examples
///
/// ```
- /// # #![allow(unused_mut)]
- /// let mut foo: Foo = Foo::new();
+ /// # #![allow(unused_mut)]
+ /// let mut foo: Foo = Foo::new();
/// ```
pub const fn new() -> Foo {
Foo { bar: true }
@@ -62,26 +62,26 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
/// # Examples
///
/// ```
- /// use x::y;
+ /// use x::y;
///
- /// let foo = Foo::new();
+ /// let foo = Foo::new();
///
/// // calls bar on foo
- /// assert!(foo.bar());
+ /// assert!(foo.bar());
///
- /// let bar = foo.bar || Foo::bar;
+ /// let bar = foo.bar || Foo::bar;
///
/// /* multi-line
/// comment */
///
- /// let multi_line_string = "Foo
+ /// let multi_line_string = "Foo
/// bar
/// ";
///
/// ```
///
/// ```rust,no_run
- /// let foobar = Foo::new().bar();
+ /// let foobar = Foo::new().bar();
/// ```
///
/// ```sh
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 9bea7366b8f..e0561b5a7a8 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -406,7 +406,7 @@ fn semantic_token_type_and_modifiers(
SymbolKind::Macro => lsp_types::SemanticTokenType::MACRO,
},
HighlightTag::BuiltinType => semantic_tokens::BUILTIN_TYPE,
- HighlightTag::Generic => semantic_tokens::GENERIC,
+ HighlightTag::Dummy => semantic_tokens::GENERIC,
HighlightTag::ByteLiteral | HighlightTag::NumericLiteral => {
lsp_types::SemanticTokenType::NUMBER
}