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.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index d26f5df0a..4e353798c 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -6,8 +6,11 @@ const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
6 6
7export class Config { 7export class Config {
8 public highlightingOn = true; 8 public highlightingOn = true;
9 public enableEnhancedTyping = true;
9 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; 10 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
10 11
12 private prevEnhancedTyping: null | boolean = null;
13
11 constructor() { 14 constructor() {
12 vscode.workspace.onDidChangeConfiguration(_ => 15 vscode.workspace.onDidChangeConfiguration(_ =>
13 this.userConfigChanged() 16 this.userConfigChanged()
@@ -25,6 +28,35 @@ export class Config {
25 Server.highlighter.removeHighlights(); 28 Server.highlighter.removeHighlights();
26 } 29 }
27 30
31 if (config.has('enableEnhancedTyping')) {
32 this.enableEnhancedTyping = config.get(
33 'enableEnhancedTyping'
34 ) as boolean;
35
36 if (this.prevEnhancedTyping === null) {
37 this.prevEnhancedTyping = this.enableEnhancedTyping;
38 }
39 } else if (this.prevEnhancedTyping === null) {
40 this.prevEnhancedTyping = this.enableEnhancedTyping;
41 }
42
43 if (this.prevEnhancedTyping !== this.enableEnhancedTyping) {
44 const reloadAction = 'Reload now';
45 vscode.window
46 .showInformationMessage(
47 'Changing enhanced typing setting requires a reload',
48 reloadAction
49 )
50 .then(selectedAction => {
51 if (selectedAction === reloadAction) {
52 vscode.commands.executeCommand(
53 'workbench.action.reloadWindow'
54 );
55 }
56 });
57 this.prevEnhancedTyping = this.enableEnhancedTyping;
58 }
59
28 if (config.has('raLspServerPath')) { 60 if (config.has('raLspServerPath')) {
29 this.raLspServerPath = 61 this.raLspServerPath =
30 RA_LSP_DEBUG || (config.get('raLspServerPath') as string); 62 RA_LSP_DEBUG || (config.get('raLspServerPath') as string);