diff options
author | Ville Penttinen <[email protected]> | 2019-03-06 09:34:38 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-03-06 09:34:38 +0000 |
commit | 0dcb1cb569417a17e27a4d8b34813ded41395268 (patch) | |
tree | 123896a906abdfb6de3c0e3f13e0c69e98e3cc01 /editors/code | |
parent | ce118da149a0db1815f188c9914001608a5ac09e (diff) |
Add showWorkspaceLoadedNotification to vscode client
This allows users to control whether or not they want to see the "workspace
loaded" notification.
This is done on the server side using InitializationOptions which are provided
by the client. By default show_workspace_loaded is true, meaning the
notification is sent.
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/package.json | 5 | ||||
-rw-r--r-- | editors/code/src/config.ts | 7 | ||||
-rw-r--r-- | editors/code/src/server.ts | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index fda411810..47eaac878 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -150,6 +150,11 @@ | |||
150 | "default": false, | 150 | "default": false, |
151 | "description": "Highlight Rust code (overrides built-in syntax highlighting)" | 151 | "description": "Highlight Rust code (overrides built-in syntax highlighting)" |
152 | }, | 152 | }, |
153 | "rust-analyzer.showWorkspaceLoadedNotification": { | ||
154 | "type": "boolean", | ||
155 | "default": true, | ||
156 | "description": "Show notification when workspace was loaded" | ||
157 | }, | ||
153 | "rust-analyzer.enableEnhancedTyping": { | 158 | "rust-analyzer.enableEnhancedTyping": { |
154 | "type": "boolean", | 159 | "type": "boolean", |
155 | "default": true, | 160 | "default": true, |
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 4e353798c..afc5cc6af 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -8,6 +8,7 @@ export class Config { | |||
8 | public highlightingOn = true; | 8 | public highlightingOn = true; |
9 | public enableEnhancedTyping = true; | 9 | public enableEnhancedTyping = true; |
10 | public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; | 10 | public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; |
11 | public showWorkspaceLoadedNotification = true; | ||
11 | 12 | ||
12 | private prevEnhancedTyping: null | boolean = null; | 13 | private prevEnhancedTyping: null | boolean = null; |
13 | 14 | ||
@@ -24,6 +25,12 @@ export class Config { | |||
24 | this.highlightingOn = config.get('highlightingOn') as boolean; | 25 | this.highlightingOn = config.get('highlightingOn') as boolean; |
25 | } | 26 | } |
26 | 27 | ||
28 | if (config.has('showWorkspaceLoadedNotification')) { | ||
29 | this.showWorkspaceLoadedNotification = config.get( | ||
30 | 'showWorkspaceLoadedNotification' | ||
31 | ) as boolean; | ||
32 | } | ||
33 | |||
27 | if (!this.highlightingOn && Server) { | 34 | if (!this.highlightingOn && Server) { |
28 | Server.highlighter.removeHighlights(); | 35 | Server.highlighter.removeHighlights(); |
29 | } | 36 | } |
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index 9ead87fae..50461b0c6 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts | |||
@@ -26,7 +26,9 @@ export class Server { | |||
26 | const clientOptions: lc.LanguageClientOptions = { | 26 | const clientOptions: lc.LanguageClientOptions = { |
27 | documentSelector: [{ scheme: 'file', language: 'rust' }], | 27 | documentSelector: [{ scheme: 'file', language: 'rust' }], |
28 | initializationOptions: { | 28 | initializationOptions: { |
29 | publishDecorations: true | 29 | publishDecorations: true, |
30 | showWorkspaceLoaded: | ||
31 | Server.config.showWorkspaceLoadedNotification | ||
30 | }, | 32 | }, |
31 | traceOutputChannel | 33 | traceOutputChannel |
32 | }; | 34 | }; |