aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmer Ben-Amram <[email protected]>2019-12-14 11:24:07 +0000
committerOmer Ben-Amram <[email protected]>2019-12-14 11:24:07 +0000
commit67641d3f5fd1cfd49673c4eea9e3d646ed97e108 (patch)
tree5602a4f4ba4314e22a75923ae741de58c0ca3a9c
parent30672c420ee19faa1acc15ecc84ae8d17c309e95 (diff)
added decorations
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs4
-rw-r--r--editors/code/package.json56
-rw-r--r--editors/code/src/highlighting.ts6
3 files changed, 63 insertions, 3 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index cd9d8b058..7be25b234 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -225,8 +225,8 @@ fn highlight_name(db: &RootDatabase, name_kind: NameKind) -> &'static str {
225 Def(hir::ModuleDef::EnumVariant(_)) => "constant", 225 Def(hir::ModuleDef::EnumVariant(_)) => "constant",
226 Def(hir::ModuleDef::Const(_)) => "constant", 226 Def(hir::ModuleDef::Const(_)) => "constant",
227 Def(hir::ModuleDef::Static(_)) => "constant", 227 Def(hir::ModuleDef::Static(_)) => "constant",
228 Def(hir::ModuleDef::Trait(_)) => "type.trait", 228 Def(hir::ModuleDef::Trait(_)) => "type",
229 Def(hir::ModuleDef::TypeAlias(_)) => "type.alias", 229 Def(hir::ModuleDef::TypeAlias(_)) => "type",
230 Def(hir::ModuleDef::BuiltinType(_)) => "type.builtin", 230 Def(hir::ModuleDef::BuiltinType(_)) => "type.builtin",
231 SelfType(_) => "type.self", 231 SelfType(_) => "type.self",
232 TypeParam(_) => "type.param", 232 TypeParam(_) => "type.param",
diff --git a/editors/code/package.json b/editors/code/package.json
index 7bc08ec31..c24e73d24 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -423,6 +423,33 @@
423 } 423 }
424 }, 424 },
425 { 425 {
426 "id": "ralsp.literal.numeric",
427 "description": "Color for numeric literals",
428 "defaults": {
429 "dark": "#BECEA8",
430 "light": "#09885A",
431 "highContrast": "#B5CEA8"
432 }
433 },
434 {
435 "id": "ralsp.literal.char",
436 "description": "Color for character literals",
437 "defaults": {
438 "dark": "#BECEA8",
439 "light": "#09885A",
440 "highContrast": "#B5CEA8"
441 }
442 },
443 {
444 "id": "ralsp.literal.byte",
445 "description": "Color for byte literals",
446 "defaults": {
447 "dark": "#BECEA8",
448 "light": "#09885A",
449 "highContrast": "#B5CEA8"
450 }
451 },
452 {
426 "id": "ralsp.macro", 453 "id": "ralsp.macro",
427 "description": "Color for macros", 454 "description": "Color for macros",
428 "defaults": { 455 "defaults": {
@@ -442,7 +469,34 @@
442 }, 469 },
443 { 470 {
444 "id": "ralsp.type", 471 "id": "ralsp.type",
445 "description": "Color for types", 472 "description": "Color for other types (traits, aliases..)",
473 "defaults": {
474 "dark": "#4EC9B0",
475 "light": "#267F99",
476 "highContrast": "#4EC9B0"
477 }
478 },
479 {
480 "id": "ralsp.type.builtin",
481 "description": "Color for built-in types (&str, bool, u16, u32)",
482 "defaults": {
483 "dark": "#4EC9B0",
484 "light": "#267F99",
485 "highContrast": "#4EC9B0"
486 }
487 },
488 {
489 "id": "ralsp.type.self",
490 "description": "Color for `Self` param type",
491 "defaults": {
492 "dark": "#4EC9B0",
493 "light": "#267F99",
494 "highContrast": "#4EC9B0"
495 }
496 },
497 {
498 "id": "ralsp.type.param",
499 "description": "Color for type parameters",
446 "defaults": { 500 "defaults": {
447 "dark": "#4EC9B0", 501 "dark": "#4EC9B0",
448 "light": "#267F99", 502 "light": "#267F99",
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index 6d50a2f2d..2c8a98aa6 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -53,10 +53,16 @@ export class Highlighter {
53 decoration('parameter'), 53 decoration('parameter'),
54 decoration('constant'), 54 decoration('constant'),
55 decoration('type'), 55 decoration('type'),
56 decoration('type.self'),
57 decoration('type.generic'),
58 decoration('type.param'),
56 decoration('builtin'), 59 decoration('builtin'),
57 decoration('text'), 60 decoration('text'),
58 decoration('attribute'), 61 decoration('attribute'),
59 decoration('literal'), 62 decoration('literal'),
63 decoration('literal.numeric'),
64 decoration('literal.char'),
65 decoration('literal.byte'),
60 decoration('macro'), 66 decoration('macro'),
61 decoration('variable'), 67 decoration('variable'),
62 decoration('variable.mut', 'underline'), 68 decoration('variable.mut', 'underline'),