aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-05 16:13:45 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-05 16:13:45 +0000
commit2a19d699eb594c4929215a24df333f87fd41881a (patch)
tree4dc8086cb7cc9cd4bf144003f550ef9b9b4d6147
parentb1c86e686c186f75cf8c7c5d61fc12054c2ccf15 (diff)
parenta6e04cfa7fbc2baaf5fabb8a07093034d4d761e4 (diff)
Merge #436
436: Allow user to set path to ra_lsp_server in vscode settings r=matklad a=gentoo90 Co-authored-by: gentoo90 <[email protected]>
-rw-r--r--editors/code/package.json7
-rw-r--r--editors/code/src/config.ts5
-rw-r--r--editors/code/src/server.ts2
3 files changed, 13 insertions, 1 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index 9b8f6351b..c6340e6df 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -132,6 +132,13 @@
132 "default": true, 132 "default": true,
133 "description": "Highlight Rust code (overrides built-in syntax highlighting)" 133 "description": "Highlight Rust code (overrides built-in syntax highlighting)"
134 }, 134 },
135 "ra-lsp.raLspServerPath": {
136 "type": [
137 "string"
138 ],
139 "default": "ra_lsp_server",
140 "description": "Path to ra_lsp_server executable"
141 },
135 "ra-lsp.trace.server": { 142 "ra-lsp.trace.server": {
136 "type": "string", 143 "type": "string",
137 "scope": "window", 144 "scope": "window",
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 7d05ea078..cd0c6e6e2 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -4,6 +4,7 @@ import { Server } from './server';
4 4
5export class Config { 5export class Config {
6 public highlightingOn = true; 6 public highlightingOn = true;
7 public raLspServerPath = 'ra_lsp_server';
7 8
8 constructor() { 9 constructor() {
9 vscode.workspace.onDidChangeConfiguration(_ => 10 vscode.workspace.onDidChangeConfiguration(_ =>
@@ -21,5 +22,9 @@ export class Config {
21 if (!this.highlightingOn && Server) { 22 if (!this.highlightingOn && Server) {
22 Server.highlighter.removeHighlights(); 23 Server.highlighter.removeHighlights();
23 } 24 }
25
26 if (config.has('raLspServerPath')) {
27 this.raLspServerPath = config.get('raLspServerPath') as string;
28 }
24 } 29 }
25} 30}
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 75bdf3207..35fb7e3f5 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -12,7 +12,7 @@ export class Server {
12 notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]> 12 notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]>
13 ) { 13 ) {
14 const run: lc.Executable = { 14 const run: lc.Executable = {
15 command: 'ra_lsp_server', 15 command: this.config.raLspServerPath,
16 options: { cwd: '.' } 16 options: { cwd: '.' }
17 }; 17 };
18 const serverOptions: lc.ServerOptions = { 18 const serverOptions: lc.ServerOptions = {