Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space is a commit character #1524

Closed
rasmus91 opened this issue May 29, 2017 · 4 comments
Closed

Space is a commit character #1524

rasmus91 opened this issue May 29, 2017 · 4 comments

Comments

@rasmus91
Copy link

rasmus91 commented May 29, 2017

Environment data

dotnet --info output:.NET Command Line Tools (1.0.3)

Product Information:
 Version:            1.0.3
 Commit SHA-1 hash:  37224c9917

Runtime Environment:
 OS Name:     elementary
 OS Version:  0.4.1
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.3
VS Code version: 1.12.2
C# Extension version: 1.10

Steps to reproduce

leave "[csharp]": { "editor.acceptSuggestionOnCommitCharacter": true }

Expected behavior

Autocomplete should trigger on '.' or ';' etc.

Actual behavior

It also triggers on space, making Linq statements, and intricate loop patterns absolute hell to write.

@DustinCampbell
Copy link
Member

@rasmus91: It is by design that autocomplete commits when SPACE is typed, as it does in Visual Studio. It shouldn't trigger on space, just commit the selected item in the completion item.

I tried typing a few LINQ expressions and couldn't reproduce any typing issues with the setting you mentioned above. #1521 was also filed which reveals a problem specific to for-loops. Is that the same problem you're seeing? If not, could you provide more specific repro steps?

@rasmus91
Copy link
Author

rasmus91 commented Jun 2, 2017

Sure.

Lets say I'm doing something like a linq statement. The Code should be the following:

var resourceType = Router.ResourceTypes.Include(rest => rest.Resources).ThenInclude(res => res.Reservations);

var reservationIds = resourceType.Resources.Select(res => res.Reservations).Select(reserv => reserv.ReservationId);

The problem here would be that as i type: var resourceType = Router.ResourceTypes.Include(rest it will have highlighted ResourceType as a suggestion, and when i press space, wishing to leave it at "rest", it will autocomplete it to ResourceType, which was not at all desired. I don't understand why i would want this behaviour, If i wanted it to complete it, and then call a function, forexample i would use '.' or ';' for end of line or '(' etc. space however is just annoying, particularly because i can't just disabled autocomplete on space, then it's on ALL commitcharacters.

Well as far as i can tell. And I can't tell that that should be desirable behaviour.

@DustinCampbell
Copy link
Member

Great repro, thanks! In Visual Studio we add a bit of magic in cases like these to ensure that space doesn't commit in exactly these cases (namely, those cases where a lambda expression can be typed). I'll take a look.

@Stuey2
Copy link

Stuey2 commented Jun 23, 2017

I haven't had occasion to use the fix outlined in #1548 as it's still in preview. Using the 'space key' for autocomplete is a personal bug-bear.

Sure, in this case makes it hell to code in lambdas. Also though, it makes it hell to pre-code a section where variables, fields etc. haven't yet been defined. This is my preferred way to code, do the implementation and then define what's needed afterwards, similar to what Resharper allows for.

Does the fix allow an option to disable the 'space key' or better yet, to select a list of autocomplete keys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants