aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-23 13:52:59 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-23 13:52:59 +0100
commitc290bb0749c14409cbab657e12123320176a33e5 (patch)
tree72f4f2b23092cebb2632ee430bf29ab69c6d53f1 /editors/code
parent44665685257f18d182ab116855dd9e8b054c49da (diff)
parentf1ec88cc56c0bb24c56e6f9f898ac567ce34c79f (diff)
Merge #1305
1305: Try to resolve name refs during highlighting r=matklad a=lnicola Preview: ![image](https://user-images.githubusercontent.com/308347/58253075-43464a80-7d70-11e9-84cc-e81990f2d3eb.png) This is probably not the cleanest implementation, but it's not clear to me what parts of `reference_definition` we don't want to run at this point. Also, is the `SourceAnalyzer` cheap enough to construct for each `NameRef`? Not like there's any alternative at this point, though. Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/package.json47
-rw-r--r--editors/code/src/highlighting.ts7
2 files changed, 52 insertions, 2 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index 750c97bb1..cde5fbcb8 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -371,12 +371,57 @@
371 }, 371 },
372 { 372 {
373 "id": "ralsp.macro", 373 "id": "ralsp.macro",
374 "description": "Color for DFAF8F", 374 "description": "Color for macros",
375 "defaults": { 375 "defaults": {
376 "dark": "#BFEBBF", 376 "dark": "#BFEBBF",
377 "light": "#DD6718", 377 "light": "#DD6718",
378 "highContrast": "#ED7718" 378 "highContrast": "#ED7718"
379 } 379 }
380 },
381 {
382 "id": "ralsp.constant",
383 "description": "Color for constants",
384 "defaults": {
385 "dark": "#569cd6",
386 "light": "#267cb6",
387 "highContrast": "#569cd6"
388 }
389 },
390 {
391 "id": "ralsp.type",
392 "description": "Color for types",
393 "defaults": {
394 "dark": "#4EC9B0",
395 "light": "#267F99",
396 "highContrast": "#4EC9B0"
397 }
398 },
399 {
400 "id": "ralsp.field",
401 "description": "Color for fields",
402 "defaults": {
403 "dark": "#4EC9B0",
404 "light": "#267F99",
405 "highContrast": "#4EC9B0"
406 }
407 },
408 {
409 "id": "ralsp.variable",
410 "description": "Color for variables",
411 "defaults": {
412 "dark": "#4EC9B0",
413 "light": "#267F99",
414 "highContrast": "#4EC9B0"
415 }
416 },
417 {
418 "id": "ralsp.module",
419 "description": "Color for modules",
420 "defaults": {
421 "dark": "#D4D4D4",
422 "light": "#000000",
423 "highContrast": "#FFFFFF"
424 }
380 } 425 }
381 ] 426 ]
382 } 427 }
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index e1a68544a..8389d94b8 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -33,11 +33,16 @@ export class Highlighter {
33 colorContrib('keyword.unsafe'), 33 colorContrib('keyword.unsafe'),
34 colorContrib('function'), 34 colorContrib('function'),
35 colorContrib('parameter'), 35 colorContrib('parameter'),
36 colorContrib('constant'),
37 colorContrib('type'),
36 colorContrib('builtin'), 38 colorContrib('builtin'),
37 colorContrib('text'), 39 colorContrib('text'),
38 colorContrib('attribute'), 40 colorContrib('attribute'),
39 colorContrib('literal'), 41 colorContrib('literal'),
40 colorContrib('macro') 42 colorContrib('macro'),
43 colorContrib('variable'),
44 colorContrib('field'),
45 colorContrib('module')
41 ]; 46 ];
42 47
43 return new Map<string, vscode.TextEditorDecorationType>(decorations); 48 return new Map<string, vscode.TextEditorDecorationType>(decorations);