question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: `editor.autoCloseBlockComment` setting

See original GitHub issue

In language-configuration.json, block comment start and end positions can be defined. For example, for cpp, or typescript-basics:

"blockComment":["/*","*/"]

typescript-basics also has an AutoClosingPair defined for block comments (requiring an additional asterisk, though I’m not aware of the origin of that convention) :

		{
			"open": "/**",
			"close": " */",
			"notIn": [
				"string"
			]
		}

There are currently two settings, which make it possible to disable the auto-closing, for brackets and quotes: editor.autoClosingBrackets and editor.autoClosingQuotes.

It looks like editor.autoClosingBrackets also controls whether comments are auto-closed. Since there are fields in language-configuration.json to identify brackets and blockComments, it seems enabling/disabling of block comments could be done using a separate setting, rather than being lumped in with brackets.

There is not currently an autoClosingPair in cpp. I’d also like to suggest adding that, provided there is a way to disable it without disabling auto closing of brackets.

Alternatively, if there is a recommended way of implementing auto-closing of block comments that could be implemented by an extension, perhaps we could do that in the C/C++ extension and provide our own setting for it.

Ideally, C++ block comment closing would not require the second asterisks (required in typescript* and the closing */ could be typed over. (see: https://github.com/microsoft/vscode/issues/54499 ).

https://github.com/microsoft/vscode/issues/1966 is related.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Colengmscommented, Jul 14, 2022

Hi @hediet . The advantage of adding a new autoCloseBlockComment setting would just be to allow the user to separately enable/disable auto-closing of comments, such as :

/* -> /**/

… without having to alter whether auto-closing of brackets is enabled/disabled (w/autoClosingBrackets) :

[ -> [] ( -> ()

There are already separate settings for enabling/disabling auto-closing of brackets vs. quotes. I’m just requesting that auto-closing of comments should have its own setting, instead of being controlled by the same setting that control auto-closing of brackets. (I pointed out in the original post that there is already sufficient information to separately identify which entries in the autoClosingPairs list are comments.)

We’re considering adding auto-closing support for block comments in the C/C++ Extension. That is not currently configured in the built-in cpp language extension. If we add it there, it would be nice to be able to enable/disable it independently.

2reactions
happyTonakaicommented, Oct 8, 2022

Any updates? I really need an autoclosing for /* */

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature Request] Custom Settings Page (Editor Access)
My feature request is that if a custom settings page could be made where the capability is lower than manage_options or is filterable...
Read more >
Feature Request: Syntax highlighting in the editor
Please add the ability to add a code block via the rich text editor that offers syntax highlighting. See example image below.
Read more >
Customizing Feature Request List Columns in Savio
You can also edit the name of each column. To do it,. 1. Click your name in the top right corner and select...
Read more >
Additional Features on Editor X
The Wix Support Center has everything you need to help you create a free website. Learn more about Additional Features on Editor X...
Read more >
Feature Requests
A list of our known feature requests. ... Feature Request: Duplicating Sections · Feature Request: Editing Images · Feature Request: Emojis and GIFs ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found