1800bfb6e6
Changed presentation from clear to reveal silent Removed the vscode gitignore entry Added debugging documentation Added tasks and launch configs
33 lines
923 B
TypeScript
33 lines
923 B
TypeScript
import * as vscode from 'vscode';
|
|
|
|
import { Server } from './server';
|
|
|
|
const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
|
|
|
|
export class Config {
|
|
public highlightingOn = true;
|
|
public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
|
|
|
|
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();
|
|
}
|
|
|
|
if (config.has('raLspServerPath')) {
|
|
this.raLspServerPath =
|
|
RA_LSP_DEBUG || (config.get('raLspServerPath') as string);
|
|
}
|
|
}
|
|
}
|