-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Encapsulate SemanticDB package, unify symbol and document printing #25084
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?
Encapsulate SemanticDB package, unify symbol and document printing #25084
Conversation
…tDocumentProvider
| |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.*/ { |
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.
did you change the way the extractor works or something? - oh most likely reusing the existing printer rather than whatever they were using
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.
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) |
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.
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] = |
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.
Moved as-is from the presentation-compiler, so that only the compiler has to reach into the internals of the semanticdb package.
Possibly controversial.
Review commit by commit, I rewrote history to make that easier.