diff options
author | xfoxfu <[email protected]> | 2019-08-19 03:48:39 +0100 |
---|---|---|
committer | xfoxfu <[email protected]> | 2019-08-19 03:48:39 +0100 |
commit | d07a85ed7e0ed3baac6e8fc66cd27116056e9810 (patch) | |
tree | 12bb8180259d4e9c9cf54c5c42ebf99792fd4f15 /editors | |
parent | 2bac1bdf174a053f0727e982f0f92d068ef3c208 (diff) |
fix #1424
resolve "~" in raLspServerPath
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/src/server.ts | 10 |
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 @@ | |||
1 | import { homedir } from 'os'; | ||
1 | import * as lc from 'vscode-languageclient'; | 2 | import * as lc from 'vscode-languageclient'; |
2 | 3 | ||
3 | import { window, workspace } from 'vscode'; | 4 | import { window, workspace } from 'vscode'; |
4 | import { Config } from './config'; | 5 | import { Config } from './config'; |
5 | import { Highlighter } from './highlighting'; | 6 | import { Highlighter } from './highlighting'; |
6 | 7 | ||
8 | function expandPathResolving(path: string) { | ||
9 | if (path.startsWith('~/')) { | ||
10 | return path.replace('~', homedir()); | ||
11 | } | ||
12 | return path; | ||
13 | } | ||
14 | |||
7 | export class Server { | 15 | export 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 = { |