expose the config file processing throught the LS and

add a callback to enumerate files in a directory
This commit is contained in:
Paul van Brenk
2015-04-21 13:24:02 -07:00
parent 02a480d85d
commit 80ae52b7e9
6 changed files with 59 additions and 10 deletions

View File

@@ -292,7 +292,7 @@ module ts {
* @param basePath A root directory to resolve relative path entries in the config
* file to. e.g. outDir
*/
export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine {
export function parseConfigFile(json: any, host: ParseConfigHost, basePath?: string): ParsedCommandLine {
var errors: Diagnostic[] = [];
return {
@@ -351,7 +351,7 @@ module ts {
}
}
else {
var sysFiles = sys.readDirectory(basePath, ".ts");
var sysFiles = host.readDirectory(basePath, ".ts");
for (var i = 0; i < sysFiles.length; i++) {
var name = sysFiles[i];
if (!fileExtensionIs(name, ".d.ts") || !contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) {