Skip to content

Commit

Permalink
feat: Add ast.getFileSystem()
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Dec 24, 2017
1 parent 1707a7d commit 3364349
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/TsSimpleAst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class TsSimpleAst {
* @param options - Optional options.
* @param fileSystem - Optional file system host. Useful for mocking access to the file system.
*/
constructor(options: Options = {}, private fileSystem: FileSystemHost = new DefaultFileSystemHost()) {
constructor(options: Options = {}, private readonly fileSystem: FileSystemHost = new DefaultFileSystemHost()) {
this.global = new GlobalContainer(fileSystem, getCompilerOptionsFromOptions(options, fileSystem), { createLanguageService: true });
if (options.manipulationSettings != null)
this.global.manipulationSettings.set(options.manipulationSettings);
Expand Down Expand Up @@ -307,6 +307,13 @@ export class TsSimpleAst {
return this.global.typeChecker;
}

/**
* Gets the file system.
*/
getFileSystem(): FileSystemHost {
return this.fileSystem;
}

/**
* Emits all the source files.
* @param emitOptions - Optional emit options.
Expand Down

0 comments on commit 3364349

Please sign in to comment.