diff options
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r-- | editors/code/src/config.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 4b388b80c..a88be6e35 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | 2 | import * as scopes from './scopes'; | |
3 | import * as scopesMapper from './scopes_mapper'; | ||
3 | import { Server } from './server'; | 4 | import { Server } from './server'; |
4 | 5 | ||
5 | const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; | 6 | const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; |
@@ -54,10 +55,17 @@ export class Config { | |||
54 | 55 | ||
55 | public userConfigChanged() { | 56 | public userConfigChanged() { |
56 | const config = vscode.workspace.getConfiguration('rust-analyzer'); | 57 | const config = vscode.workspace.getConfiguration('rust-analyzer'); |
58 | |||
59 | Server.highlighter.removeHighlights(); | ||
60 | |||
57 | let requireReloadMessage = null; | 61 | let requireReloadMessage = null; |
58 | 62 | ||
59 | if (config.has('highlightingOn')) { | 63 | if (config.has('highlightingOn')) { |
60 | this.highlightingOn = config.get('highlightingOn') as boolean; | 64 | this.highlightingOn = config.get('highlightingOn') as boolean; |
65 | if (this.highlightingOn) { | ||
66 | scopes.load(); | ||
67 | scopesMapper.load(); | ||
68 | } | ||
61 | } | 69 | } |
62 | 70 | ||
63 | if (config.has('rainbowHighlightingOn')) { | 71 | if (config.has('rainbowHighlightingOn')) { |
@@ -66,10 +74,6 @@ export class Config { | |||
66 | ) as boolean; | 74 | ) as boolean; |
67 | } | 75 | } |
68 | 76 | ||
69 | if (!this.highlightingOn && Server) { | ||
70 | Server.highlighter.removeHighlights(); | ||
71 | } | ||
72 | |||
73 | if (config.has('enableEnhancedTyping')) { | 77 | if (config.has('enableEnhancedTyping')) { |
74 | this.enableEnhancedTyping = config.get( | 78 | this.enableEnhancedTyping = config.get( |
75 | 'enableEnhancedTyping', | 79 | 'enableEnhancedTyping', |