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
18.9k stars 4.01k forks source link

In FolderView : Comment Out Selected Lines Does Not Work #27965

Open vsfeedback opened 6 years ago

vsfeedback commented 6 years ago

In both C# and VB.NET, I cannot comment out selected lines, either by keyboard shortcut (Ctrl+K, Ctrl+C) or by menu button/command. I also cannot format the document, again either by keyboard shortcut (Ctrl+K, Ctrl+D) or by menu button/command.

I am running Visual Studio Enterprise 2017 15.1 (26403.3) on an x64 machine, Windows 10 1703 (15063.138).

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/43554/comment-out-selected-lines-does-not-work.html VSTS ticketId: 418523 These are the original issue comments:

Skyler Sedate on 4/12/2017, 00:32 PM (432 days ago):

I realize now that I was in "Folder View", even though I had the code file open and was editing it. Once I opened the solution, everything started working as expected. Not sure if this is a bug, or a feature.

Visual Studio Team on 4/14/2017, 02:28 PM (429 days ago): Thank you for your feedback! This is expected behaviour ...Designer category doesn't work very well in folder view. Adding the request in our backlog to see if we can improve the experience.

rymorris [MSFT] on 5/7/2018, 01:53 PM (41 days ago): Ctrl-k, Ctrl-c is not working on C# files to comment the selection. These are the original issue solutions: (no solutions)

jinujoseph commented 6 years ago

Repro steps

Actual

aguayUmbt commented 6 years ago

I've got the same problem : I can't comment or uncomment code or format it. I'm working with a web app .net core 2.0, and sometimes when i'm working inside of views my comment function stop working. however when i'm in a controller or a model it seems it's always fine, I've got no problem at all. On this picture I can format or comment image But on the second I can't, note the line that disapear.. image this is Jquery code in cshtml view

jtpolizzi commented 6 years ago

I have a similar issue - but with C#. The comment / uncomment shortcut keys (or when selected from the menu) don't work in C# - but they DO work with typescript, SQL, etc.

Also - Format Document doesn't work

CyrusNajmabadi commented 6 years ago

FormatDocument would potentially be hard to provide (unless you have a .editorconfig), because it's not clear what formatting options should be used. Comment/Uncomment should be allowed though.

CyrusNajmabadi commented 6 years ago

@jinujoseph I don't repro this myself. Even when i open a C# file from "Open Folder" i.e.:

image

I'm still able to comment/uncomment selected lines.

aguayUmbt commented 6 years ago

I've always open my project with Open --> folder I don't think it matters

mayoevelyn commented 4 years ago

This is still an issue. Oddly, in 'Quick Actions' window, I can see that my code is commented! Just not in the real code.

nevsaynev commented 3 years ago

I'm seeing the same issue of today 2020/10/19. Any suggestion on how to recover?

GalGreenfield commented 2 years ago

Still an issue in Community Edition in 2022 for me in the editor.

phochstrasser commented 3 weeks ago

Still an issue in Community Edition in 2022 for me in the editor.

Same for me, enterprise version.