diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-09 19:31:27 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-09 19:31:27 +0000 |
commit | e292573f425eece6f1666e051d7fe64b79640d39 (patch) | |
tree | 16d7de77952895b4cebf1cbb7a18652eaf4d98b6 /editors/code/src/highlighting.ts | |
parent | 897b550049d8889804bb476e305427d07879cd63 (diff) | |
parent | 273299693b85996878907ad256ed55f072ec3f1a (diff) |
Merge #2514
2514: Code: enable prettier trailing commas r=matklad a=lnicola
See #2512.
Co-authored-by: Laurențiu Nicola <[email protected]>
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r-- | editors/code/src/highlighting.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 48f2a2547..6d50a2f2d 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts | |||
@@ -30,19 +30,19 @@ export class Highlighter { | |||
30 | > { | 30 | > { |
31 | const decoration = ( | 31 | const decoration = ( |
32 | tag: string, | 32 | tag: string, |
33 | textDecoration?: string | 33 | textDecoration?: string, |
34 | ): [string, vscode.TextEditorDecorationType] => { | 34 | ): [string, vscode.TextEditorDecorationType] => { |
35 | const color = new vscode.ThemeColor('ralsp.' + tag); | 35 | const color = new vscode.ThemeColor('ralsp.' + tag); |
36 | const decor = vscode.window.createTextEditorDecorationType({ | 36 | const decor = vscode.window.createTextEditorDecorationType({ |
37 | color, | 37 | color, |
38 | textDecoration | 38 | textDecoration, |
39 | }); | 39 | }); |
40 | return [tag, decor]; | 40 | return [tag, decor]; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | const decorations: Iterable<[ | 43 | const decorations: Iterable<[ |
44 | string, | 44 | string, |
45 | vscode.TextEditorDecorationType | 45 | vscode.TextEditorDecorationType, |
46 | ]> = [ | 46 | ]> = [ |
47 | decoration('comment'), | 47 | decoration('comment'), |
48 | decoration('string'), | 48 | decoration('string'), |
@@ -61,7 +61,7 @@ export class Highlighter { | |||
61 | decoration('variable'), | 61 | decoration('variable'), |
62 | decoration('variable.mut', 'underline'), | 62 | decoration('variable.mut', 'underline'), |
63 | decoration('field'), | 63 | decoration('field'), |
64 | decoration('module') | 64 | decoration('module'), |
65 | ]; | 65 | ]; |
66 | 66 | ||
67 | return new Map<string, vscode.TextEditorDecorationType>(decorations); | 67 | return new Map<string, vscode.TextEditorDecorationType>(decorations); |
@@ -118,20 +118,20 @@ export class Highlighter { | |||
118 | colorfulIdents | 118 | colorfulIdents |
119 | .get(d.bindingHash)![0] | 119 | .get(d.bindingHash)![0] |
120 | .push( | 120 | .push( |
121 | Server.client.protocol2CodeConverter.asRange(d.range) | 121 | Server.client.protocol2CodeConverter.asRange(d.range), |
122 | ); | 122 | ); |
123 | } else { | 123 | } else { |
124 | byTag | 124 | byTag |
125 | .get(d.tag)! | 125 | .get(d.tag)! |
126 | .push( | 126 | .push( |
127 | Server.client.protocol2CodeConverter.asRange(d.range) | 127 | Server.client.protocol2CodeConverter.asRange(d.range), |
128 | ); | 128 | ); |
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
132 | for (const tag of byTag.keys()) { | 132 | for (const tag of byTag.keys()) { |
133 | const dec = this.decorations.get( | 133 | const dec = this.decorations.get( |
134 | tag | 134 | tag, |
135 | ) as vscode.TextEditorDecorationType; | 135 | ) as vscode.TextEditorDecorationType; |
136 | const ranges = byTag.get(tag)!; | 136 | const ranges = byTag.get(tag)!; |
137 | editor.setDecorations(dec, ranges); | 137 | editor.setDecorations(dec, ranges); |
@@ -141,7 +141,7 @@ export class Highlighter { | |||
141 | const textDecoration = mut ? 'underline' : undefined; | 141 | const textDecoration = mut ? 'underline' : undefined; |
142 | const dec = vscode.window.createTextEditorDecorationType({ | 142 | const dec = vscode.window.createTextEditorDecorationType({ |
143 | light: { color: fancify(hash, 'light'), textDecoration }, | 143 | light: { color: fancify(hash, 'light'), textDecoration }, |
144 | dark: { color: fancify(hash, 'dark'), textDecoration } | 144 | dark: { color: fancify(hash, 'dark'), textDecoration }, |
145 | }); | 145 | }); |
146 | editor.setDecorations(dec, ranges); | 146 | editor.setDecorations(dec, ranges); |
147 | } | 147 | } |