Skip to content

Commit 2a7e73c

Browse files
committed
Unnecessary relative path handling was removed
1 parent 4b655e8 commit 2a7e73c

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

server/src/server.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -909,30 +909,11 @@ function onMessage(msg: p.Message) {
909909
if (initialConfiguration != null) {
910910
extensionConfiguration = initialConfiguration;
911911
if (extensionConfiguration.path !== "" &&
912-
!path.isAbsolute(extensionConfiguration.path)
912+
extensionConfiguration.path[0] === "~"
913913
) {
914-
// What should happen if the path is relative?
915-
// There is an option to create an absolute path using the params from msg,
916-
// but maybe it isn't the best option.
917-
918-
if (extensionConfiguration.path[0] === "~") {
919-
extensionConfiguration.path = path.join(os.homedir(), extensionConfiguration.path.slice(1))
920-
} else {
921-
let rootFromMgs = null
922-
// @ts-ignore
923-
if (msg.params != null && msg.params.rootUri != null) {
924-
// @ts-ignore
925-
rootFromMgs = fileURLToPath(msg.params.rootUri);
926-
}
927-
// @ts-ignore
928-
if (rootFromMgs == null && msg.params != null && msg.params.rootPath != null) {
929-
// @ts-ignore
930-
rootFromMgs = msg.params.rootPath;
931-
}
932-
extensionConfiguration.path = rootFromMgs == null
933-
? ""
934-
: path.join(rootFromMgs, extensionConfiguration.path);
935-
}
914+
// What should happen if the path contains the home directory symbol?
915+
// This situation is handled below, but maybe it isn't the best option.
916+
extensionConfiguration.path = path.join(os.homedir(), extensionConfiguration.path.slice(1))
936917
}
937918
}
938919

0 commit comments

Comments
 (0)