File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
crates/oxc_ast/src/serialize Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ impl ESTree for TSModuleDeclarationConverter<'_, '_> {
9999 fn serialize < S : Serializer > ( & self , serializer : S ) {
100100 let module = self . 0 ;
101101
102+ let ranges = serializer. ranges ( ) ;
103+
102104 let mut state = serializer. serialize_struct ( ) ;
103105 state. serialize_field ( "type" , & JsonSafeString ( "TSModuleDeclaration" ) ) ;
104106 state. serialize_field ( "start" , & module. span . start ) ;
@@ -157,6 +159,11 @@ impl ESTree for TSModuleDeclarationConverter<'_, '_> {
157159 state. serialize_field ( "kind" , & module. kind ) ;
158160 state. serialize_field ( "declare" , & module. declare ) ;
159161 state. serialize_field ( "global" , & TSModuleDeclarationGlobal ( module) ) ;
162+
163+ if ranges {
164+ state. serialize_field ( "range" , & [ module. span . start , module. span . end ] ) ;
165+ }
166+
160167 state. end ( ) ;
161168 }
162169}
You can’t perform that action at this time.
0 commit comments