mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
add readDirectory to LSHost
This commit is contained in:
parent
b9e5dbc6e4
commit
3e15394b90
@ -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[] {
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user