From 47ce5ea581f3fe53a31e166c5feac6c64a8a97e4 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Tue, 12 May 2020 21:58:51 -0700 Subject: Color attribute functions --- crates/ra_ide/src/syntax_highlighting/tags.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src/syntax_highlighting') diff --git a/crates/ra_ide/src/syntax_highlighting/tags.rs b/crates/ra_ide/src/syntax_highlighting/tags.rs index be1a0f12b..33e6619ec 100644 --- a/crates/ra_ide/src/syntax_highlighting/tags.rs +++ b/crates/ra_ide/src/syntax_highlighting/tags.rs @@ -45,8 +45,10 @@ pub enum HighlightTag { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] #[repr(u8)] pub enum HighlightModifier { + /// Used to differentiate individual elements within attributes. + Attribute = 0, /// Used with keywords like `if` and `break`. - ControlFlow = 0, + ControlFlow, /// `foo` in `fn foo(x: i32)` is a definition, `foo` in `foo(90 + 2)` is /// not. Definition, @@ -95,6 +97,7 @@ impl fmt::Display for HighlightTag { impl HighlightModifier { const ALL: &'static [HighlightModifier] = &[ + HighlightModifier::Attribute, HighlightModifier::ControlFlow, HighlightModifier::Definition, HighlightModifier::Mutable, @@ -103,6 +106,7 @@ impl HighlightModifier { fn as_str(self) -> &'static str { match self { + HighlightModifier::Attribute => "attribute", HighlightModifier::ControlFlow => "control", HighlightModifier::Definition => "declaration", HighlightModifier::Mutable => "mutable", -- cgit v1.2.3