aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r--editors/code/src/config.ts23
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 @@
1import * as vscode from 'vscode';
2
3import { Server } from './server';
4
5export 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}