dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.02k stars 4.03k forks source link

Auto completing quotation mark is not working when using CW code snippet #24376

Open vsfeedback opened 6 years ago

vsfeedback commented 6 years ago

If you use the CW code snippet for Console.WriteLine() then you can't auto complete the quoatation mark for the literal string.

If you instead manually type in Console, dot, WriteLine() and type the first quotation mark, then it gets auto completed.

Snippet

No Snippet

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/185760/auto-completing-quotation-mark-is-not-working-when.html VSTS ticketId: 555040 These are the original issue comments: (no comments) These are the original issue solutions: (no solutions)

samirgunic commented 6 years ago

As I recall it, this bug did not exist in Visual Studio 2013 nor in Visual Studio 2015.

Pilchie commented 6 years ago

I expect the bug did exist in at least VS2015.

Autocompleting braces/quote/etc only works if:

  1. The insertion of the first quote is the last non-whitespace thing on the line, OR
  2. All other things after it on the line are closing quotes/parens/braces that were inserted by the feature and are currently being tracked (for tab to pass through) for example.

There is nothing that ties the snippet insertion with the feature, so the mere fact that the snippet has more characters after the cursor is what triggers this.

samirgunic commented 6 years ago

I can confirm that it does exist in Visual Studio 2015, Update 3.

SneakyAzWhat commented 4 years ago

I am also experiencing this problem when using the CW code snippet as well. I am currently using Visual Studio Community 2019, Version 16.7.3

samirgunic commented 4 years ago

For what it's worth, it works in VS Code (version 1.49.0).

(Tested and still not working in Visual Studio Community 2019, version 16.7.4.)

saratpc commented 4 years ago

Visual Studio 2019 Enterprise Edition. cw snippet does not autocomplete quotes. Please fix.