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.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 95c3f42e5..4cedbea46 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -1,5 +1,6 @@
1import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2 2import * as scopes from './scopes';
3import * as scopesMapper from './scopes_mapper';
3import { Server } from './server'; 4import { Server } from './server';
4 5
5const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; 6const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
@@ -45,8 +46,15 @@ export class Config {
45 46
46 public userConfigChanged() { 47 public userConfigChanged() {
47 const config = vscode.workspace.getConfiguration('rust-analyzer'); 48 const config = vscode.workspace.getConfiguration('rust-analyzer');
49
50 Server.highlighter.removeHighlights();
51
48 if (config.has('highlightingOn')) { 52 if (config.has('highlightingOn')) {
49 this.highlightingOn = config.get('highlightingOn') as boolean; 53 this.highlightingOn = config.get('highlightingOn') as boolean;
54 if (this.highlightingOn) {
55 scopes.load();
56 scopesMapper.load();
57 }
50 } 58 }
51 59
52 if (config.has('rainbowHighlightingOn')) { 60 if (config.has('rainbowHighlightingOn')) {
@@ -55,10 +63,6 @@ export class Config {
55 ) as boolean; 63 ) as boolean;
56 } 64 }
57 65
58 if (!this.highlightingOn && Server) {
59 Server.highlighter.removeHighlights();
60 }
61
62 if (config.has('enableEnhancedTyping')) { 66 if (config.has('enableEnhancedTyping')) {
63 this.enableEnhancedTyping = config.get( 67 this.enableEnhancedTyping = config.get(
64 'enableEnhancedTyping' 68 'enableEnhancedTyping'