-
Notifications
You must be signed in to change notification settings - Fork 131
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
missing pieces in the AST: parser seems to skip broken annotation altogether when on method parameters #3155
Milestone
Comments
Using Javac parser and the converter from https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/tree/dom-with-javac , the annotation seems to remain:
|
stephan-herrmann
added a commit
to stephan-herrmann/eclipse.jdt.core
that referenced
this issue
Oct 25, 2024
altogether when on method parameters recover incomplete annotation on argument fixes eclipse-jdt#3155
This looks like another iteration of https://bugs.eclipse.org/bugs/show_bug.cgi?id=130778 (2006-2008) :) |
Thanks @martinlippert this was a good one :) |
Wow, that was quick! So many thanks @stephan-herrmann, very much appreciated!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am parsing (somewhat broken) Java source code using the ASTParser and came across several situations in which the parser seems to not include information about the parsed code anymore.
The concrete case here is this constructor (for example):
In this case, the value for the attribute
value
behind the=
is missing from the source code. As a result, the annotation gets removed from the AST altogether. TheMethodDeclaration
node in the parsed AST looks like this:Since I would like to implement some code completion based on the parsed AST, I somewhat depend some information being still around for the annotation.
This seems to happen for annotations on method parameters only.
The same broken annotation code on a type declaration results in a DOM that got a
$missing$
node inserted nicely:(@mickaelistria, this is one of the cases that we talked about)
The text was updated successfully, but these errors were encountered: