-
Notifications
You must be signed in to change notification settings - Fork 40
emit overridden methods for method SymbolInformation #172
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
Conversation
olafurpg
left a comment
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.
The fix looks good. Can we add unit tests in TargetedSuite that validate that the overrides are defined?
It would be good to check the following cases
- override other method that's defined in the same file
- override other method that's defined outside the file, for example by implementing
AutoCloseable - override interface method
- override abstract class method
- override method with type parameters, example
interface Haha<T> {
void add(T elem);
}
class IntHaha implements Haha<Integer> {
void add(Integer elem) {}
}
semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac/SemanticdbVisitor.java
Show resolved
Hide resolved
olafurpg
left a comment
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.
The new test cases look great. One comment on how to make them a bit less repetitive, otherwise this is ready to merge soon!
| { | ||
| case (count, symbols) => | ||
| assertEquals(count, 1) | ||
| assertEquals(symbols.apply(0), "example/Parent#Haha#add().") |
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.
👨🍳 💋
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 is surprisingly difficult to implement if you roll your own semantic analysis
Previously, if
Ais a subclass of/implementsBandAoverridesB.X, find references onA.Xwould not include the references for theB.Xand vice versa.Addresses https://github.com/sourcegraph/sourcegraph/issues/15699 for lsif-java.
This PR is pending validation of https://github.com/sourcegraph/sourcegraph/pull/20160 with lsif-java output specifically.