mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Apply tslint suggestions, round one
This commit is contained in:
parent
69de7e2fd7
commit
4d62cfccbb
16 changed files with 257 additions and 241 deletions
23
editors/code/src/config.ts
Normal file
23
editors/code/src/config.ts
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue