Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bugfix: Make sure that we can query tree.source #24123

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

Merged
tgodzik merged 1 commit into scala:main from tgodzik:fix-array-issue
Oct 3, 2025

Conversation

Copy link
Contributor

@tgodzik tgodzik commented Oct 2, 2025

Copy link
Member

@zielinsky zielinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

Not sure about this use case, but for linting I used

 extension (pos: SrcPos)
 def isZeroExtentSynthetic: Boolean = pos.span.isSynthetic && pos.span.isZeroExtent
 def isSynthetic: Boolean = pos.span.isSynthetic && pos.span.exists

and for message rendering I wanted to check if it's at EOF, for some reason I got nervous and put the source.length check after other conditions on the span

 // adjust a pos at EOF if preceded by newline
 private def adjust(pos: SourcePosition): SourcePosition =
 if pos.span.isSynthetic
 && pos.span.isZeroExtent
 && pos.span.exists
 && pos.span.start == pos.source.length
 && pos.source(pos.span.start - 1) == '\n'
 then
 pos.withSpan(pos.span.shift(-1))
 else
 pos

Copy link
Contributor Author

tgodzik commented Oct 3, 2025

I think we should be good here, though it's one of the cases that I am lacking the reproduction, so it's only a guess here. The might have been zero extent, but not sure.

zielinsky reacted with thumbs up emoji

@tgodzik tgodzik merged commit 9f70200 into scala:main Oct 3, 2025
50 of 51 checks passed
@tgodzik tgodzik deleted the fix-array-issue branch October 3, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@zielinsky zielinsky zielinsky approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /