While coding in Ruby, the code completion assistant popped up. I continued typing and the code completion window
attempted to keep up with me, but was unable to do so.
When I completed my line and hit the return key, everything I had typed into the editor after the code completion popup
How to reproduce:
1) Create a project (I am using Ruby)
2) Open up/create a code file within the project which will require
you to type in code.
3) Type in some code which will cause the popup to appear at some point.
4) Allow the pop-up to appear
5) Continue typing faster than the popup can keep up. Include typing past what the system can match against the pop-up
An (ruby) example would be:
aValueString.each_byte do |i|
(pause after the each until the pop-up appears)
6) As soon as you complete typing the line, hit the enter key.
At this time, the editor only contains up to, but not beyond the "each" when the pop-up appeared.
This appears to be similar to my earlier bug that was closed as worksforme:
The difference is that in the earlier bug, the text was replaced with the wrong information. In this bug, the text is
I've looked at the difference between how the pop-up behaves in Ruby projects and Java Projects. Apparently, the dialog
in Java either works faster and vanishes once the method is "recognized". The Ruby side doesn't parse/populate as fast
or vanish when you have typed beyond what the system recognizes.
To reproduce the state from associated screen capture:
1) Start from a clean file.
2) Begin Typing the line "ActionC"
3) Bring up the completion dialog
4) Type "::Base"
5) Type ".reset"
*** At this point, the dialog on my machine is out of sync with my typing and no longer refreshes.
6) Continue typing "_session"
7) Hit the Enter key.
It seems to be that the bug must be in GsfCompletionProvider as it takes care of filtering the results; please evaluate
the issue. I wasn't able to reproduce (hence the incomplete keyword), but the reporter confirmed via email that this
happens to him all the time on different hardware configurations.
I'm removing the incomplete keyword to get the bug evaluated by the editor team. For me this wasn't reproducible.
Comment 11Vitezslav Stejskal
2009-05-27 15:17:59 UTC
If this is a speed issue, could you please use Profile Me! and attach here the profiler snapshot? Also please generate
several threaddumps in fast succession and attach them here. There is a wiki page describing how to do both threaddumps
and Profile Me! http://wiki.netbeans.org/GenerateThreadDump
Can you attach project where it is reproducible? I tried to create sample Ruby project and tried to simulate your use
case (in Depot Application I opened Models cart.rb, started to edit in
but when I type re code completion disappears.)
There is also big difference in behavior when code completion dialog is invoked in auto mode or explicitly. From your
steps it looks like it is invoked explicitly. Is it right?
Someone commented that the code-completion box is tied to the typing events. In essence, when the code completion
dialogs are displayed, they are key aware. Something I noticed in a test just now, is that the Ruby code completion
dialogs (and possibly others) are not tied to all of the relevant events. Most specifically, all mouse clicks.
To reproduce what I just experienced:
In a Ruby On Rails application, do some typing and allow the system to bring up the code-completion dialogs. Now move
the mouse cursor to the tab of the file you are currently editing and click the left mouse button. The dialogs should
close, but they don't.
Click on the pull down list of currently open files. The dialogs don't close.
This may signify a missing lose_focus handler somewhere which is exactly the missing behavior that (afaik) causes the
dialogs to process keystrokes when they are no longer relevant.
I just added another screenshot showing the behavior just prior to encountering this error.
What is happening is the system is taking an excessive (10 to 30+ seconds) time to load the code-completion dialogs.
While it is populating the dialog I am able to continue typing (whether it shows on the screen or not) and as I type, I
go beyond what is valid for the code-completion dialog box to process (as can be seen by the garbage displayed here.
If, after I type all of the text and the code-completion dialog box appears, I hit the Enter key, everything I have
typed since the code-completion dialog started populating is replaced by the highlighted entry in the code-completion
dialog. Any other key after the code-completion dialog appears results in only the dialogs being closed.
Typically, the long delays are caused when I manually invoke the code-completion dialog; however, the screenshot from
Jun 14th was generated by hitting the period ('.') key following the Event identifier. (In this case, Event is a model
in my project).
Comment 18Vitezslav Stejskal
2009-09-08 13:09:24 UTC
*** Issue 171563 has been marked as a duplicate of this issue. ***
Infrastructure part fixed in jet-main. 'Please wait' should be displayed when code completion refresh is slow.
However, the main problem here is the code completion refresh is slow in Ruby editor. It seems that (under some
circumstances) the Ruby completion refuses to filter results (obtained on initial code completion invocation) when user
starts typing again.