Skip to content

Allow multi-line comment auto-closing for C++ files#73841

Merged
alexr00 merged 2 commits intomicrosoft:masterfrom
Daniel-McCarthy:Auto-Completing-MutiLine-Comments-For-CPP
May 21, 2019
Merged

Allow multi-line comment auto-closing for C++ files#73841
alexr00 merged 2 commits intomicrosoft:masterfrom
Daniel-McCarthy:Auto-Completing-MutiLine-Comments-For-CPP

Conversation

@Daniel-McCarthy
Copy link
Contributor


Fixes #72801.


Summary:
It has been suggested to add support for auto-closing a multi-line comment pair (/* */) when typing in a C++ language file. It is now possible to simply type /* in a .cpp file and it will auto-complete to /* */.


Demonstration of C++ comment auto-completion.

Adds support for auto-closing a multi-line comment pair when typing in a C++ language file.

This is for quicker comment creation and is already done for every other character pairings. However, was never added for multi-line comments until now.
@alexr00 alexr00 self-requested a review May 16, 2019 21:53
@alexr00 alexr00 self-assigned this May 16, 2019
@alexr00 alexr00 added this to the May 2019 milestone May 16, 2019
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] }
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "/*", "close": " */", "notIn": ["string"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, but can you add "comment" to the notIn too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! Thanks for the feedback, I will do this now.

In feedback it was suggested to make sure that multiline comments don't autocomplete in comments in addition to strings.
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@alexr00 alexr00 merged commit 728c6a6 into microsoft:master May 21, 2019
@Daniel-McCarthy Daniel-McCarthy deleted the Auto-Completing-MutiLine-Comments-For-CPP branch May 26, 2019 16:56
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cpp] support cpp block comment as an auto-closing pair

3 participants