aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorxfoxfu <[email protected]>2019-08-19 03:48:39 +0100
committerxfoxfu <[email protected]>2019-08-19 03:48:39 +0100
commitd07a85ed7e0ed3baac6e8fc66cd27116056e9810 (patch)
tree12bb8180259d4e9c9cf54c5c42ebf99792fd4f15 /editors
parent2bac1bdf174a053f0727e982f0f92d068ef3c208 (diff)
fix #1424
resolve "~" in raLspServerPath
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/server.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts
index 2b4c25c28..3273d8749 100644
--- a/editors/code/src/server.ts
+++ b/editors/code/src/server.ts
@@ -1,9 +1,17 @@
1import { homedir } from 'os';
1import * as lc from 'vscode-languageclient'; 2import * as lc from 'vscode-languageclient';
2 3
3import { window, workspace } from 'vscode'; 4import { window, workspace } from 'vscode';
4import { Config } from './config'; 5import { Config } from './config';
5import { Highlighter } from './highlighting'; 6import { Highlighter } from './highlighting';
6 7
8function expandPathResolving(path: string) {
9 if (path.startsWith('~/')) {
10 return path.replace('~', homedir());
11 }
12 return path;
13}
14
7export class Server { 15export class Server {
8 public static highlighter = new Highlighter(); 16 public static highlighter = new Highlighter();
9 public static config = new Config(); 17 public static config = new Config();
@@ -20,7 +28,7 @@ export class Server {
20 } 28 }
21 29
22 const run: lc.Executable = { 30 const run: lc.Executable = {
23 command: this.config.raLspServerPath, 31 command: expandPathResolving(this.config.raLspServerPath),
24 options: { cwd: folder } 32 options: { cwd: folder }
25 }; 33 };
26 const serverOptions: lc.ServerOptions = { 34 const serverOptions: lc.ServerOptions = {