-
Notifications
You must be signed in to change notification settings - Fork 26
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
add pretty-printing of annotations on symbols #148
Conversation
f8db39d
to
2e9025b
Compare
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.
Phenomenal work getting annotations working! SemanticDB has never properly supported annotations because they're too complicated to model in Scala. It's a fantastic breakthrough that we can properly support Java annotations.
A few comments, the most important ones relate to changes in the SemanticDB spec.
semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbTypeVisitor.java
Show resolved
Hide resolved
lsif-semanticdb/src/main/java/com/sourcegraph/lsif_semanticdb/SignatureFormatter.java
Show resolved
Hide resolved
lsif-semanticdb/src/main/java/com/sourcegraph/lsif_semanticdb/SignatureFormatter.java
Show resolved
Hide resolved
semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java
Outdated
Show resolved
Hide resolved
Ive updated the PR description with the changes that arose from the review 🙂 @olafurpg |
a8e5910
to
e5f14a2
Compare
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.
Outstanding work 👏 This is ready to merge!
It would be good to followup soon with the upstream spec changes.
lsif-semanticdb/src/main/java/com/sourcegraph/lsif_semanticdb/SignatureFormatter.java
Outdated
Show resolved
Hide resolved
e419be0
to
2d36a96
Compare
2d36a96
to
f0c3556
Compare
Merging ahead of scalameta/scalameta#2281. We dont anticipate the PR to result in any byte-level breaking changes to what is being merged here |
Previously, symbols that had annotations did not render those in the formatter/pretty-printer.
This PR introduces 2 new semanticdb spec changes that need to be upstreamed:
AnnotationTree
type as part of theTree
collection.Annotation
type used inSymbolInformation
(andAnnotatedType
) while having the same index 1 field and an additional repeatedTree
field for parametersAssignTree
type as part of theTree
collection, for assignment expressions.In combination, these add support to semanticdb for modeling the full JLS annotation spec, which we utilize to pretty-print.
Follow-up PRs:
Add helper functions for building many of the semanticdb constructs add pretty-printing of annotations on symbols #148 (comment)✔️Move the✔️semanticdbXXX
methods inSemanticdbVisitor
to a separate class add pretty-printing of annotations on symbols #148 (comment)