Skip to content

Add Comments::find_before - #2691

Open
LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/comments-preceding-token-lookup
Open

LucaCappelletti94 wants to merge 1 commit into
mainfrom
upstream/comments-preceding-token-lookup

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

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.

CommentWithSpan records prev_token_end and next_token_start for the lookup and caller-defined association. These additional fields are a breaking API change for code constructing CommentWithSpan directly.

@LucaCappelletti94 LucaCappelletti94 added enhancement New feature or request api change labels Oct 19, 2026
@github-actions

Copy link
Copy Markdown

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 <Dialect>[, <Dialect>]: <description>, add a Dialects: <Dialect>[, <Dialect>] line to the description, or reply with one. Reply Dialects: none if the change is dialect-agnostic.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.34%. Comparing base (d32825d) to head (69273e4).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants