Bug 12547 - provide control over competion trigger-characters
Summary: provide control over competion trigger-characters
Status: RESOLVED FEATURE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0.8
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-06-04 17:13 UTC by David Jeske
Modified: 2014-10-16 11:24 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
ms studio express completion character config (46.10 KB, image/jpeg)
2013-06-04 17:13 UTC, David Jeske
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description David Jeske 2013-06-04 17:13:04 UTC
Created attachment 4069 [details]
ms studio express completion character config

Currently, once the code-completion list appears, the characters which will trigger a completion are mysterious and not configuratble. For some of us, completing automatically on characters like "space", ")", and "," is incredibly annoying, as they interfere with normal typing -- causing unintentional bogus completions.

While Xamarin has the "aggressively trigger code completion list", turning this off means the code completion list does not even appear, which is not what is desired. 

MS Visual Studio solves this problem by providing a preference in Completion which lists the characters that will trigger completion-selection. It's a simple text-field which defaults to something like " [](),.;" and can be edited by the user to contain whichever characters they prefer to trigger a completion, or none at all, if they want to require pressing enter to cause a completion.
Comment 1 Mikayla Hutchinson [MSFT] 2013-06-17 20:29:23 UTC
There's no need to add such an option, you can just use suggestion mode instead of completion mode.

You can find an explanation here: http://mjhutchinson.com/journal/2011/02/monodevelop_tips_suggestion_mode
Comment 2 David Jeske 2013-06-18 00:48:31 UTC
I don't understand. When I turn off "Enable Code Competion", the code-completion dialog never shows. I want it to always show (for documentation assistance) but never interfere with my typing. Is there some existing way to get this behavior?
Comment 3 David Jeske 2013-06-18 00:55:07 UTC
Regardless of the outcome of this feature request, it might be a good idea to make the meaning of these options clearer. I really don't understand what any of these checkboxes actually do, because their wording is so vague. Internet and help searches did not provide any more detailed answers..

[ ] Enable Code Completion

[ ] Aggressively Trigger Completion List

[ ] Enable Paramater Insight

What precisely do these checkboxes do?

I want a way to enable ALL possible code-completion dialogs, but have them never do anything unless I press Enter/TAB to inteact with them. Is there some way to get this behavior? It seems quite sane and normal to expect the code completion not to mess with my typing.
Comment 4 Mike Krüger 2013-06-18 02:16:33 UTC
It's not in the options - turn on suggestion mode for code completion in the  edit menu - suggestion mode is a togglable command. (Shift+Option-Space)

That'll change the behavior of the completion list.
Comment 5 David Jeske 2013-07-30 10:11:49 UTC
I can find no mechanism to get the behavior I want, which is standard in *EVERY* other IDE I use. 

I wish for the completion window to ALWAYS show when there is a possible completion, but NEVER trigger completion automatically. It should require an explicit "TAB" to get into the completion interaction. (so it does not normally interfere with my typing)

If I turn off completion in preferences, I never get the completion window automatically, and no amount of choosing "toggle completion suggestion mode" changes this. In fact, "toggle completion suggestion mode" appears to do nothing. Only if I explicitly press control-space, I get the completion window.

Am I doing something wrong? Or has Xamarin decided not to include this functionality? If so, why, when it's such a common and trivial way for the completion to operate as a non-intrustive documenttion aide?
Comment 6 David Jeske 2013-07-30 10:15:58 UTC
Okay, after some more mucking around, I understand what the previous comment meant. Xamarin has the functionality I want, but the UI for it i just really bad.

Please:

1) rename "toggle completion suggestion mode" to something like "Toggle Automatic Completion"
2) add a checkbox to control "Automatic Completion" to the options->text->general settings page

These are trivial changes which will make this feature much more understandable.
Comment 7 Mike Krüger 2013-07-30 10:32:06 UTC
I think I can add an option for that.
Comment 8 David Jeske 2013-07-30 21:05:38 UTC
awesome!
Comment 9 Mike Krüger 2013-07-31 05:56:39 UTC
I implemented the option & renamed the command - this makes it much easier to spot I guess :)

Thanks
Comment 10 Mikayla Hutchinson [MSFT] 2013-07-31 11:53:01 UTC
I don't think this is a good change. I agree that we have a discoverability problem for this setting but I don't think this is the right way to solve it.

Having two settings that do exactly the same thing is very confusing. What does it mean to toggle the command when the preference is set?

We used the terminology "suggestion mode" because it matches Visual Studio. I don't think "automatic" is any more meaningful - what's more automatic about it?
Comment 11 Mike Krüger 2013-07-31 12:20:00 UTC
It's not two setting doing the same - one chooses the default setting and one just toggles it. That's different. 

I know that suggestion mode is the vs.net terminology - but it's not very good IMO.
Comment 12 Mikayla Hutchinson [MSFT] 2013-07-31 12:38:46 UTC
Well, "suggestion mode" is meaningful, even if it's not obvious. In suggestion mode, the IDE suggests possible completions, but they're only suggestions - you're free to accept or ignore them. And it does help that it matches the VS terminology, and is distinctive enough to be searchable.

I really don't like the term "automatic completion" because it doesn't really mean anything in this context, so it's confusing. Does unchecking the option mean that completion isn't automatically shown?

I would suggest renaming the option to something very clear such as "Commit completion list selection on whitespace and punctuation", and renaming the command back to "Toggle Suggestion Mode" until we come up with something better.

Also, unrelated, but what's with the "Behavior" heading in the middle of the options panel? :)
Comment 13 Mike Krüger 2013-07-31 12:52:15 UTC
I checked VS.NET and I reverted the commit - I don't see an option for defaulting to 'suggestion mode'.

I think adding an option for the commit characters may be the best solution to that - leaving the bug open until then.
Comment 14 David Jeske 2013-08-01 17:15:11 UTC
Yes, VS provides this feature by offering explicit control over "commit characters".  I think this is a fine solution, and I look forward to seeing it show up in Xamarin.

@Hutchinson - the confusion I think exists in the current Xamarin setup is:

(1) "Toggle Suggestion Mode" - does not actually toggle whether suggestions are made, it toggles whether punctuation automatically triggers the completion of those suggestions.

(2) "Enable Code Completion" - does not actually toggle whether code is completed, it toggles whether code-completion-suggestions are made.

(3) When trying to stop completion from mucking with what I'm typing, the obvious place to "fix" this is in preferences for code-completion, because that is where it can be fixed in every other IDE. Currently, this isn't possible, because the only way to keep suggestions active but stop auto-commit is to "Toggle Suggestion Mode" (which actually toggles auto-complete) from the menu. 

(4) As far as I can see, there is no way to force the the code completion to always stay in "suggest only never auto-commit" mode through restarts and new projects. Though this is a small issue and not that big of a deal.
Comment 15 Mikayla Hutchinson [MSFT] 2013-08-02 14:12:51 UTC
0. We won't be adding explicit control over commit characters - we're trying to remove unnecessary and overly complex options, not add more.

1.  The code completion list can work in "completion mode" (it tries to complete things) and "suggestion mode" (it makes suggestions). The toggles switches between these modes.

The reason suggestion mode is a command is that there are legitimate uses for quickly toggling it back and forth. If you're using completion mode, then it's very difficult to write code using symbols that don't exist, so you can toggle it into suggestion mode, write your code, toggle it back and use context actions to create the nonexistent members.

For an explanation of suggestion mode, see:
http://blogs.msdn.com/b/zainnab/archive/2010/01/22/intellisense-suggestion-mode-vstipedit0012.aspx
http://mjhutchinson.com/journal/2011/02/monodevelop_tips_suggestion_mode

2.  We'll be removing the "Enable Code Completion" option entirely, there's no good reason to disable it.

3. Yes, discoverability is an issue. Maybe we should have an option in preferences that toggles the same suggestion mode setting controlled by the menu command, with a label explaining the difference between suggestion and completion mode.

4. That's a bug, the setting should be persisted.
Comment 16 David Jeske 2013-08-02 16:35:08 UTC
"3" and "4" sound like great improvements.

I'm well aware of the annoyances of completion mode. I want it off always. double-always. I never want completion mode. I want to turn it off and have it actually stay off. I look forward to #4 being fixed so it stays off forever. Right now I feel like I fight with Xamarin constantly because it's always ending up in completion mode.

BTW, thanks for Xamarin... it's a friggin awesome product. All the beauty of Xcode with all the usability of VS and C#. Keep it up folks!
Comment 17 Mike Krüger 2013-08-02 16:49:11 UTC
We have #4 because many users activated the suggestion mode without knowing it and  I got bug reports about that. 

The suggestion mode is very unusual for most people. Maybe we should add the keyboard option - I don't think it's that much of a problem adding it - but I need more opinions ;)
Comment 18 Mikayla Hutchinson [MSFT] 2013-08-02 17:18:02 UTC
Maybe we could just remove the keybinding so it's not so easy to turn on/off by accident :)
Comment 19 David Jeske 2013-08-02 18:39:44 UTC
The VS solution (user-configurable commit-keys in preferences) is looking better all the time.

I think some VS users also like to trim the punctuation list down to just "." and "(" . Personally I remove all keys from it, as another way to disable the completion.
Comment 20 David Jeske 2013-08-02 18:55:36 UTC
I still maintain part of the confusion is inconsistency of terms. 

For example, Hutchinson's description of "completion mode" and "suggestion mode" above as two different things does not match the wording in the preferences panel where it talks about "enable code completion", and "show completion list", which must be on to access "suggestion mode". Which means the word "completion" is being overloaded to mean two different things here.

VS avoids this problem, because they don't use the terms "suggestion" and "completion".. they use the terms "completion" and "commit". Their settings are:

[ ] Show completion list after a character is typed
Selection in Completion List Committed by typing the following characters:
[ ...... ]
[ ] Committed by pressing the space bar

If you want to stick with suggestions and completion, I think it would be more clear as:

suggestions - always means bringing up the dialog but never changing the text (since it is suggestion not a completion)
completion - always means actually changing the text with a completion

By this rule, the preferences would change to:

[ ] enable code suggestions   (which could disappear)
[ ] show suggestion list after a character is typed
[ ] complete code expressions on punctuation (or the following characters [...])

The last item could be also toggled by a menu item "Toggle code completion".
Comment 21 Mike Krüger 2013-08-05 06:53:45 UTC
I've implemented an option panel to give control over the trigger char - per language.

Other changes:

- I removed the 'turn off completion/parameter info' option - I don't think they're required

- Completion suggestion mode is now persistent - but I removed the keyboard shortcut. I think that may be the best solution.

There are reasons for providing control over the completion chars - at least the completion extensions must be able to give commit chars to the completion window. Therefore we need such a mechanism anyways.
Comment 22 Mikayla Hutchinson [MSFT] 2013-08-05 13:13:54 UTC
We added a complete option panel for an incredibly granular option that has only ever been requested a couple of times?

I thought we were trying to make the options easier to understand, not harder.
Comment 23 Mike Krüger 2013-08-05 13:18:11 UTC
If we kill something - then the suggestion mode. 

I don't think that the completion characters are "hard" to understand (at least not as hard as the suggestion mode - I couldn't find that in vs2013 anymore btw).
Comment 24 Mike Krüger 2013-08-05 13:37:49 UTC
ok I disabled the completion characters option again.

Seems that we want to have 'fewer' options because they're better. But it's still a good thing that the completion engines can now alter the commit chars no their own.
Comment 25 Mikayla Hutchinson [MSFT] 2013-08-05 14:26:11 UTC
The completion characters are overly granular. There are two common use cases, which are covered by completion mode (eager commit) and suggestion mode (explicit commit). We should have an option for *that*, not make users figure out which characters they need to set.

I don't have VS2013 installed but the docs still say that the setting's in "Edit, IntelliSense, Toggle Completion Mode".

I propose:

1) start calling completion mode "eager completion mode" to make it clearer
2) remove the overly granular control over completion characters
3) add an option "use eager code completion mode", on by default
4) put a second line of smaller text on the option explaining what it means - "Commit completion list selection on whitespace and punctuation" - see iOS build options for an example of this smaller text
5) rename the command to "toggle eager completion mode"
6) make the command toggle the option, for consistency
7) remove the keybinding from the command, so people don't keep on activating it accidentally
8) remove the command from the menu
Comment 26 Mikayla Hutchinson [MSFT] 2013-08-05 14:27:03 UTC
Yes, it makes sense to allow the "eager" characters to be set by the completion engine as they may be language specific.

Thoughts on my proposal?
Comment 27 Mike Krüger 2013-08-05 15:08:51 UTC
hm, r# seems to break the suggestion mode. 

Suggestion mode is not the thing the user that don't like commit on space want. Use case: 

caret down -> suggestion mode turns off -> space ‐> complete

it's a bit different behavior for a different problem that can be used for the non intrusive completion.

I removed 2) already. Making an option out of it may work - I need to think about it. 

If VS.NET used the term suggestion mode it's ok to use it I think.
Comment 28 endasil 2014-10-16 11:02:14 UTC
Over one year has passed and it is still not possible to avoid automessup when pressing "." and only complete when i want it (by pressing tab / enter that are not used when typing normal text)? :(
Comment 29 Mike Krüger 2014-10-16 11:24:58 UTC
I made a dialog for that but it got removed - we decided against that.