Author Topic: Autocomplete inconsistent?  (Read 8114 times)

curtiswren

  • Community Member
  • Posts: 38
  • Hero Points: 3
Autocomplete inconsistent?
« on: August 23, 2006, 06:01:16 PM »
Autocomplete seems to work differently based on the context.  For example, given the following code:
Code: [Select]
class Test
{
public:
   static void foo() {}
   static void foo2() {}
};

If I type "Te" and wait for the auto-complete list to come up, I have a number of options that start with Te, but nothing in the list is automatically highlighted so hitting Enter doesn't pick anything.  Typing s, further narrows the options, but still doesn't auto-highlight anything

If I type "Test::", I get a popup list that contains foo, foo2.  Typing f, auto-highlights the first foo, and if hit Enter, it autocompletes and I continue on.  Is there anyway to get this behaviour in the above "Te" example?  This was how it worked in version 9.

I'm running this on Redhat Linux ASE

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Autocomplete inconsistent?
« Reply #1 on: August 23, 2006, 07:04:31 PM »
Assuming Slick v11 there are quite a lot of possibilties to tweak '(auto)completion'.
Check 'File Ext. setup -> Autocomplete and Tagging tab'.

HS2

curtiswren

  • Community Member
  • Posts: 38
  • Hero Points: 3
Re: Autocomplete inconsistent?
« Reply #2 on: August 24, 2006, 12:03:56 PM »
I am using v11 and I've tried playing with all the settings in File Ext. setup / Autocomplete and Tagging, but still haven't been able to get this to work.

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: Autocomplete inconsistent?
« Reply #3 on: August 24, 2006, 12:49:45 PM »
Yeah, this is doing a good job of background irritation for me too  :)

I think the problem is because it's mixing auto-complete (kind of like the stuff in Word) and auto-list members (which is the stuff from v10 and previous). The light bulb thingy is probably meant as a warning to indicate that one should be using a different keys skillset, and off-hand I can't think of a solution which would retain the ease of use of each engine on its own - it's just the seemingly unpredictable mixing of them that's annoying.

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Autocomplete inconsistent?
« Reply #4 on: August 24, 2006, 06:29:29 PM »
Thanks for posting this. It gave me a chance to look a little more closely at this functionality. The inconsistency you are seeing is because there are two different pop-ups involved:
1) The Auto-Complete pop-up
2) The Auto-List Members pop-up.

Auto-List Members has been around a while. It pops up when you dereference a symbol, like "this.". It displays a list of members and automatically selects the first item. You can scroll through the list to pick a different item or press return to insert the selected item.

The Auto-Complete pop-up is new in v11. It combines a variety of different completions into a single pop-up that you previously had to invoke separately. If you look closely, it also selects the top item. But in this case, that item is a category and not one of the completions. Because there is an option, "Insert selected", that automatically inserts the selected item into your file we felt it was dangerous to automatically select the first item. This would cause your file to be altered in many cases you didn't want just because you paused in typing.

We thought about changing Auto List Members to make it behave in a similar manner, but there wasn't time in the schedule. I like to turn on the option for "Tab cycles through choices", then when the Auto-Complete pop-up is displayed, I can quickly tab through the list and pick the one I want.

We are certainly open to chaning this behavior. What would you consider to be the best behavior for these two pop-ups?

--Scott


curtiswren

  • Community Member
  • Posts: 38
  • Hero Points: 3
Re: Autocomplete inconsistent?
« Reply #5 on: August 24, 2006, 08:52:42 PM »
I like the way the Auto-List Members works, but that may just be because I've become so used to it over the years ;).  I thought that the categories might be causing the problem, so I turned them off, but it still is not quite the same.  In the Auto-Complete list, you have a dashed line around the top item, but it isn't really selected in the sense that you can hit enter to choose that item.  If you use the arrow keys, it then becomes shaded and the enter key works.

It looks like you cannot select the categories, so if you just added an option to allow auto-select on the Auto-Complete pop-up, I think that would make the behavior the same wouldn't it?

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: Autocomplete inconsistent?
« Reply #6 on: August 24, 2006, 11:00:04 PM »
Quote
felt it was dangerous to automatically select the first item
Indeed. On a new line (C source) try typing "#define" and then tab. My setup converts the #define to #defined, even though nothing is selected in the keyword popup.

If I get to the end of a line and finish with a word that could make a longer word, when I hit enter or a cursor key it puts the longer word there instead. I'm having to learn to hit escape whenever I'm typing and something flickers on the screen :(

I appreciate that this stuff can be difficult to get right, but perhaps we need an initiator key that isn't a normal editing key. Alt-enter, maybe. I could put up with that because if it's too hard to bother hitting alt-enter it's easy enough to type in full anyway.



ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Autocomplete inconsistent?
« Reply #7 on: August 25, 2006, 02:37:02 PM »
Hi dunkers, I tried like mad to reproduce your problem but I can't. "defined" is definitely a keyword, but typing "#def..." shouldn't bring up that completion because of the leading "#". Be sure to check your auto-complete settings, Tools > Options > File Extension Setup, select the Auto-Complete tag and turn off "Insert Selected". You didn't define any aliases for this stuff did you? This won't affect auto-list members, but will cut down on cases from auto-complete.

The problem you describe with things magically appearing when they shouldn't is why we are heading away from automatically selecting the top item in the list, as curtiswrenn is requesting. As usual, I guess making this an option allows each to have it there own way.

--Scott

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: Autocomplete inconsistent?
« Reply #8 on: August 25, 2006, 04:31:22 PM »
Scott, I don't have that option ticked. My auto-complete options look like this:

http://www.dunkers.co.uk/files/SE_options.jpg

I think I've found why it might not work for you, though. If you start with a new empty C file and type "#define" then nothing untoward happens. However, if you precede that line with "#ifdef something" then you get my problem! The #ifdef seems to switch something on.