netbeans
netbeans copied to clipboard
Override Method Autocompletion does nothing
Apache NetBeans version
Apache NetBeans 13
What happened
Autocomplete for method override does not work, and instead deletes entered text, and does not create method stub.
How to reproduce
- Begin typing at the top level of a class, as if to add a new method ("didCh").
- Select the autocomplete option to override the selected method ("didChangeWorkspaceFolder")
- Hit enter
- The text and autocomplete box disappears, but no method stub is created.
This only appears to happen in this one specific file, not generally, but it is does happen for any method (not just didChangeWorkspaceFolder) and is reproduceable both on 12.6 and 13. It also works fine if, instead of typing something first, you just hit ctrl-space, type nothing, but scroll to the selected method and hit enter, however hitting ctrl-space, then typing some to filter the list, and then hitting enter also fails. It appears that typing some is the required catalyst.
Specifically, this occurs when trying to override methods while in the LangServ.java file.
(Checkout fc3603f3de7d28983010530fdf63e14fa1fda6e6 and edit this file: https://github.com/EngineHub/CommandHelper/blob/fc3603f3de7d28983010530fdf63e14fa1fda6e6/src/main/java/com/laytonsmith/tools/langserv/LangServ.java)
I selected that this worked in 12.5, but I don't actually know when this broke, and I only have 12.6 and 13 installed to test against.
Did this work correctly in an earlier version?
Apache NetBeans 12.5
Operating System
Windows 10
JDK
Adoptium JDK 17
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No
Code of Conduct
Yes
This has also happened to me many times, I'm not really sure how to reproduce it, it seems to be random, sometimes it works, sometimes it doesn't. But yea I think it has been happening even before 12.5, this has been one of bugs I've noticed ever since migrating from version 8.2.
The reproduction that I outlined with that one method seems to be consistent! So hopefully that helps. But yeah, not all methods break, I couldn’t figure out a pattern though, so I don’t know why.
any exception in the log when that happens?
No, unfortunately not. Neither in the IDE Log or in Notifications. Not sure if there's another place to check or not.
I tried "cl" to find clone, because I couldn't fine the method that you mentioned. I didn't setup the project and I got problems while resolving the conflicts, so I tried another method and I tried that on line 119 right after the LangServ class and for me it worked, unfortunately. Win 10, JDK 14, NB 13. Just to let you know. But I can remember that I had sometimes similar things months ago but can't remember. The code will not exactly add to the line, where I wrote but one line below which also seems a bit strange.
I'm having the same issue here... NB 12.6, JDK 1.8
I've downgraded to NB 12.5, and the issue was fixed! In my case, it's likely related to https://issues.apache.org/jira/browse/NETBEANS-6349