added decorations

This commit is contained in:
Omer Ben-Amram 2019-12-14 13:24:07 +02:00
parent 30672c420e
commit 67641d3f5f
3 changed files with 63 additions and 3 deletions

View 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",

View file

@ -422,6 +422,33 @@
"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",
@ -442,7 +469,34 @@
},
{
"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",

View 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'),