diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-02 19:20:42 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-02 19:20:42 +0000 |
commit | e72771ebc6eb98c58a9e4216f7e3381a41e75f84 (patch) | |
tree | 681e88118603403c70de2e92d2a3cf3502bff2a0 /editors/code/src/highlighting.ts | |
parent | d06e02dd13e7cf10d53203620592aa0e85d808c0 (diff) | |
parent | 420462421d87a05c926501f8d4235f7660217924 (diff) |
Merge #2986
2986: vscode extension cleanup: migrate to prefer-const tslint rule r=matklad a=Veetaha
Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r-- | editors/code/src/highlighting.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index fc7cd5a1c..3d190c3ad 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts | |||
@@ -40,7 +40,7 @@ export function activateHighlighting(ctx: Ctx) { | |||
40 | async (editor: vscode.TextEditor | undefined) => { | 40 | async (editor: vscode.TextEditor | undefined) => { |
41 | if (!editor || editor.document.languageId !== 'rust') return; | 41 | if (!editor || editor.document.languageId !== 'rust') return; |
42 | if (!ctx.config.highlightingOn) return; | 42 | if (!ctx.config.highlightingOn) return; |
43 | let client = ctx.client; | 43 | const client = ctx.client; |
44 | if (!client) return; | 44 | if (!client) return; |
45 | 45 | ||
46 | const params: lc.TextDocumentIdentifier = { | 46 | const params: lc.TextDocumentIdentifier = { |
@@ -106,7 +106,7 @@ class Highlighter { | |||
106 | } | 106 | } |
107 | 107 | ||
108 | public setHighlights(editor: vscode.TextEditor, highlights: Decoration[]) { | 108 | public setHighlights(editor: vscode.TextEditor, highlights: Decoration[]) { |
109 | let client = this.ctx.client; | 109 | const client = this.ctx.client; |
110 | if (!client) return; | 110 | if (!client) return; |
111 | // Initialize decorations if necessary | 111 | // Initialize decorations if necessary |
112 | // | 112 | // |
@@ -175,7 +175,7 @@ function initDecorations(): Map<string, vscode.TextEditorDecorationType> { | |||
175 | const res = new Map(); | 175 | const res = new Map(); |
176 | TAG_TO_SCOPES.forEach((scopes, tag) => { | 176 | TAG_TO_SCOPES.forEach((scopes, tag) => { |
177 | if (!scopes) throw `unmapped tag: ${tag}`; | 177 | if (!scopes) throw `unmapped tag: ${tag}`; |
178 | let rule = theme.lookup(scopes); | 178 | const rule = theme.lookup(scopes); |
179 | const decor = createDecorationFromTextmate(rule); | 179 | const decor = createDecorationFromTextmate(rule); |
180 | res.set(tag, decor); | 180 | res.set(tag, decor); |
181 | }); | 181 | }); |