netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Override Method Autocompletion does nothing

Open LadyCailin opened this issue 3 years ago • 7 comments
trafficstars

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

  1. Begin typing at the top level of a class, as if to add a new method ("didCh").
  2. Select the autocomplete option to override the selected method ("didChangeWorkspaceFolder")
  3. Hit enter
  4. 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

LadyCailin avatar Mar 12 '22 01:03 LadyCailin

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.

newk5 avatar Mar 15 '22 23:03 newk5

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.

LadyCailin avatar Mar 15 '22 23:03 LadyCailin

any exception in the log when that happens?

mbien avatar Mar 17 '22 03:03 mbien

No, unfortunately not. Neither in the IDE Log or in Notifications. Not sure if there's another place to check or not.

LadyCailin avatar Mar 17 '22 10:03 LadyCailin

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.

Chris2011 avatar Apr 22 '22 15:04 Chris2011

I'm having the same issue here... NB 12.6, JDK 1.8

danmoser avatar Aug 10 '22 15:08 danmoser

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

danmoser avatar Aug 10 '22 17:08 danmoser