From b6fab70d1a65bde2b8a9d4a153b78ed61f3452ee Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 7 Feb 2018 10:00:37 -0800 Subject: [PATCH 1/2] Fix bug: Check for both "./" and ".\" --- src/services/pathCompletions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/pathCompletions.ts b/src/services/pathCompletions.ts index 0dfae88974731..483cda2303357 100644 --- a/src/services/pathCompletions.ts +++ b/src/services/pathCompletions.ts @@ -462,7 +462,7 @@ namespace ts.Completions.PathCompletions { } function normalizeAndPreserveTrailingSlash(path: string) { - if (path === "./") { + if (path === "./" || path === ".\\") { // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. return ""; From ed9bce3f08a37c057e76bf0a0f07e5d54b81cf42 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 7 Feb 2018 10:26:59 -0800 Subject: [PATCH 2/2] Use normalizeSlashes --- src/services/pathCompletions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/pathCompletions.ts b/src/services/pathCompletions.ts index 483cda2303357..fd639aef81764 100644 --- a/src/services/pathCompletions.ts +++ b/src/services/pathCompletions.ts @@ -462,7 +462,7 @@ namespace ts.Completions.PathCompletions { } function normalizeAndPreserveTrailingSlash(path: string) { - if (path === "./" || path === ".\\") { + if (normalizeSlashes(path) === "./") { // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. return "";