Bug 203039 - Kate auto completion sporatic or non-functional
Summary: Kate auto completion sporatic or non-functional
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Unspecified
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-08 05:30 UTC by David Rankin
Modified: 2011-06-22 19:29 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing no completion (111.15 KB, image/jpeg)
2009-08-08 05:43 UTC, David Rankin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Rankin 2009-08-08 05:30:59 UTC
Version:            (using KDE 4.3.0)
Installed from:    SuSE RPMs

Auto completion in kate/kwrite is very inconsistent in the way it works compared to the kde3 version. In kde3, though annoying at time, auto completion worked on every word, every time.

In kde4, just the opposite is happening. Realistically, auto-completion works correctly about 30% of the time. 40% of the time is will not complete the word (variable) you want it to complete, and the remaining 30% of the time, auto-completion is hit-or-miss working sometimes and then not for the very same variable.

Auto-completion is enabled with the default minimum word length to complete set at 3 (default). The link below is a kate screenshot showing the cursor immediately after:

    cp $k $DUPD

where $DUPD should be auto-completed to $DUPDIR but kate will not complete the word no matter what.

Whatever is preventing auto-completion from doing its job needs to be fixed. Like I said, though slightly annoying, in kde3 auto-completion worked every time for every word over the minimum completion length, consistently and every time.

Auto-completion in kde4 is "like a box of chocolates", you never know what you are going to get. This is much more annoying than knowing what to expect. If you can think of a test to help narrow down the problem, let me know and I'll be happy to run it. Thanks.
Comment 1 David Rankin 2009-08-08 05:43:06 UTC
Created attachment 35983 [details]
Screenshot showing no completion

Sorry, I forgot the screenshot. Here it is attached and at:

http://www.3111skyline.com/download/openSUSE_bugs/kde4/screenshots/kate-completion.jpeg
Comment 2 Wolf Behrenhoff 2009-08-10 11:03:00 UTC
Same problem here. Although switched on, one often needs to press C-Space to get auto-completion which is very annoying.

I'm not quite sure when exactly completion works and when it needs to be triggered manually.

Example: type the following:

$myvar->thisIsATest();
$myvar->this

Now "thisIsATest" should be auto-completed! Even more stange: if you now add a space and type "this" again

$myvar->thisIsATest();
$myvar->this this

then Kate does auto-completion:

$myvar->thisIsATest();
$myvar->this thisIsATest

Now hat C-Backspace to delete the thisIsATest and type Backspace to remove the space. Not type I - and Kate will happily auto-complete the word it didn't auto-complete before!
Comment 3 Joseph Wenninger 2009-08-12 17:41:31 UTC
I'm going to look into this, since it annoyes me like hell too. 

If I remember correctly, for the completion to kick in there is a start threshhold of three or four typed characters and the word has to have at least three furher characters. I often get the feeling, that the start treshhold is only evaluated correctly after a backspace key press or if the characters of the start threshold are typed very fast.

As said, I'm going to investigate that.
Comment 4 Nick W 2009-08-17 22:22:04 UTC
Experiencing the same bug on Gentoo, kate-4.3.0

Driving me slightly crazy :P
Comment 5 Gunnstein Lye 2009-09-07 14:19:23 UTC
Same problem here, using opensuse KDE 4.3.1, rpm version: kate-4.3.1-78.2
It depends on where you are coming from when you type. Relocating the cursor helps.

Typing in PHP:
$foo->fubarMethod();
$foo->fubar [no word completion]
Press right arrow, left arrow, backspace, then 'r': word completion appears.
Comment 6 Piotr Keplicz 2009-10-08 19:37:35 UTC
With KDE 4.3.2 these problems are still experienced.

Since it worked fine and quick in 4.2 series, could changes to word completion in Kate be reverted?
Comment 7 Jakob Lund 2009-10-13 11:03:51 UTC
I'm having the same problem in Kubuntu. I filed a bug in launchpad:

"auto completion in kate is slow and unreliable"
https://bugs.launchpad.net/bugs/440916
Comment 8 Nick W 2009-11-05 06:09:26 UTC
Still present in KDE-4.3.3. Is there any info we can give to help get this fixed? It's my least favourite feature of KDE 4.
Comment 9 Gunnstein Lye 2009-11-05 10:14:58 UTC
Still present in Kate 3.3.3, KDE 4.3.3 release 1, opensuse 11.1. See my previous post for an easily reproducible case - fails every time. It looks like the highlighter fails to realize that we have left one word ($foo) and started on another (fubarMethod).
Comment 10 Nick W 2010-02-11 20:47:03 UTC
Still present in Kate 3.4.0, KDE SC 4.4.0.
Comment 11 Clinton Skakun 2010-02-12 01:05:49 UTC
I voted on it many moons ago.

On Thursday 11 February 2010 12:48:41 Nick W wrote:
> https://bugs.kde.org/show_bug.cgi?id=203039
> 
> 
> 
> 
> 
> --- Comment #10 from Nick W <nick customdesigns ca>  2010-02-11 20:47:03
>  --- Still present in Kate 3.4.0, KDE SC 4.4.0.
>
Comment 12 Dominik Haumann 2010-05-09 09:05:32 UTC
with regard to comment #5:
typing fub, the completion shows up. typing a, completion is still there. when typing the 'r', completion hides, because it completed the word currently seledted in the popup. If you previously select the word fubarMethod in the completion popup, it will not hide. In other words, the behavior of the completion list is rather smart in this case.

I bound Tools > Invoke code completion to ctrl+space. Whenever I want the completion I simply hit this shortcut and the popup shows up. Hence, is this really a bug or even the correct behavior? Maybe it should indeed show the remaining words. Is that what the report is about?
Comment 13 Gunnstein Lye 2010-05-09 19:38:02 UTC
(In reply to comment #12)
> with regard to comment #5:
> typing fub, the completion shows up. typing a, completion is still there. when
> typing the 'r', completion hides, because it completed the word currently
> seledted in the popup. If you previously select the word fubarMethod in the
> completion popup, it will not hide. In other words, the behavior of the
> completion list is rather smart in this case.

This behaviour sounds fine, but it's not the behaviour I'm seeing. To clarify, as I type the second line of my example, there is no auto completion popup at any point. Not until I do the magic relocate cursor trick:
- type '$foo->fubarMethod();'
- type '$foo->fuba' (bug: no popup)
- arrow right, arrow left
- type 'r' (ok: popup shows)

Wild guess: It looks like the autocompleter is being disabled in some contexts (perhaps in the '->' string) but it isn't enabled again when it should be. The arrow right, arrow left trick seems to fix the context and enable the autocompleter again.

> I bound Tools > Invoke code completion to ctrl+space. Whenever I want the
> completion I simply hit this shortcut and the popup shows up. Hence, is this
> really a bug or even the correct behavior? Maybe it should indeed show the
> remaining words. Is that what the report is about?

No, it is about the failure to auto popup the completer in certain situations, as described.
Comment 14 Dominik Haumann 2010-05-09 22:39:58 UTC
Ok, please build Kate yourself with the following howto (is very easy!):
http://gitorious.org/kate/pages/Building%20Kate

Does it work with the development version?
Comment 15 Gunnstein Lye 2010-05-10 12:06:43 UTC
First, I tried upgrading to KDE 4.4.3, this did not change the behaviour.

(In reply to comment #14)
> Ok, please build Kate yourself with the following howto (is very easy!):
> http://gitorious.org/kate/pages/Building%20Kate
> 
> Does it work with the development version?

Yes! I get the autocomplete popup as soon as I have typed 'fub'. Thank you very much!
Comment 16 Christoph Cullmann 2010-05-15 20:04:11 UTC
Great, then we have a fix :P
KDE 4.5 will contain it ;)
Comment 17 Deri James 2011-06-22 18:58:31 UTC
Whilst this worked great in 4.5 it seems to have reverted to its previous sporadic behaviour now I'm using 4.6.3 (kate 3.6.3). As before it s the auto popup which fails, using ctrl-space works ok, so in the exampl  above:-


$foo->fubarMethod();
$foo->fub <fail no popup>

but

$foo->fu
(move off line then back to line - i.e. up/down or right/left)
b <popup appears>
Comment 18 Michel Ludwig 2011-06-22 19:05:10 UTC
(In reply to comment #17)
> Whilst this worked great in 4.5 it seems to have reverted to its previous
> sporadic behaviour now I'm using 4.6.3 (kate 3.6.3).

This issue you are describing is most likely the one tracked in bug 266708. Please update to KDE 4.6.4 - it's fixed there.
Comment 19 Deri James 2011-06-22 19:29:24 UTC
Thankyou, indeed it is, sorry for the noise.