Handle case sensitivity when looking up config file for Script info

Fixes #17726
This commit is contained in:
Sheetal Nandi
2017-10-11 12:27:21 -07:00
parent bce77fdfd9
commit deed981715
2 changed files with 47 additions and 1 deletions

View File

@@ -1218,7 +1218,7 @@ namespace ts.server {
projectRootPath?: NormalizedPath) {
let searchPath = asNormalizedPath(getDirectoryPath(info.fileName));
while (!projectRootPath || stringContains(searchPath, projectRootPath)) {
while (!projectRootPath || containsPath(projectRootPath, searchPath, this.currentDirectory, !this.host.useCaseSensitiveFileNames)) {
const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName);
const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json"));
let result = action(tsconfigFileName, combinePaths(canonicalSearchPath, "tsconfig.json"));