From 6fb52af521ab8ca2fdd3ea7cfa95eaebd0cba1fc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 9 Jan 2021 14:41:31 +0300 Subject: Rename dummy -> none --- crates/ide/src/syntax_highlighting/highlights.rs | 2 +- crates/ide/src/syntax_highlighting/tags.rs | 8 ++++---- .../test_data/highlight_doctest.html | 20 ++++++++++---------- crates/rust-analyzer/src/to_proto.rs | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/ide/src/syntax_highlighting/highlights.rs b/crates/ide/src/syntax_highlighting/highlights.rs index 3e733c87c..7ff1593ae 100644 --- a/crates/ide/src/syntax_highlighting/highlights.rs +++ b/crates/ide/src/syntax_highlighting/highlights.rs @@ -20,7 +20,7 @@ impl Highlights { Highlights { root: Node::new(HighlightedRange { range, - highlight: HighlightTag::Dummy.into(), + highlight: HighlightTag::None.into(), binding_hash: None, }), } diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index a0286b72d..07c788b50 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, - // For things which don't have proper Tag, but want to use modifiers. - Dummy, + // For things which don't have a specific highlight. + None, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -100,7 +100,7 @@ impl HighlightTag { HighlightTag::Operator => "operator", HighlightTag::StringLiteral => "string_literal", HighlightTag::UnresolvedReference => "unresolved_reference", - HighlightTag::Dummy => "dummy", + HighlightTag::None => "none", } } } @@ -174,7 +174,7 @@ impl Highlight { Highlight { tag, modifiers: HighlightModifiers::default() } } pub fn is_empty(&self) -> bool { - self.tag == HighlightTag::Dummy && self.modifiers == HighlightModifiers::default() + self.tag == HighlightTag::None && self.modifiers == HighlightModifiers::default() } } 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 9d42b11c1..7d1d2a839 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html @@ -37,7 +37,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,
@@ -45,7 +45,7 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
 
 impl Foo {
     /// ```
-    /// let _ = "Call me
+    /// let _ = "Call me
     //    KILLER WHALE
     ///     Ishmael.";
     /// ```
@@ -56,8 +56,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 }
@@ -68,26 +68,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 204cae265..4cfe6ff51 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -413,7 +413,7 @@ fn semantic_token_type_and_modifiers(
             SymbolKind::Macro => lsp_types::SemanticTokenType::MACRO,
         },
         HighlightTag::BuiltinType => semantic_tokens::BUILTIN_TYPE,
-        HighlightTag::Dummy => semantic_tokens::GENERIC,
+        HighlightTag::None => semantic_tokens::GENERIC,
         HighlightTag::ByteLiteral | HighlightTag::NumericLiteral => {
             lsp_types::SemanticTokenType::NUMBER
         }
-- 
cgit v1.2.3