Auto completion for locally declared types doesn't work properly
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 25
### What happened
No regression, already reproducible in older versions e.g NB 20.
hitting ctrl+space once will show them:

hitting it again will only show the inner class types.

As consequence, constructor completion for `Item3` and `Item4` does also not work.
### Language / Project Type / NetBeans Component
_No response_
### How to reproduce
```java
public class LocalTypeCompletion {
private record Item1(String name) {}
private class Item2{}
public void test() {
record Item3(String name) {}
class Item4{}
// new Item
// first completion contains all 4 Items,
// hitting ctrl+space again doesn't contain method-local Items
// as concequence, constructor completion does also not work.
}
}
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
linux
### JDK
21
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
_No response_
### Are you willing to submit a pull request?
No
Contributor guide
Research direction
Start with the Java example in the issue and reproduce completion after the first and second Ctrl+Space in NetBeans 25 on JDK 21. Trace the Java editor completion behavior for locally declared records and classes; done means method-local Item3 and Item4 remain available after repeated completion and their constructor completions work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100