Skip to content

Commit fcdd614

Browse files
author
Phoebe Szmucer
committed
Fix an off-by-one error in getBaseDirectoriesFromRootDirs
1 parent b87e301 commit fcdd614

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/stringCompletions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ function getBaseDirectoriesFromRootDirs(rootDirs: string[], basePath: string, sc
630630

631631
// Determine the path to the directory containing the script relative to the root directory it is contained within
632632
const relativeDirectory = firstDefined(rootDirs, rootDirectory =>
633-
containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined)!; // TODO: GH#18217
633+
containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length + 1) : undefined)!; // TODO: GH#18217
634634

635635
// Now find a path for each potential directory that is to be merged with the one containing the script
636636
return deduplicate<string>(

0 commit comments

Comments
 (0)