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
leave "[csharp]": {
"editor.acceptSuggestionOnCommitCharacter": true
}
Autocomplete should trigger on '.' or ';' etc.
It also triggers on space, making Linq statements, and intricate loop patterns absolute hell to write.
@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. https://github.com/OmniSharp/omnisharp-vscode/issues/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?
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.
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.
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?
Most helpful comment
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(restit 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.