2

I use default toggle comment line (editor.action.commentLine) to add/remove line comment (PHP).

My comments look like

// $someVar = null;

I want to change comment line format from // to // ~. Is there any way to change the default line comment format?

2
  • As a result of my research, I strongly have the opinion that you are not able to do this. But you can suggest to team developer to add this feature visualstudio.uservoice.com Commented Jan 28, 2018 at 11:58
  • 1
    Thanks, Masoud. Your links seems to be pointing to Visual Studio IDE. But I speak of Visual Studio Code. But this doesn't change the main idea of your comment. Alas, it seems, you are right. :-( Commented Jan 28, 2018 at 12:25

1 Answer 1

5

I have made an extension, Custom Language Properties, to do this. Demo:

php lineComment demo

The setting is as simple as :

  "custom-language-properties": {
    "php.comments.lineComment": "// ~"
 }

Modifying blockComments and brackets (as well as lineComments) are supported for many languages - with the ability for the user to add additional language support pretty easily.

Sign up to request clarification or add additional context in comments.

2 Comments

Would you be so kind to share the extension link? :-)
LOL, I forgot that - edited the answer to include it. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.