eclipse-jdt / eclipse-jdt/eclipse.jdt.core

missing pieces in the AST: parser seems to skip member value pair name when there is a . at the end

Open
#3,421 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 10h
Merged PRs (30d)
49

Description

Similar to https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3155, I am working on code completion based on AST nodes and came across this case for a field declaration, as another follow-up from #3156:

```
@Value(value=spring.)
```

results in an AST that looks like:

```
@Value(value.$missing$)
```

It looks like the parser turns this annotation into a `SingleMemberAnnotation` with a `QualifiedName`, where it should keep the usual member value pair structure.

(using `org.eclipse.jdt.core` 3.40.0)
@FYI @mickaelistria and @stephan-herrmann)

Contributor guide

Open the contributing guide

Research direction

Reproduce the annotation example `@Value(value=spring.)` and inspect the resulting AST shape, comparing it with the expected member value pair structure. Start by tracing the parser path for annotations, qualified names, and incomplete expressions; done means the trailing-dot case retains the usual member value pair structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.