]> git.lizzy.rs Git - rust.git/commitdiff
added decorations
authorOmer Ben-Amram <omerbenamram@gmail.com>
Sat, 14 Dec 2019 11:24:07 +0000 (13:24 +0200)
committerOmer Ben-Amram <omerbenamram@gmail.com>
Sat, 14 Dec 2019 11:24:07 +0000 (13:24 +0200)
crates/ra_ide/src/syntax_highlighting.rs
editors/code/package.json
editors/code/src/highlighting.ts

index cd9d8b058f77298fd608c14b2167189509d08ddf..7be25b234fbe92b837481ac684fe8988e4116320 100644 (file)
@@ -225,8 +225,8 @@ fn highlight_name(db: &RootDatabase, name_kind: NameKind) -> &'static str {
         Def(hir::ModuleDef::EnumVariant(_)) => "constant",
         Def(hir::ModuleDef::Const(_)) => "constant",
         Def(hir::ModuleDef::Static(_)) => "constant",
-        Def(hir::ModuleDef::Trait(_)) => "type.trait",
-        Def(hir::ModuleDef::TypeAlias(_)) => "type.alias",
+        Def(hir::ModuleDef::Trait(_)) => "type",
+        Def(hir::ModuleDef::TypeAlias(_)) => "type",
         Def(hir::ModuleDef::BuiltinType(_)) => "type.builtin",
         SelfType(_) => "type.self",
         TypeParam(_) => "type.param",
index 7bc08ec31fec5498dd6fdbbe6f108bab026f9f58..c24e73d24f620bf9b9ee4b01f32240bcd19bdcd9 100644 (file)
                     "highContrast": "#B5CEA8"
                 }
             },
+            {
+                "id": "ralsp.literal.numeric",
+                "description": "Color for numeric literals",
+                "defaults": {
+                    "dark": "#BECEA8",
+                    "light": "#09885A",
+                    "highContrast": "#B5CEA8"
+                }
+            },
+            {
+                "id": "ralsp.literal.char",
+                "description": "Color for character literals",
+                "defaults": {
+                    "dark": "#BECEA8",
+                    "light": "#09885A",
+                    "highContrast": "#B5CEA8"
+                }
+            },
+            {
+                "id": "ralsp.literal.byte",
+                "description": "Color for byte literals",
+                "defaults": {
+                    "dark": "#BECEA8",
+                    "light": "#09885A",
+                    "highContrast": "#B5CEA8"
+                }
+            },
             {
                 "id": "ralsp.macro",
                 "description": "Color for macros",
             },
             {
                 "id": "ralsp.type",
-                "description": "Color for types",
+                "description": "Color for other types (traits, aliases..)",
+                "defaults": {
+                    "dark": "#4EC9B0",
+                    "light": "#267F99",
+                    "highContrast": "#4EC9B0"
+                }
+            },
+            {
+                "id": "ralsp.type.builtin",
+                "description": "Color for built-in types (&str, bool, u16, u32)",
+                "defaults": {
+                    "dark": "#4EC9B0",
+                    "light": "#267F99",
+                    "highContrast": "#4EC9B0"
+                }
+            },
+            {
+                "id": "ralsp.type.self",
+                "description": "Color for `Self` param type",
+                "defaults": {
+                    "dark": "#4EC9B0",
+                    "light": "#267F99",
+                    "highContrast": "#4EC9B0"
+                }
+            },
+            {
+                "id": "ralsp.type.param",
+                "description": "Color for type parameters",
                 "defaults": {
                     "dark": "#4EC9B0",
                     "light": "#267F99",
index 6d50a2f2ded08886227e7d9de60445ba88e3acdc..2c8a98aa6954eb5bede3b63a7f60eb862dd29c72 100644 (file)
@@ -53,10 +53,16 @@ export class Highlighter {
             decoration('parameter'),
             decoration('constant'),
             decoration('type'),
+            decoration('type.self'),
+            decoration('type.generic'),
+            decoration('type.param'),
             decoration('builtin'),
             decoration('text'),
             decoration('attribute'),
             decoration('literal'),
+            decoration('literal.numeric'),
+            decoration('literal.char'),
+            decoration('literal.byte'),
             decoration('macro'),
             decoration('variable'),
             decoration('variable.mut', 'underline'),