diff --git a/src/server/lsHost.ts b/src/server/lsHost.ts index 5b33770ce28..68a16d2a22a 100644 --- a/src/server/lsHost.ts +++ b/src/server/lsHost.ts @@ -171,12 +171,16 @@ namespace ts.server { return this.host.fileExists(path); } + readFile(fileName: string): string { + return this.host.readFile(fileName); + } + directoryExists(path: string): boolean { return this.host.directoryExists(path); } - readFile(fileName: string): string { - return this.host.readFile(fileName); + readDirectory(path: string, extensions?: string[], exclude?: string[], include?: string[]): string[] { + return this.host.readDirectory(path, exclude, exclude, include); } getDirectories(path: string): string[] { diff --git a/src/services/completions.ts b/src/services/completions.ts index cf1e7a1e49a..38d8baa6b50 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -330,17 +330,16 @@ namespace ts.Completions { fragment = normalizeSlashes(fragment); - const baseName = getBaseFileName(fragment); // TODO: brittle? + const baseName = getBaseFileName(fragment); // Remove the basename from our directory path - // TODO: (arozga) when is that used for filtering options later? fragment = getDirectoryPath(fragment); if (fragment === "") { - fragment = "." + directorySeparator; // TODO: (arozga) can we remove this? + fragment = "." + directorySeparator; } - fragment = ensureTrailingDirectorySeparator(fragment); // TODO: why is this necessary? + fragment = ensureTrailingDirectorySeparator(fragment); const absolutePath = normalizeAndPreserveTrailingSlash(isRootedDiskPath(fragment) ? fragment : combinePaths(scriptPath, fragment)); const baseDirectory = getDirectoryPath(absolutePath);