-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
fix: Use a better heuristic for guessing type/field references in no classpath mode #5170
Conversation
…classpath mode In no classpath mode, JDT only gives us a ProblemBinding with a QualifiedNameReference. We then have to figure out whether this is a type, field, inner class, package or anything else ourselves. Previously, every child of an invocation was treated as a type. This patch changes it to favor fields and only falls back to a type access, if it appeared somewhere in an import. This is still far from perfect, but it at least produces better guesses. Closes INRIA#5151
@@ -63,7 +63,7 @@ public static void initializeContext() { | |||
/* 22 */ "...\n" + | |||
/* 23 */ "}\n"; | |||
|
|||
ctx = new ZippedCodeBaseTestContext(smpl, "src/test/resources/C4JShouldVibrate.zip", false); | |||
ctx = new ZippedCodeBaseTestContext(smpl, "src/test/resources/C4JShouldVibrate.zip", true); |
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.
Is there a reason for this change?
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.
Yes, it makes the test pass.
The test expects types to be imported but did not set the auto-import flag.
Could fix the reording of the imports before we merge? |
606d41b
to
1669e5a
Compare
Thanks @I-Al-Istannen |
In no classpath mode, JDT only gives us a ProblemBinding with a QualifiedNameReference. We then have to figure out whether this is a type, field, inner class, package or anything else ourselves. Previously, every child of an invocation was treated as a type. This patch changes it to favor fields and only falls back to a type access, if it appeared somewhere in an import.
This is still far from perfect, but it at least produces better guesses.
Closes #5151