mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-01 07:48:45 +00:00
24 lines
619 B
TypeScript
24 lines
619 B
TypeScript
|
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();
|
||
|
}
|
||
|
}
|
||
|
}
|