diff options
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 | } | ||