From 4d62cfccbb8281f33b6f894df07e7316a9d45bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Ochagav=C3=ADa?= Date: Sun, 7 Oct 2018 22:59:02 +0200 Subject: Apply tslint suggestions, round one --- editors/code/src/config.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 editors/code/src/config.ts (limited to 'editors/code/src/config.ts') 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 @@ +import * as vscode from 'vscode'; + +import { Server } from './server'; + +export class Config { + public highlightingOn = true; + + constructor() { + vscode.workspace.onDidChangeConfiguration((_) => this.userConfigChanged()); + this.userConfigChanged(); + } + + public userConfigChanged() { + const config = vscode.workspace.getConfiguration('ra-lsp'); + if (config.has('highlightingOn')) { + this.highlightingOn = config.get('highlightingOn') as boolean; + } + + if (!this.highlightingOn && Server) { + Server.highlighter.removeHighlights(); + } + } +} -- cgit v1.2.3