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
Reassigning to Ruby.
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.
I'm probably not able to type fast enough to reproduce this:) I'll keep trying still.
There seems to be a speed issue with the code-completion dialog under ruby. See my additional report
http://www.netbeans.org/issues/show_bug.cgi?id=160975 for another issue with speed and synchronization using this component.
Created attachment 79495 [details]
Screen Shot of dialog window after 20 second wait for the dialog to refresh
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.
I'm sorry but I still can't reproduce this (not even with your steps). Can you reproduce this completely from scratch
(with a new project)?
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.
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
Marek, these are yours now ...
Are you able to reproduce with latest trunk dev build? With Java project (java source)? Or only with Ruby?
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.
Created attachment 83549 [details]
Screenshot showing GUI just prior to text replacement
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).
*** Issue 171563 has been marked as a duplicate of this issue. ***
Dusan pls can you look at this?
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.
Finally, I'm able to reproduce the issue now.
Fixed in jet-main.
Integrated into 'main-golden', will be available in build *200909181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Dusan Balek <email@example.com>
Log: Issue #160940: Code-Completion/Hint processing erases editor text - fixed.