Skip to content

Commit 3e15394

Browse files
author
Arthur Ozga
committed
add readDirectory to LSHost
1 parent b9e5dbc commit 3e15394

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/server/lsHost.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,16 @@ namespace ts.server {
171171
return this.host.fileExists(path);
172172
}
173173

174+
readFile(fileName: string): string {
175+
return this.host.readFile(fileName);
176+
}
177+
174178
directoryExists(path: string): boolean {
175179
return this.host.directoryExists(path);
176180
}
177181

178-
readFile(fileName: string): string {
179-
return this.host.readFile(fileName);
182+
readDirectory(path: string, extensions?: string[], exclude?: string[], include?: string[]): string[] {
183+
return this.host.readDirectory(path, exclude, exclude, include);
180184
}
181185

182186
getDirectories(path: string): string[] {

src/services/completions.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,17 +330,16 @@ namespace ts.Completions {
330330

331331
fragment = normalizeSlashes(fragment);
332332

333-
const baseName = getBaseFileName(fragment); // TODO: brittle?
333+
const baseName = getBaseFileName(fragment);
334334

335335
// Remove the basename from our directory path
336-
// TODO: (arozga) when is that used for filtering options later?
337336
fragment = getDirectoryPath(fragment);
338337

339338
if (fragment === "") {
340-
fragment = "." + directorySeparator; // TODO: (arozga) can we remove this?
339+
fragment = "." + directorySeparator;
341340
}
342341

343-
fragment = ensureTrailingDirectorySeparator(fragment); // TODO: why is this necessary?
342+
fragment = ensureTrailingDirectorySeparator(fragment);
344343

345344
const absolutePath = normalizeAndPreserveTrailingSlash(isRootedDiskPath(fragment) ? fragment : combinePaths(scriptPath, fragment));
346345
const baseDirectory = getDirectoryPath(absolutePath);

0 commit comments

Comments
 (0)