diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-10-07 21:59:02 +0100 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-10-07 22:12:40 +0100 |
commit | 4d62cfccbb8281f33b6f894df07e7316a9d45bfb (patch) | |
tree | 56ad69cb2f5c1096a2a74cfa078b92c40fe902e1 /editors/code/src/config.ts | |
parent | 69de7e2fd71c3a808f0ac856d7b105eeb210f169 (diff) |
Apply tslint suggestions, round one
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r-- | editors/code/src/config.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts new file mode 100644 index 000000000..740b5be20 --- /dev/null +++ b/editors/code/src/config.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | import * as vscode from 'vscode'; | ||
2 | |||
3 | import { Server } from './server'; | ||
4 | |||
5 | export class Config { | ||
6 | public highlightingOn = true; | ||
7 | |||
8 | constructor() { | ||
9 | vscode.workspace.onDidChangeConfiguration((_) => this.userConfigChanged()); | ||
10 | this.userConfigChanged(); | ||
11 | } | ||
12 | |||
13 | public userConfigChanged() { | ||
14 | const config = vscode.workspace.getConfiguration('ra-lsp'); | ||
15 | if (config.has('highlightingOn')) { | ||
16 | this.highlightingOn = config.get('highlightingOn') as boolean; | ||
17 | } | ||
18 | |||
19 | if (!this.highlightingOn && Server) { | ||
20 | Server.highlighter.removeHighlights(); | ||
21 | } | ||
22 | } | ||
23 | } | ||