Code: enable prettier trailing commas

This commit is contained in:
Laurențiu Nicola
2019-12-09 20:57:55 +02:00
parent 897b550049
commit 273299693b
31 changed files with 233 additions and 232 deletions

View File

@@ -30,19 +30,19 @@ export class Highlighter {
> {
const decoration = (
tag: string,
textDecoration?: string
textDecoration?: string,
): [string, vscode.TextEditorDecorationType] => {
const color = new vscode.ThemeColor('ralsp.' + tag);
const decor = vscode.window.createTextEditorDecorationType({
color,
textDecoration
textDecoration,
});
return [tag, decor];
};
const decorations: Iterable<[
string,
vscode.TextEditorDecorationType
vscode.TextEditorDecorationType,
]> = [
decoration('comment'),
decoration('string'),
@@ -61,7 +61,7 @@ export class Highlighter {
decoration('variable'),
decoration('variable.mut', 'underline'),
decoration('field'),
decoration('module')
decoration('module'),
];
return new Map<string, vscode.TextEditorDecorationType>(decorations);
@@ -118,20 +118,20 @@ export class Highlighter {
colorfulIdents
.get(d.bindingHash)![0]
.push(
Server.client.protocol2CodeConverter.asRange(d.range)
Server.client.protocol2CodeConverter.asRange(d.range),
);
} else {
byTag
.get(d.tag)!
.push(
Server.client.protocol2CodeConverter.asRange(d.range)
Server.client.protocol2CodeConverter.asRange(d.range),
);
}
}
for (const tag of byTag.keys()) {
const dec = this.decorations.get(
tag
tag,
) as vscode.TextEditorDecorationType;
const ranges = byTag.get(tag)!;
editor.setDecorations(dec, ranges);
@@ -141,7 +141,7 @@ export class Highlighter {
const textDecoration = mut ? 'underline' : undefined;
const dec = vscode.window.createTextEditorDecorationType({
light: { color: fancify(hash, 'light'), textDecoration },
dark: { color: fancify(hash, 'dark'), textDecoration }
dark: { color: fancify(hash, 'dark'), textDecoration },
});
editor.setDecorations(dec, ranges);
}