From d07a85ed7e0ed3baac6e8fc66cd27116056e9810 Mon Sep 17 00:00:00 2001 From: xfoxfu Date: Mon, 19 Aug 2019 10:48:39 +0800 Subject: [PATCH] fix #1424 resolve "~" in raLspServerPath --- editors/code/src/server.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index 2b4c25c284..3273d87497 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts @@ -1,9 +1,17 @@ +import { homedir } from 'os'; import * as lc from 'vscode-languageclient'; import { window, workspace } from 'vscode'; import { Config } from './config'; import { Highlighter } from './highlighting'; +function expandPathResolving(path: string) { + if (path.startsWith('~/')) { + return path.replace('~', homedir()); + } + return path; +} + export class Server { public static highlighter = new Highlighter(); public static config = new Config(); @@ -20,7 +28,7 @@ export class Server { } const run: lc.Executable = { - command: this.config.raLspServerPath, + command: expandPathResolving(this.config.raLspServerPath), options: { cwd: folder } }; const serverOptions: lc.ServerOptions = {