@@ -31,13 +31,13 @@ use super::{
3131 FunctionArguments , GroupByExpr , HavingBound , IfStatement , IlikeSelectItem , Insert , Interpolate ,
3232 InterpolateExpr , Join , JoinConstraint , JoinOperator , JsonPath , JsonPathElem , LateralView ,
3333 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 ,
4141} ;
4242
4343/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -365,7 +365,7 @@ impl Spanned for Statement {
365365 from_query : _,
366366 partition : _,
367367 } => Span :: empty ( ) ,
368- Statement :: Open { cursor_name } => cursor_name . span ,
368+ Statement :: Open ( open ) => open . span ( ) ,
369369 Statement :: Close { cursor } => match cursor {
370370 CloseCursor :: All => Span :: empty ( ) ,
371371 CloseCursor :: Specific { name } => name. span ,
@@ -2305,6 +2305,13 @@ impl Spanned for BeginEndStatements {
23052305 }
23062306}
23072307
2308+ impl Spanned for OpenStatement {
2309+ fn span ( & self ) -> Span {
2310+ let OpenStatement { cursor_name } = self ;
2311+ cursor_name. span
2312+ }
2313+ }
2314+
23082315#[ cfg( test) ]
23092316pub mod tests {
23102317 use crate :: dialect:: { Dialect , GenericDialect , SnowflakeDialect } ;
0 commit comments