You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Best thing is to modify the Roslyn source at Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection.CommentUncommentSelectionCommandHandler
The thing is we can do it manually in our source. But there is no generic way. That is comment of /**/ will work only for c# and not VB or TypeScript etc. But in Roslyn the interface ICommentUnCommentService, if exposed as Public interface, we can then proceed Cool and good in our code.
--> Otherwise, with current scenario, we need to define, Block Comment indicators separately for C# and VB and every other language. Its possible. But redundant (exists already in Roslyn. but all internal/private :( )
Our primary focus is C#. So it's OK if we just build a C# version first.
The current implementation is aimed at being generic, and simply uses the inbuilt generic commands for Comment/Uncomment.
However, these OOB implementations have some quirks. And they choose line comment or block comment depending on whether a part of the line is selected, or if the whole line (or nothing) is selected. So we might have to write our own implementation (or suggest changes to the OOB version) so that it will always to a line comment when we ask. (Commenting out all lines included in the selection - not just the selected text). And we can then trigger a block comment (/* */) on demmand with a modifier key.
Suggested key binding: Ctrl+Shift+/
Toggles block comments (ie. /* */) instead of line comments ("//")
The text was updated successfully, but these errors were encountered: