@@ -31,13 +31,13 @@ use super::{
31
31
FunctionArguments , GroupByExpr , HavingBound , IfStatement , IlikeSelectItem , Insert , Interpolate ,
32
32
InterpolateExpr , Join , JoinConstraint , JoinOperator , JsonPath , JsonPathElem , LateralView ,
33
33
LimitClause , MatchRecognizePattern , Measure , NamedWindowDefinition , ObjectName , ObjectNamePart ,
34
- Offset , OnConflict , OnConflictAction , OnInsert , OrderBy , OrderByExpr , OrderByKind , Partition ,
35
- PivotValueSource , ProjectionSelect , Query , RaiseStatement , RaiseStatementValue ,
36
- ReferentialAction , RenameSelectItem , ReplaceSelectElement , ReplaceSelectItem , Select ,
37
- SelectInto , SelectItem , SetExpr , SqlOption , Statement , Subscript , SymbolDefinition , TableAlias ,
38
- TableAliasColumnDef , TableConstraint , TableFactor , TableObject , TableOptionsClustered ,
39
- TableWithJoins , UpdateTableFromKind , Use , Value , Values , ViewColumnDef , WhileStatement ,
40
- WildcardAdditionalOptions , With , WithFill ,
34
+ Offset , OnConflict , OnConflictAction , OnInsert , OpenStatement , OrderBy , OrderByExpr ,
35
+ OrderByKind , Partition , PivotValueSource , ProjectionSelect , Query , RaiseStatement ,
36
+ RaiseStatementValue , ReferentialAction , RenameSelectItem , ReplaceSelectElement ,
37
+ ReplaceSelectItem , Select , SelectInto , SelectItem , SetExpr , SqlOption , Statement , Subscript ,
38
+ SymbolDefinition , TableAlias , TableAliasColumnDef , TableConstraint , TableFactor , TableObject ,
39
+ TableOptionsClustered , TableWithJoins , UpdateTableFromKind , Use , Value , Values , ViewColumnDef ,
40
+ WhileStatement , WildcardAdditionalOptions , With , WithFill ,
41
41
} ;
42
42
43
43
/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -365,7 +365,7 @@ impl Spanned for Statement {
365
365
from_query : _,
366
366
partition : _,
367
367
} => Span :: empty ( ) ,
368
- Statement :: Open { cursor_name } => cursor_name . span ,
368
+ Statement :: Open ( open ) => open . span ( ) ,
369
369
Statement :: Close { cursor } => match cursor {
370
370
CloseCursor :: All => Span :: empty ( ) ,
371
371
CloseCursor :: Specific { name } => name. span ,
@@ -2305,6 +2305,13 @@ impl Spanned for BeginEndStatements {
2305
2305
}
2306
2306
}
2307
2307
2308
+ impl Spanned for OpenStatement {
2309
+ fn span ( & self ) -> Span {
2310
+ let OpenStatement { cursor_name } = self ;
2311
+ cursor_name. span
2312
+ }
2313
+ }
2314
+
2308
2315
#[ cfg( test) ]
2309
2316
pub mod tests {
2310
2317
use crate :: dialect:: { Dialect , GenericDialect , SnowflakeDialect } ;
0 commit comments