Skip to content

Enable auto-close of multi-line comments in cpp#160357

Merged
aeschli merged 2 commits intomicrosoft:mainfrom
Colengms:main
Sep 26, 2022
Merged

Enable auto-close of multi-line comments in cpp#160357
aeschli merged 2 commits intomicrosoft:mainfrom
Colengms:main

Conversation

@Colengms
Copy link
Contributor

@Colengms Colengms commented Sep 7, 2022

Related to: #154994

Ideally, we'd also like to be able to enable/disable auto-closing of comments separately from brackets ( #154994 ). That also could soften the impact of this change on existing cpp users.

It's unclear to me why TypeScript uses /** and */. In this case, for C++, we'd like to use /* and */ to match the behavior of VS.

One of the motivations for this change is to enable automatic insertion of doxygen comments (a feature in cpptools), when using a multi-line comment style for them. As currently implemented, this fails as it implicitly turn the rest of the file into a comment before the correct doxygen contents can be determined. This solution, of allowing the auto-closing to occur first, is the same solution used by VS.

@aeschli
Copy link
Contributor

aeschli commented Sep 8, 2022

#77008 has led to the removal of /* as auto closing pair.

I personally agree that we should add them back as IMO the benefits outweigh the drawback. The main benefit s that this avoids to comment out the full file, causing folding ranges, outline, syntax highlighting flickering.

@alexr00 Any objections?

@alexr00
Copy link
Member

alexr00 commented Sep 8, 2022

No objections.

@aeschli aeschli added this to the September 2022 milestone Sep 8, 2022
@aeschli aeschli added verification-needed Verification of issue is requested languages-basic Basic language support issues feature-request Request for new features or functionality and removed triage-needed labels Sep 8, 2022
@aeschli aeschli merged commit 3378708 into microsoft:main Sep 26, 2022
sean-mcmanus added a commit to sean-mcmanus/vscode that referenced this pull request Oct 10, 2022
1. View->Toggle Developer Console shows

Bug: Errors parsing ...AppData/Local/Programs/Microsoft%20VS%20Code%20Insiders/resources/app/extensions/cpp/language-configuration.json: [379, 1] Comma expected
_readConfigFile @ workbench.desktop.main.js:2140

NOTE: Follow up to microsoft#160357
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature-request Request for new features or functionality languages-basic Basic language support issues verification-needed Verification of issue is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants