-
Notifications
You must be signed in to change notification settings - Fork 669
Include DML keyword in statement span #2090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
42aba2d to
bfc8770
Compare
| insert_token: AttachedToken(TokenWithSpan { | ||
| token: Token::make_keyword("INSERT"), | ||
| span: Span::new((1, 1).into(), (1, 7).into()), | ||
| }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| insert_token: AttachedToken(TokenWithSpan { | |
| token: Token::make_keyword("INSERT"), | |
| span: Span::new((1, 1).into(), (1, 7).into()), | |
| }), | |
| insert_token: AttachedToken::empty(), |
I think for these we can use an empty token - since token comparisons are ignored in tests. Same for the other files
| } | ||
|
|
||
| #[test] | ||
| fn test_update_statement_span() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add similar test for DELETE, INSERT, REPLACE statements?
Includes the "update" keyword itself in the corresponding statement, making the statement's span cover its parsed source code
Motivation: party a (SQL) re-formatter and party the need to extract possible comments preceding the statements (and/or right after the keyword)
Related: [EPIC] Complete Span (source location) information / feature #1548