@@ -691,6 +691,7 @@ pub struct TsGoLintRuleDiagnostic {
691691#[ derive( Debug , Clone ) ]
692692pub struct TsGoLintInternalDiagnostic {
693693 pub message : RuleMessage ,
694+ pub range : Range ,
694695 pub file_path : Option < PathBuf > ,
695696}
696697
@@ -721,12 +722,13 @@ impl From<TsGoLintRuleDiagnostic> for OxcDiagnostic {
721722}
722723impl From < TsGoLintInternalDiagnostic > for OxcDiagnostic {
723724 fn from ( val : TsGoLintInternalDiagnostic ) -> Self {
724- let mut d = OxcDiagnostic :: error ( val. message . description ) ;
725+ let mut d = OxcDiagnostic :: error ( val. message . description )
726+ . with_error_code ( "typescript" , val. message . id ) ;
725727 if let Some ( help) = val. message . help {
726728 d = d. with_help ( help) ;
727729 }
728730 if val. file_path . is_some ( ) {
729- d = d. with_label ( Span :: new ( 0 , 0 ) ) ;
731+ d = d. with_label ( Span :: new ( val . range . pos , val . range . end ) ) ;
730732 }
731733 d
732734 }
@@ -1000,6 +1002,7 @@ fn parse_single_message(
10001002 DiagnosticKind :: Internal => {
10011003 TsGoLintDiagnostic :: Internal ( TsGoLintInternalDiagnostic {
10021004 message : diagnostic_payload. message ,
1005+ range : diagnostic_payload. range ,
10031006 file_path : diagnostic_payload. file_path . map ( PathBuf :: from) ,
10041007 } )
10051008 }
0 commit comments