Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
Add noFileSystemlookup checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Jul 11, 2017
1 parent 3397d40 commit af92a84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ var LanguageServiceHost = (function () {
return process.cwd();
};
LanguageServiceHost.prototype.fileExists = function (fileName) {
return fs_1.existsSync(fileName);
return !this._noFilesystemLookup && fs_1.existsSync(fileName);
};
LanguageServiceHost.prototype.readFile = function (fileName) {
return fs_1.readFileSync(fileName, 'utf8');
return this._noFilesystemLookup ? '' : fs_1.readFileSync(fileName, 'utf8');
};
LanguageServiceHost.prototype.getDefaultLibFileName = function (options) {
return normalize(path.join(this.getDefaultLibLocation(), ts.getDefaultLibFileName(options)));
Expand Down
4 changes: 2 additions & 2 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,11 @@ class LanguageServiceHost implements ts.LanguageServiceHost {
}

fileExists(fileName: string): boolean {
return existsSync(fileName);
return !this._noFilesystemLookup && existsSync(fileName);
}

readFile(fileName: string): string {
return readFileSync(fileName, 'utf8');
return this._noFilesystemLookup ? '' : readFileSync(fileName, 'utf8');
}

getDefaultLibFileName(options: ts.CompilerOptions): string {
Expand Down

0 comments on commit af92a84

Please sign in to comment.