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

Add editor command: Toggle Block Comment #9

Open
justcla opened this issue Jun 30, 2016 · 3 comments
Open

Add editor command: Toggle Block Comment #9

justcla opened this issue Jun 30, 2016 · 3 comments
Assignees

Comments

@justcla
Copy link
Owner

justcla commented Jun 30, 2016

Suggested key binding: Ctrl+Shift+/

Toggles block comments (ie. /* */) instead of line comments ("//")

@aakash-1906 aakash-1906 self-assigned this Jul 20, 2016
@aakash-1906
Copy link
Collaborator

  1. Best thing is to modify the Roslyn source at Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection.CommentUncommentSelectionCommandHandler
  2. 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 :( )

@justcla
Copy link
Owner Author

justcla commented Jul 21, 2016

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.

@aakash-1906
Copy link
Collaborator

Thanks Justin. I shall work on this today/tonight

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

No branches or pull requests

2 participants