File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed
pglt_workspace/src/workspace/server Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -59,5 +59,9 @@ mod tests {
59
59
"select 1443ddwwd33djwdkjw13331333333333; select 1443ddwwd33djwdkjw13331333333333;" ;
60
60
let diagnostics = lex ( input) . unwrap_err ( ) ;
61
61
assert_eq ! ( diagnostics. len( ) , 2 ) ;
62
+ assert_eq ! ( diagnostics[ 0 ] . span. unwrap( ) . start( ) , 7 . into( ) ) ;
63
+ assert_eq ! ( diagnostics[ 0 ] . span. unwrap( ) . end( ) , 39 . into( ) ) ;
64
+ assert_eq ! ( diagnostics[ 1 ] . span. unwrap( ) . start( ) , 48 . into( ) ) ;
65
+ assert_eq ! ( diagnostics[ 1 ] . span. unwrap( ) . end( ) , 80 . into( ) ) ;
62
66
}
63
67
}
Original file line number Diff line number Diff line change @@ -103,11 +103,7 @@ impl Document {
103
103
self . diagnostics = diagnostics;
104
104
105
105
// Do not add any statements if there is a fatal error
106
- if self
107
- . diagnostics
108
- . iter ( )
109
- . any ( |d| d. severity ( ) == pglt_diagnostics:: Severity :: Fatal )
110
- {
106
+ if self . has_fatal_error ( ) {
111
107
return changes;
112
108
}
113
109
@@ -264,11 +260,7 @@ impl Document {
264
260
265
261
self . diagnostics = diags;
266
262
267
- if self
268
- . diagnostics
269
- . iter ( )
270
- . any ( |d| d. severity ( ) == pglt_diagnostics:: Severity :: Fatal )
271
- {
263
+ if self . has_fatal_error ( ) {
272
264
// cleanup all positions if there is a fatal error
273
265
changed. extend ( self . drain_positions ( ) ) ;
274
266
// still process text change
@@ -333,11 +325,7 @@ impl Document {
333
325
334
326
self . diagnostics = diags;
335
327
336
- if self
337
- . diagnostics
338
- . iter ( )
339
- . any ( |d| d. severity ( ) == pglt_diagnostics:: Severity :: Fatal )
340
- {
328
+ if self . has_fatal_error ( ) {
341
329
// cleanup all positions if there is a fatal error
342
330
changed. extend ( self . drain_positions ( ) ) ;
343
331
// still process text change
You can’t perform that action at this time.
0 commit comments