eclipse-jdt / eclipse-jdt/eclipse.jdt.core
[Records][Model] Some loose ends needing follow up
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
I am spawning off a fresh ticket to track two items from https://github.com/eclipse-jdt/eclipse.jdt.core/issues/3925 pertaining to model that need to be followed up. I think these are minor issues not impacting anything major at the moment.
1. `org.eclipse.jdt.internal.core.SelectionRequestor.acceptLocalVariable(LocalVariableBinding, ICompilationUnit)` sets compact constructor parameter coordinates to 0; likewise annotations are nulled out - the former may be reasonable - these are implicit parameters after all, but relevant annotations should be captured. In the compiler land, one would use a call to
`Annotation[] relevantAnnotations = ASTNode.getRelevantAnnotations(sourceRecordComponent.annotations, TagBits.AnnotationForParameter, null);`
to do this. We need to figure out how to materialize the source record component and retrieve the relevant annotations.
2. Follow up comment left in org.eclipse.jdt.internal.core.search.matching.LocalVariableLocator.resolveLevel(Binding) : Unfortunately, I seem to have lost the context - the comment reads: `// This whole area is a mess, needs follow up. For now don't allow a declared local to match an implicit local` - perhaps by deleting the most recent code change introduced there and figuring out what failure it is working around - one may be able to succinctly capture the problem statement.
What I do recall is - the workaround is legit - perhaps not the cleanest and hence the follow up comment.
Contributor guide
Assessment
This issue has not been assessed yet.