Repository navigation
Add Comments::find_before - #2691
Conversation
|
No dialect label was applied because the title does not name a SQL dialect. If this change targets one or more dialects, edit the title to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2691 +/- ##
==========================================
+ Coverage 81.29% 81.34% +0.04%
==========================================
Files 42 42
Lines 33950 34041 +91
Branches 33950 34041 +91
==========================================
+ Hits 27601 27692 +91
Misses 2785 2785
Partials 3564 3564 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I didn't quite see it -- what problem does this fix? |
Ah this one is not a problem, it is not from the bug marathon. It is a feature I need, i.e. extending comment search in the AST. |
Comments::find_before(location)returns the comments between a token and the previous non-whitespace source token, in source order. It provides the token-relative lookup discussed in #2065 while leaving comment association to callers.CommentWithSpanrecordsprev_token_endandnext_token_startfor the lookup and caller-defined association. These additional fields are a breaking API change for code constructingCommentWithSpandirectly.