From 28fa6029eb319e235f5e1df2d1a77db801da9189 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 6 Nov 2014 19:00:44 -0800 Subject: [PATCH] Fix the crash in getCompilerOptionsDiagnostics by not using file name as compiler options do not have file name Fixes #988 --- src/services/shims.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/services/shims.ts b/src/services/shims.ts index b93c699be73..c6705e34363 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -507,17 +507,6 @@ module ts { }; } - private realizeDiagnosticWithFileName(diagnostic: Diagnostic): { fileName: string; message: string; start: number; length: number; category: string; } { - return { - fileName: diagnostic.file.filename, - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: DiagnosticCategory[diagnostic.category].toLowerCase() - }; - } - public getSyntacticClassifications(fileName: string, start: number, length: number): string { return this.forwardJSONCall( "getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", @@ -559,7 +548,7 @@ module ts { "getCompilerOptionsDiagnostics()", () => { var errors = this.languageService.getCompilerOptionsDiagnostics(); - return errors.map(d => this.realizeDiagnosticWithFileName(d)) + return errors.map(LanguageServiceShimObject.realizeDiagnostic) }); }