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

Use block comment for every line if line comments are not supported by language #35464

Closed
myskov opened this issue Oct 1, 2017 · 5 comments
Closed
Assignees
Labels
editor-contrib Editor collection of extras *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality

Comments

@myskov
Copy link

myskov commented Oct 1, 2017

There are some languages which don't support line comments: xml, html, ml, maybe more. In case of such languages VSCode uses block comments, when user invokes editor.action.addCommentLine or editor.action.commentLine.

When I select some code and toggle line comment, I expect this:

linecomment

But, in fact, I got this:

blockcomment

I think it would be better to implement following behaviour: if line comment is not specified by extension and user invokes line comment command - use block comment for every line

@vscodebot vscodebot bot added editor editor-contrib Editor collection of extras labels Oct 1, 2017
@alexdima alexdima self-assigned this Oct 26, 2017
@rebornix
Copy link
Member

Thanks for the issue, it's pretty inspiring. We see Line Comment as something you add to any position in the line and the content from that position till the end will be commented out. HTML/XML only have block comments, so we do block comments around selection.

First of all it's a good extension candidate, with which you can run a command to toggle block comments on each line inside the selection. A good feature request as well.

@rebornix rebornix added *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality labels Nov 16, 2017
@alexdima alexdima removed their assignment Nov 16, 2017
@Gruntfuggly
Copy link

I wrote an extension to toggle block and line comments dependent on the selection. I've updated it to do block comments on each line as per this issue, as it seemed relevant. Hopefully it does what you need.
https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.bettercomment

@cairin
Copy link

cairin commented Feb 26, 2018

Would it not be easier to have a setting to disable block comments altogether?

@batisteo
Copy link

Would it be possible in the language-configuration that lineComment could accept a CharacterPair as well?

@egamma
Copy link
Member

egamma commented Sep 11, 2018

Thanks to @Gruntfuggly this is now covered by an extension. Closing the issue.

@egamma egamma closed this as completed Sep 11, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-contrib Editor collection of extras *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

7 participants