diff options
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r-- | editors/code/src/config.ts | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index b9ff3b810..7d05ea078 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -3,21 +3,23 @@ import * as vscode from 'vscode'; | |||
3 | import { Server } from './server'; | 3 | import { Server } from './server'; |
4 | 4 | ||
5 | export class Config { | 5 | export class Config { |
6 | public highlightingOn = true; | 6 | public highlightingOn = true; |
7 | 7 | ||
8 | constructor() { | 8 | constructor() { |
9 | vscode.workspace.onDidChangeConfiguration((_) => this.userConfigChanged()); | 9 | vscode.workspace.onDidChangeConfiguration(_ => |
10 | this.userConfigChanged(); | 10 | this.userConfigChanged() |
11 | } | 11 | ); |
12 | 12 | this.userConfigChanged(); | |
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 | } | 13 | } |
18 | 14 | ||
19 | if (!this.highlightingOn && Server) { | 15 | public userConfigChanged() { |
20 | Server.highlighter.removeHighlights(); | 16 | const config = vscode.workspace.getConfiguration('ra-lsp'); |
17 | if (config.has('highlightingOn')) { | ||
18 | this.highlightingOn = config.get('highlightingOn') as boolean; | ||
19 | } | ||
20 | |||
21 | if (!this.highlightingOn && Server) { | ||
22 | Server.highlighter.removeHighlights(); | ||
23 | } | ||
21 | } | 24 | } |
22 | } | ||
23 | } | 25 | } |