Skip to content

Comment block always auto-adds end symbol #3904

Description

@rewrking

Type: General
This started happening in one of the recent extension updates.
Let's say you want to comment out some c++ code that's already written somewhere (an extremely common use-case). Typing "/" now auto-adds "/" directly after it. This is super annoying because you have to backspace out the last 2 characters.

Describe the bug

  • OS and Version: all
  • VS Code Version: 1.36.0
  • C/C++ Extension Version: 0.24.0
  • Other extensions you installed (and if the issue persists after disabling them):
    Disabled others & confirmed it's this extension
  • A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Write any c++ code inside of a .cpp/h/hpp etc file.
  2. Type "/*" at the begging of of a line that has already been written
  3. Notice "*/" gets automatically added afterwards, but before the code, so nothing actually gets commented out

Simple example, where "|" denotes the cursor position:

/*| */void mySoonToBeCommentedFunction() {}

Expected behavior
"/*" shouldn't auto-add the end symbol of the comment block by default, should be setting controlled, and should be able to recognize when it's been entered at the start of a line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions