Remove dependency from the typechecker to the compiler host.

This also lets us not expose the compiler host from the Program instance.
The compiler host was only needed by the type checker to get the host newline.
The host newline was used for concatenating diagnostic message chains.  Now
we don't concatenate them up front.  Instead, we just store the message chain
in the diagnostic itself.  Then when we pass it to the host, it can then decide
what newline to use.
This commit is contained in:
Cyrus Najmabadi 2015-02-04 23:20:26 -08:00
parent de30866460
commit b12be3db19
19 changed files with 135 additions and 134 deletions

View File

@ -3476,7 +3476,7 @@ module ts {
errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo);
}
diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, host.getCompilerHost().getNewLine()));
diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo));
}
return result !== Ternary.False;
@ -8924,7 +8924,7 @@ module ts {
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);
diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, host.getCompilerHost().getNewLine()));
diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo));
}
}
}

View File

@ -325,38 +325,6 @@ module ts {
return headChain;
}
export function flattenDiagnosticChain(file: SourceFile, start: number, length: number, diagnosticChain: DiagnosticMessageChain, newLine: string): Diagnostic {
Debug.assert(start >= 0, "start must be non-negative, is " + start);
Debug.assert(length >= 0, "length must be non-negative, is " + length);
var code = diagnosticChain.code;
var category = diagnosticChain.category;
var messageText = "";
var indent = 0;
while (diagnosticChain) {
if (indent) {
messageText += newLine;
for (var i = 0; i < indent; i++) {
messageText += " ";
}
}
messageText += diagnosticChain.messageText;
indent++;
diagnosticChain = diagnosticChain.next;
}
return {
file,
start,
length,
code,
category,
messageText
};
}
export function compareValues<T>(a: T, b: T): Comparison {
if (a === b) return Comparison.EqualTo;
if (a === undefined) return Comparison.LessThan;
@ -373,10 +341,34 @@ module ts {
compareValues(d1.start, d2.start) ||
compareValues(d1.length, d2.length) ||
compareValues(d1.code, d2.code) ||
compareValues(d1.messageText, d2.messageText) ||
compareMessageText(d1.messageText, d2.messageText) ||
0;
}
function compareMessageText(text1: string | DiagnosticMessageChain, text2: string | DiagnosticMessageChain): number {
while (text1 && text2) {
// We still have both chains.
var string1 = typeof text1 === "string" ? text1 : text1.messageText;
var string2 = typeof text2 === "string" ? text2 : text2.messageText;
var res = compareValues(string1, string2);
if (res) {
return res;
}
text1 = typeof text1 === "string" ? undefined : text1.next;
text2 = typeof text2 === "string" ? undefined : text2.next;
}
if (!text1 && !text2) {
// if the chains are done, then these messages are the same.
return 0;
}
// We still have one chain remaining. The shorter chain should come first.
return text1 ? 1 : -1;
}
export function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[] {
if (diagnostics.length < 2) {
return diagnostics;

View File

@ -23,9 +23,9 @@ module ts {
}
catch (e) {
if (onError) {
onError(e.number === unsupportedFileEncodingErrorCode ?
createCompilerDiagnostic(Diagnostics.Unsupported_file_encoding).messageText :
e.message);
onError(e.number === unsupportedFileEncodingErrorCode
? createCompilerDiagnostic(Diagnostics.Unsupported_file_encoding).messageText
: e.message);
}
text = "";
}
@ -97,7 +97,6 @@ module ts {
getSourceFile: getSourceFile,
getSourceFiles: () => files,
getCompilerOptions: () => options,
getCompilerHost: () => host,
getDiagnostics,
getGlobalDiagnostics,
getTypeCheckerDiagnostics,
@ -118,17 +117,16 @@ module ts {
return program;
function getEmitHost(writeFileCallback?: WriteFileCallback) {
var compilerHost = program.getCompilerHost();
return {
getCanonicalFileName: compilerHost.getCanonicalFileName,
getCanonicalFileName: host.getCanonicalFileName,
getCommonSourceDirectory: program.getCommonSourceDirectory,
getCompilerOptions: program.getCompilerOptions,
getCurrentDirectory: compilerHost.getCurrentDirectory,
getNewLine: compilerHost.getNewLine,
getCurrentDirectory: host.getCurrentDirectory,
getNewLine: host.getNewLine,
getSourceFile: program.getSourceFile,
getSourceFiles: program.getSourceFiles,
isEmitBlocked,
writeFile: writeFileCallback || compilerHost.writeFile,
writeFile: writeFileCallback || host.writeFile,
};
}

View File

@ -78,8 +78,8 @@ module ts {
}
function getDiagnosticText(message: DiagnosticMessage, ...args: any[]): string {
var diagnostic: Diagnostic = createCompilerDiagnostic.apply(undefined, arguments);
return diagnostic.messageText;
var diagnostic = createCompilerDiagnostic.apply(undefined, arguments);
return <string>diagnostic.messageText;
}
function reportDiagnostic(diagnostic: Diagnostic) {
@ -92,7 +92,7 @@ module ts {
}
var category = DiagnosticCategory[diagnostic.category].toLowerCase();
output += category + " TS" + diagnostic.code + ": " + diagnostic.messageText + sys.newLine;
output += category + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) + sys.newLine;
sys.write(output);
}

View File

@ -933,7 +933,6 @@ module ts {
export interface Program extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
getCompilerHost(): CompilerHost;
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
@ -941,7 +940,7 @@ module ts {
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -1009,7 +1008,6 @@ module ts {
export interface TypeCheckerHost {
getCompilerOptions(): CompilerOptions;
getCompilerHost(): CompilerHost;
getSourceFiles(): SourceFile[];
getSourceFile(fileName: string): SourceFile;
@ -1451,7 +1449,7 @@ module ts {
file: SourceFile;
start: number;
length: number;
messageText: string;
messageText: string | DiagnosticMessageChain;
category: DiagnosticCategory;
code: number;
}

View File

@ -199,12 +199,45 @@ module ts {
return createFileDiagnostic(file, start, length, message, arg0, arg1, arg2);
}
export function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain, newLine: string): Diagnostic {
export function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic {
node = getErrorSpanForNode(node);
var file = getSourceFileOfNode(node);
var start = skipTrivia(file.text, node.pos);
var length = node.end - start;
return flattenDiagnosticChain(file, start, length, messageChain, newLine);
return {
file,
start,
length,
code: messageChain.code,
category: messageChain.category,
messageText: messageChain
};
}
export function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string {
if (typeof messageText === "string") {
return messageText;
}
else {
var diagnosticChain = messageText;
var result = "";
var indent = 0;
while (diagnosticChain) {
if (indent) {
result += newLine;
for (var i = 0; i < indent; i++) {
result += " ";
}
}
result += diagnosticChain.messageText;
indent++;
diagnosticChain = diagnosticChain.next;
}
return result;
}
}
export function getErrorSpanForNode(node: Node): Node {

View File

@ -513,7 +513,9 @@ module FourSlash {
}
errors.forEach(function (error: ts.Diagnostic) {
Harness.IO.log(" minChar: " + error.start + ", limChar: " + (error.start + error.length) + ", message: " + error.messageText + "\n");
Harness.IO.log(" minChar: " + error.start +
", limChar: " + (error.start + error.length) +
", message: " + ts.flattenDiagnosticMessageText(error.messageText, ts.sys.newLine) + "\n");
});
}
@ -1179,7 +1181,10 @@ module FourSlash {
if (errorList.length) {
errorList.forEach(err => {
Harness.IO.log("start: " + err.start + ", length: " + err.length + ", message: " + err.messageText);
Harness.IO.log(
"start: " + err.start +
", length: " + err.length +
", message: " + ts.flattenDiagnosticMessageText(err.messageText, ts.sys.newLine));
});
}
}
@ -2214,7 +2219,7 @@ module FourSlash {
var errors = program.getDiagnostics().concat(checker.getDiagnostics());
if (errors.length > 0) {
throw new Error('Error compiling ' + fileName + ': ' + errors.map(e => e.messageText).join('\r\n'));
throw new Error('Error compiling ' + fileName + ': ' + errors.map(e => ts.flattenDiagnosticMessageText(e.messageText, ts.sys.newLine)).join('\r\n'));
}
program.emit();
result = result || ''; // Might have an empty fourslash file

View File

@ -183,7 +183,7 @@ module Utils {
return {
start: diagnostic.start,
length: diagnostic.length,
messageText: diagnostic.messageText,
messageText: ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine),
category: (<any>ts).DiagnosticCategory[diagnostic.category],
code: diagnostic.code
};
@ -305,7 +305,9 @@ module Utils {
assert.equal(d1.start, d2.start, "d1.start !== d2.start");
assert.equal(d1.length, d2.length, "d1.length !== d2.length");
assert.equal(d1.messageText, d2.messageText, "d1.messageText !== d2.messageText");
assert.equal(
ts.flattenDiagnosticMessageText(d1.messageText, ts.sys.newLine),
ts.flattenDiagnosticMessageText(d2.messageText, ts.sys.newLine), "d1.messageText !== d2.messageText");
assert.equal(d1.category, d2.category, "d1.category !== d2.category");
assert.equal(d1.code, d2.code, "d1.code !== d2.code");
}
@ -1182,7 +1184,7 @@ module Harness {
end: err.start + err.length,
line: errorLineInfo.line,
character: errorLineInfo.character,
message: err.messageText,
message: ts.flattenDiagnosticMessageText(err.messageText, ts.sys.newLine),
category: ts.DiagnosticCategory[err.category].toLowerCase(),
code: err.code
};

View File

@ -134,6 +134,10 @@ module Harness.LanguageService {
public trace(s: string) {
}
public getNewLine(): string {
return "\r\n";
}
public addDefaultLibrary() {
this.addScript(Harness.Compiler.defaultLibFileName, Harness.Compiler.defaultLibSourceFile.text);
}

View File

@ -275,14 +275,14 @@ class ProjectRunner extends RunnerBase {
function compileCompileDTsFiles(compilerResult: BatchCompileProjectTestCaseResult) {
var allInputFiles: { emittedFileName: string; code: string; }[] = [];
var compilerOptions = compilerResult.program.getCompilerOptions();
var compilerHost = compilerResult.program.getCompilerHost();
ts.forEach(compilerResult.program.getSourceFiles(), sourceFile => {
if (Harness.Compiler.isDTS(sourceFile.fileName)) {
allInputFiles.unshift({ emittedFileName: sourceFile.fileName, code: sourceFile.text });
}
else if (ts.shouldEmitToOwnFile(sourceFile, compilerResult.program.getCompilerOptions())) {
if (compilerOptions.outDir) {
var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, compilerHost.getCurrentDirectory());
var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, compilerResult.program.getCurrentDirectory());
sourceFilePath = sourceFilePath.replace(compilerResult.program.getCommonSourceDirectory(), "");
var emitOutputFilePathWithoutExtension = ts.removeFileExtension(ts.combinePaths(compilerOptions.outDir, sourceFilePath));
}

View File

@ -52,6 +52,7 @@ module ts {
getCancellationToken(): CancellationToken;
getCurrentDirectory(): string;
getDefaultLibFileName(options: string): string;
getNewLine?(): string;
}
///
@ -367,9 +368,9 @@ module ts {
});
}
private static realizeDiagnostic(diagnostic: Diagnostic): { message: string; start: number; length: number; category: string; } {
private realizeDiagnostic(diagnostic: Diagnostic, newLine?: string): { message: string; start: number; length: number; category: string; } {
return {
message: diagnostic.messageText,
message: flattenDiagnosticMessageText(diagnostic.messageText, newLine),
start: diagnostic.start,
length: diagnostic.length,
/// TODO: no need for the tolowerCase call
@ -396,12 +397,16 @@ module ts {
});
}
private getNewLine(): string {
return this.host.getNewLine ? this.host.getNewLine() : "\r\n";
}
public getSyntacticDiagnostics(fileName: string): string {
return this.forwardJSONCall(
"getSyntacticDiagnostics('" + fileName + "')",
() => {
var errors = this.languageService.getSyntacticDiagnostics(fileName);
return errors.map(LanguageServiceShimObject.realizeDiagnostic);
return errors.map(e => this.realizeDiagnostic(e), this.getNewLine());
});
}
@ -410,7 +415,7 @@ module ts {
"getSemanticDiagnostics('" + fileName + "')",
() => {
var errors = this.languageService.getSemanticDiagnostics(fileName);
return errors.map(LanguageServiceShimObject.realizeDiagnostic);
return errors.map(e => this.realizeDiagnostic(e), this.getNewLine());
});
}
@ -419,7 +424,7 @@ module ts {
"getCompilerOptionsDiagnostics()",
() => {
var errors = this.languageService.getCompilerOptionsDiagnostics();
return errors.map(LanguageServiceShimObject.realizeDiagnostic)
return errors.map(e => this.realizeDiagnostic(e), this.getNewLine())
});
}

View File

@ -741,14 +741,13 @@ declare module "typescript" {
}
interface Program extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
getCompilerHost(): CompilerHost;
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -795,7 +794,6 @@ declare module "typescript" {
}
interface TypeCheckerHost {
getCompilerOptions(): CompilerOptions;
getCompilerHost(): CompilerHost;
getSourceFiles(): SourceFile[];
getSourceFile(fileName: string): SourceFile;
}
@ -1144,7 +1142,7 @@ declare module "typescript" {
file: SourceFile;
start: number;
length: number;
messageText: string;
messageText: string | DiagnosticMessageChain;
category: DiagnosticCategory;
code: number;
}

View File

@ -98,9 +98,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void
>lineChar.character : number
>lineChar : ts.LineAndCharacter
>character : number
>diagnostic.messageText : string
>diagnostic.messageText : string | ts.DiagnosticMessageChain
>diagnostic : ts.Diagnostic
>messageText : string
>messageText : string | ts.DiagnosticMessageChain
});
@ -2250,17 +2250,13 @@ declare module "typescript" {
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -2400,10 +2396,6 @@ declare module "typescript" {
>getCompilerOptions : () => CompilerOptions
>CompilerOptions : CompilerOptions
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
getSourceFiles(): SourceFile[];
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
@ -3659,8 +3651,9 @@ declare module "typescript" {
length: number;
>length : number
messageText: string;
>messageText : string
messageText: string | DiagnosticMessageChain;
>messageText : string | DiagnosticMessageChain
>DiagnosticMessageChain : DiagnosticMessageChain
category: DiagnosticCategory;
>category : DiagnosticCategory

View File

@ -772,14 +772,13 @@ declare module "typescript" {
}
interface Program extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
getCompilerHost(): CompilerHost;
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -826,7 +825,6 @@ declare module "typescript" {
}
interface TypeCheckerHost {
getCompilerOptions(): CompilerOptions;
getCompilerHost(): CompilerHost;
getSourceFiles(): SourceFile[];
getSourceFile(fileName: string): SourceFile;
}
@ -1175,7 +1173,7 @@ declare module "typescript" {
file: SourceFile;
start: number;
length: number;
messageText: string;
messageText: string | DiagnosticMessageChain;
category: DiagnosticCategory;
code: number;
}

View File

@ -2397,17 +2397,13 @@ declare module "typescript" {
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -2547,10 +2543,6 @@ declare module "typescript" {
>getCompilerOptions : () => CompilerOptions
>CompilerOptions : CompilerOptions
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
getSourceFiles(): SourceFile[];
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
@ -3806,8 +3798,9 @@ declare module "typescript" {
length: number;
>length : number
messageText: string;
>messageText : string
messageText: string | DiagnosticMessageChain;
>messageText : string | DiagnosticMessageChain
>DiagnosticMessageChain : DiagnosticMessageChain
category: DiagnosticCategory;
>category : DiagnosticCategory

View File

@ -772,14 +772,13 @@ declare module "typescript" {
}
interface Program extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
getCompilerHost(): CompilerHost;
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -826,7 +825,6 @@ declare module "typescript" {
}
interface TypeCheckerHost {
getCompilerOptions(): CompilerOptions;
getCompilerHost(): CompilerHost;
getSourceFiles(): SourceFile[];
getSourceFile(fileName: string): SourceFile;
}
@ -1175,7 +1173,7 @@ declare module "typescript" {
file: SourceFile;
start: number;
length: number;
messageText: string;
messageText: string | DiagnosticMessageChain;
category: DiagnosticCategory;
code: number;
}

View File

@ -212,9 +212,9 @@ function transform(contents: string, compilerOptions: ts.CompilerOptions = {}) {
>e : ts.Diagnostic
>start : number
>line : number
>e.messageText : string
>e.messageText : string | ts.DiagnosticMessageChain
>e : ts.Diagnostic
>messageText : string
>messageText : string | ts.DiagnosticMessageChain
};
}
@ -2338,17 +2338,13 @@ declare module "typescript" {
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -2488,10 +2484,6 @@ declare module "typescript" {
>getCompilerOptions : () => CompilerOptions
>CompilerOptions : CompilerOptions
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
getSourceFiles(): SourceFile[];
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
@ -3747,8 +3739,9 @@ declare module "typescript" {
length: number;
>length : number
messageText: string;
>messageText : string
messageText: string | DiagnosticMessageChain;
>messageText : string | DiagnosticMessageChain
>DiagnosticMessageChain : DiagnosticMessageChain
category: DiagnosticCategory;
>category : DiagnosticCategory

View File

@ -810,14 +810,13 @@ declare module "typescript" {
}
interface Program extends ScriptReferenceHost {
getSourceFiles(): SourceFile[];
getCompilerHost(): CompilerHost;
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -864,7 +863,6 @@ declare module "typescript" {
}
interface TypeCheckerHost {
getCompilerOptions(): CompilerOptions;
getCompilerHost(): CompilerHost;
getSourceFiles(): SourceFile[];
getSourceFile(fileName: string): SourceFile;
}
@ -1213,7 +1211,7 @@ declare module "typescript" {
file: SourceFile;
start: number;
length: number;
messageText: string;
messageText: string | DiagnosticMessageChain;
category: DiagnosticCategory;
code: number;
}

View File

@ -362,9 +362,9 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
>lineChar.character : number
>lineChar : ts.LineAndCharacter
>character : number
>diagnostic.messageText : string
>diagnostic.messageText : string | ts.DiagnosticMessageChain
>diagnostic : ts.Diagnostic
>messageText : string
>messageText : string | ts.DiagnosticMessageChain
}
else {
console.log(` Error: ${diagnostic.messageText}`);
@ -372,9 +372,9 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
>console.log : any
>console : any
>log : any
>diagnostic.messageText : string
>diagnostic.messageText : string | ts.DiagnosticMessageChain
>diagnostic : ts.Diagnostic
>messageText : string
>messageText : string | ts.DiagnosticMessageChain
}
});
}
@ -2523,17 +2523,13 @@ declare module "typescript" {
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
/**
* Emits the javascript and declaration files. If targetSourceFile is not specified, then
* the javascript and declaration files will be produced for all the files in this program.
* If targetSourceFile is specified, then only the javascript and declaration for that
* specific file will be generated.
*
* If writeFile is not specified then the writeFile callback from getCompilerHost() will be
* If writeFile is not specified then the writeFile callback from the compiler host will be
* used for writing the javascript and declaration files. Otherwise, the writeFile parameter
* will be invoked when writing the javascript and declaration files.
*/
@ -2673,10 +2669,6 @@ declare module "typescript" {
>getCompilerOptions : () => CompilerOptions
>CompilerOptions : CompilerOptions
getCompilerHost(): CompilerHost;
>getCompilerHost : () => CompilerHost
>CompilerHost : CompilerHost
getSourceFiles(): SourceFile[];
>getSourceFiles : () => SourceFile[]
>SourceFile : SourceFile
@ -3932,8 +3924,9 @@ declare module "typescript" {
length: number;
>length : number
messageText: string;
>messageText : string
messageText: string | DiagnosticMessageChain;
>messageText : string | DiagnosticMessageChain
>DiagnosticMessageChain : DiagnosticMessageChain
category: DiagnosticCategory;
>category : DiagnosticCategory