Skip to content

Commit 4deba1e

Browse files
committed
The handling of the paths which start with the home directory symbol was added.
1 parent 7e21142 commit 4deba1e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

server/src/server.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as v from "vscode-languageserver";
44
import * as rpc from "vscode-jsonrpc/node";
55
import * as path from "path";
66
import fs from "fs";
7+
import os from "os";
78
// TODO: check DidChangeWatchedFilesNotification.
89
import {
910
DidOpenTextDocumentNotification,
@@ -935,6 +936,17 @@ function onMessage(msg: p.Message) {
935936

936937
if (initialConfiguration != null) {
937938
extensionConfiguration = initialConfiguration;
939+
if (
940+
extensionConfiguration.binaryPath !== null &&
941+
extensionConfiguration.binaryPath[0] === "~"
942+
) {
943+
// What should happen if the path contains the home directory symbol?
944+
// This situation is handled below, but maybe it isn't the best option.
945+
extensionConfiguration.binaryPath = path.join(
946+
os.homedir(),
947+
extensionConfiguration.binaryPath.slice(1)
948+
);
949+
}
938950
}
939951

940952
send(response);

0 commit comments

Comments
 (0)