@@ -142,7 +142,7 @@ impl<'a> Translator<'a> {
142142 self . trap . emit_location ( self . label , label, start, end)
143143 } else {
144144 self . emit_diagnostic (
145- DiagnosticSeverity :: Info ,
145+ DiagnosticSeverity :: Debug ,
146146 "locations" . to_owned ( ) ,
147147 "missing location for AstNode" . to_owned ( ) ,
148148 "missing location for AstNode" . to_owned ( ) ,
@@ -169,9 +169,9 @@ impl<'a> Translator<'a> {
169169 pub fn emit_diagnostic (
170170 & mut self ,
171171 severity : DiagnosticSeverity ,
172- error_tag : String ,
173- error_message : String ,
174- full_error_message : String ,
172+ tag : String ,
173+ message : String ,
174+ full_message : String ,
175175 location : ( LineCol , LineCol ) ,
176176 ) {
177177 let ( start, end) = location;
@@ -187,16 +187,13 @@ impl<'a> Translator<'a> {
187187 self . path,
188188 start. line + 1 ,
189189 start. col + 1 ,
190- & error_message
191- ) ;
192- let location = self . trap . emit_location_label ( self . label , start, end) ;
193- self . trap . emit_diagnostic (
194- severity,
195- error_tag,
196- error_message,
197- full_error_message,
198- location,
190+ & message
199191 ) ;
192+ if severity > DiagnosticSeverity :: Debug {
193+ let location = self . trap . emit_location_label ( self . label , start, end) ;
194+ self . trap
195+ . emit_diagnostic ( severity, tag, message, full_message, location) ;
196+ }
200197 }
201198 pub fn emit_parse_error ( & mut self , owner : & impl ast:: AstNode , err : & SyntaxError ) {
202199 let owner_range: TextRange = owner. syntax ( ) . text_range ( ) ;
0 commit comments