Skip to content

Feature Request: editor.autoCloseBlockComment setting #154994

@Colengms

Description

@Colengms

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: #54499 ).

#1966 is related.

Metadata

Metadata

Assignees

Labels

editor-autoclosingEditor automatic closing of parens / brackets / etc.feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions