Skip to content

Conversation

@SolalPirelli
Copy link
Contributor

Possibly controversial.

Review commit by commit, I rewrote history to make that easier.

|object O/*_empty_.O.*/ {
| val a/*_empty_.O.a.*/ = 123
| val b/*_empty_.O.b.*/ = a/*_empty_.O.a.*/ +/*scala.Int#`+`(+4).*/ 1
|object O/*<-_empty_::O.*/ {
Copy link
Member

@bishabosha bishabosha Jan 23, 2026

Choose a reason for hiding this comment

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

did you change the way the extractor works or something? - oh most likely reusing the existing printer rather than whatever they were using

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the presentation-compiler's test code to print a text document was slightly different than the compiler's test code, this moves to the compiler's version

val idx = rest.indexWhere(filter).ensuring(_ >= 0)
b.append('+').append(idx + 1)
val idx = rest.indexWhere(filter)
if idx >= 0 then b.append('+').append(idx + 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This here is the one change in the existing (compiler) version to accommodate the presentation-compiler: there are cases where we don't find a symbol matching filter in alts at all, so using ensuring would crash. The presentation-compiler's version already had this if.

end localIdx

private[semanticdb] object SemanticSymbolBuilder:
def inverseSymbol(sym: String)(using ctx: Context): List[Symbol] =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved as-is from the presentation-compiler, so that only the compiler has to reach into the internals of the semanticdb package.

@SolalPirelli SolalPirelli marked this pull request as ready for review January 26, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants