File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ pub struct Oxc {
5151 pub prettier_ir_text : String ,
5252 comments : Vec < Comment > ,
5353 diagnostics : Vec < OxcDiagnostic > ,
54+ source_text : String ,
5455}
5556
5657#[ napi]
@@ -62,7 +63,7 @@ impl Oxc {
6263
6364 #[ napi]
6465 pub fn get_diagnostics ( & self ) -> Vec < OxcError > {
65- self . diagnostics . iter ( ) . map ( OxcError :: from ) . collect ( )
66+ OxcError :: from_diagnostics ( "" , & self . source_text , self . diagnostics . clone ( ) )
6667 }
6768
6869 #[ napi]
@@ -75,6 +76,7 @@ impl Oxc {
7576 #[ napi]
7677 #[ allow( clippy:: allow_attributes, clippy:: needless_pass_by_value) ]
7778 pub fn run ( & mut self , source_text : String , options : OxcOptions ) -> napi:: Result < ( ) > {
79+ self . source_text . clone_from ( & source_text) ;
7880 self . diagnostics = vec ! [ ] ;
7981 self . scope_text = String :: new ( ) ;
8082 self . symbols_json = String :: new ( ) ;
You can’t perform that action at this time.
0 commit comments