File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3350,6 +3350,7 @@ namespace ts {
33503350 messageText : string | DiagnosticMessageChain ;
33513351 category : DiagnosticCategory ;
33523352 code : number ;
3353+ source ?: string ;
33533354 }
33543355
33553356 export enum DiagnosticCategory {
Original file line number Diff line number Diff line change @@ -1824,10 +1824,20 @@ namespace ts.server.protocol {
18241824 */
18251825 text : string ;
18261826
1827+ /**
1828+ * The category of the diagnostic message, e.g. "error" vs. "warning"
1829+ */
1830+ category : string ;
1831+
18271832 /**
18281833 * The error code of the diagnostic message.
18291834 */
18301835 code ?: number ;
1836+
1837+ /**
1838+ * The name of the plugin reporting the message.
1839+ */
1840+ source ?: string ;
18311841 }
18321842
18331843 export interface DiagnosticEventBody {
Original file line number Diff line number Diff line change @@ -78,15 +78,19 @@ namespace ts.server {
7878 start : scriptInfo . positionToLineOffset ( diag . start ) ,
7979 end : scriptInfo . positionToLineOffset ( diag . start + diag . length ) ,
8080 text : ts . flattenDiagnosticMessageText ( diag . messageText , "\n" ) ,
81- code : diag . code
81+ code : diag . code ,
82+ category : DiagnosticCategory [ diag . category ] . toLowerCase ( ) ,
83+ source : diag . source
8284 } ;
8385 }
8486
8587 function formatConfigFileDiag ( diag : ts . Diagnostic ) : protocol . Diagnostic {
8688 return {
8789 start : undefined ,
8890 end : undefined ,
89- text : ts . flattenDiagnosticMessageText ( diag . messageText , "\n" )
91+ text : ts . flattenDiagnosticMessageText ( diag . messageText , "\n" ) ,
92+ category : DiagnosticCategory [ diag . category ] . toLowerCase ( ) ,
93+ source : diag . source
9094 } ;
9195 }
9296
@@ -601,6 +605,7 @@ namespace ts.server {
601605 length : d . length ,
602606 category : DiagnosticCategory [ d . category ] . toLowerCase ( ) ,
603607 code : d . code ,
608+ source : d . source ,
604609 startLocation : scriptInfo && scriptInfo . positionToLineOffset ( d . start ) ,
605610 endLocation : scriptInfo && scriptInfo . positionToLineOffset ( d . start + d . length )
606611 } ) ;
You can’t perform that action at this time.
0 commit comments