@@ -62,20 +62,20 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFil
6262 let result =
6363 "// <auto-generated />\r\n" +
6464 "// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel . replace ( / \\ / g, "/" ) + "'\r\n" +
65- "/* @internal */ \r\n" +
66- "namespace ts { \r\n" +
67- " function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}, elidedInCompatabilityPyramid?: boolean): DiagnosticMessage {\r\n" +
68- " return { code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid };\r\n" +
69- " }\r\n" +
70- " export const Diagnostics = {\r\n" ;
65+ "\r\n" +
66+ "import { DiagnosticCategory, DiagnosticMessage } from \"./ts\"; \r\n" +
67+ "function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}, elidedInCompatabilityPyramid?: boolean): DiagnosticMessage {\r\n" +
68+ " return { code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid };\r\n" +
69+ "}\r\n" +
70+ "export const Diagnostics = {\r\n" ;
7171 messageTable . forEach ( ( { code, category, reportsUnnecessary, elidedInCompatabilityPyramid } , name ) => {
7272 const propName = convertPropertyName ( name ) ;
7373 const argReportsUnnecessary = reportsUnnecessary ? `, /*reportsUnnecessary*/ ${ reportsUnnecessary } ` : "" ;
7474 const argElidedInCompatabilityPyramid = elidedInCompatabilityPyramid ? `${ ! reportsUnnecessary ? ", /*reportsUnnecessary*/ undefined" : "" } , /*elidedInCompatabilityPyramid*/ ${ elidedInCompatabilityPyramid } ` : "" ;
75- result += ` ${ propName } : diag(${ code } , DiagnosticCategory.${ category } , "${ createKey ( propName , code ) } ", ${ JSON . stringify ( name ) } ${ argReportsUnnecessary } ${ argElidedInCompatabilityPyramid } ),\r\n` ;
75+ result += ` ${ propName } : diag(${ code } , DiagnosticCategory.${ category } , "${ createKey ( propName , code ) } ", ${ JSON . stringify ( name ) } ${ argReportsUnnecessary } ${ argElidedInCompatabilityPyramid } ),\r\n` ;
7676 } ) ;
7777
78- result += " };\r\n} " ;
78+ result += "}; " ;
7979
8080 return result ;
8181}
0 commit comments