Skip to content

Commit

Permalink
Merge pull request #2414 from Microsoft/createSourceFile
Browse files Browse the repository at this point in the history
Expose setParentNodes on createCompilerHost
  • Loading branch information
mhegazy committed Mar 18, 2015
2 parents 355dcd1 + 7462915 commit f96e52c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module ts {
/** The version of the TypeScript compiler release */
export let version = "1.5.0.0";

export function createCompilerHost(options: CompilerOptions): CompilerHost {
export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost {
let currentDirectory: string;
let existingDirectories: Map<boolean> = {};

Expand Down Expand Up @@ -38,7 +38,7 @@ module ts {
}
text = "";
}
return text !== undefined ? createSourceFile(fileName, text, languageVersion) : undefined;
return text !== undefined ? createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined;
}

function directoryExists(directoryPath: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/APISample_compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ declare module "typescript" {
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_compile.types
Original file line number Diff line number Diff line change
Expand Up @@ -4714,10 +4714,11 @@ declare module "typescript" {
let version: string;
>version : string

function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
>options : CompilerOptions
>CompilerOptions : CompilerOptions
>setParentNodes : boolean
>CompilerHost : CompilerHost

function getPreEmitDiagnostics(program: Program): Diagnostic[];
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/APISample_linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@ declare module "typescript" {
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_linter.types
Original file line number Diff line number Diff line change
Expand Up @@ -4860,10 +4860,11 @@ declare module "typescript" {
let version: string;
>version : string

function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
>options : CompilerOptions
>CompilerOptions : CompilerOptions
>setParentNodes : boolean
>CompilerHost : CompilerHost

function getPreEmitDiagnostics(program: Program): Diagnostic[];
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/APISample_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ declare module "typescript" {
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_transform.types
Original file line number Diff line number Diff line change
Expand Up @@ -4810,10 +4810,11 @@ declare module "typescript" {
let version: string;
>version : string

function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
>options : CompilerOptions
>CompilerOptions : CompilerOptions
>setParentNodes : boolean
>CompilerHost : CompilerHost

function getPreEmitDiagnostics(program: Program): Diagnostic[];
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/APISample_watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ declare module "typescript" {
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_watcher.types
Original file line number Diff line number Diff line change
Expand Up @@ -4983,10 +4983,11 @@ declare module "typescript" {
let version: string;
>version : string

function createCompilerHost(options: CompilerOptions): CompilerHost;
>createCompilerHost : (options: CompilerOptions) => CompilerHost
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
>options : CompilerOptions
>CompilerOptions : CompilerOptions
>setParentNodes : boolean
>CompilerHost : CompilerHost

function getPreEmitDiagnostics(program: Program): Diagnostic[];
Expand Down

0 comments on commit f96e52c

Please sign in to comment.