From a6e04cfa7fbc2baaf5fabb8a07093034d4d761e4 Mon Sep 17 00:00:00 2001 From: gentoo90 Date: Sat, 5 Jan 2019 17:28:41 +0200 Subject: Allow user to set path to ra_lsp_server in vscode settings --- editors/code/src/config.ts | 5 +++++ editors/code/src/server.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'editors/code/src') 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'; export class Config { public highlightingOn = true; + public raLspServerPath = 'ra_lsp_server'; constructor() { vscode.workspace.onDidChangeConfiguration(_ => @@ -21,5 +22,9 @@ export class Config { if (!this.highlightingOn && Server) { Server.highlighter.removeHighlights(); } + + if (config.has('raLspServerPath')) { + this.raLspServerPath = config.get('raLspServerPath') as string; + } } } 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 { notificationHandlers: Iterable<[string, lc.GenericNotificationHandler]> ) { const run: lc.Executable = { - command: 'ra_lsp_server', + command: this.config.raLspServerPath, options: { cwd: '.' } }; const serverOptions: lc.ServerOptions = { -- cgit v1.2.3