-
Notifications
You must be signed in to change notification settings - Fork 1
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
improve how method and variable positions names are resolved #597
improve how method and variable positions names are resolved #597
Conversation
@mickaelistria @datho7561 A small but skeptical fix which I really need your eyes on. |
0739982
to
27c79d1
Compare
Seems to add 76 failures. |
@mickaelistria is there a easy way to see the diff of failing tests with this PR ? I think i have to refine the fix. |
27c79d1
to
0ce7ac2
Compare
I refined the fix, @mickaelistria please have a look at. I also see that now failed method delta is -80ish. |
// int endPos = javac.getEndPosition(this.javacCompilationUnit.endPositions); | ||
// if( !simpleName.toString().equals(FAKE_IDENTIFIER)) { | ||
// char theChar = this.rawText.charAt(endPos); | ||
// char soughtLastChar = simpleName.toString().charAt(simpleName.toString().length() - 1); | ||
// while (endPos > res.getStartPosition() && theChar != soughtLastChar) { | ||
// theChar = this.rawText.charAt(--endPos); | ||
// } | ||
// endPos++; | ||
// int length = simpleName.toString().length(); | ||
// if( endPos != -1 && endPos - length > 0) { | ||
// simpleName.setSourceRange(endPos - length, length); | ||
// } | ||
// } |
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.
Please just remove
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.
I will remove it once all tests passes as the final step, Until I will keep this review open as a reminder.
Looks like it still adds 35 failures compared to https://ci.eclipse.org/ls/job/jdt-core-incubator/job/dom-with-javac/ |
f752b35
to
42d59cc
Compare
I'm getting
The cause appears to be that the length of the name is non-zero, but the starting position is |
I suggest setting a break point on the two IllegalArgumentException throws in For instance, for constructors, the |
eece3fe
to
5469a34
Compare
@datho7561 @mickaelistria How do you run the tests locally for debugging, For example I tried to run a failing ASTConverter test in org.eclipse.jdt.core.tests.model but I get bunch of errors that I don't see in CI. basically regardless which branch I'm in they fail. |
Here's the config I use along with descriptions of the important parts I run the The runtime JRE must be Java 23. The Temurin build of Java 23 is not yet available (Java 23 is due in September I think), so I'm using the java.com early access build. In the VM arguments, you must pass all the flags needed to enable the javac bits. The list of arguments is available in the pom.xml for the javac.tests project We should probably document this somewhere. |
@datho7561 thanks a lot for the details, I thought I might have to use the Eclipse IDE to run the tests, but I can get It working in VSCode as well, even individuals tests using PDE plugin. What was missing is the java module entries which I totally forgot about. |
197cacf
to
43b14a1
Compare
ce7aa6c
into
eclipse-jdtls:dom-with-javac
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
fix: #592 * Use simple name length instead of javac node length. * consider the fake name and error names when calculating length. * skip error and fake identifier nodes from position update. * improve fix how position is calculated
Fixes #592