Question Rebecca Johnson · Feb 6, 2024

Stopping commenting continuation in VSCode

Wondering if there's a setting in VSCode to stop continuting commenting in VSCode?

For example, if I have

//this is a comment

and press enter at the end, it will continue on the next line with

//this is a comment
//|

I would like to stop this behavior, or have it only continue with a block comment.

Is this possible in VSCode? I think it's part of the ISC extension that causes it, as it doesn't happen for other languages.

Thanks!

Product version: IRIS 2022.2

Comments

Elijah Tamarchenko · Feb 6, 2024

This doesn't fully solve the issue, but you can start/stop comments using "ctr + /". To stop commenting you would be able to press "enter" then "ctr + /", which is slightly better than having to backspace out of it.

0
David Hockenbroch · Feb 7, 2024

I don't have an answer, but I also hope someone does. // is specifically for a single-line comment, so it's odd to me that it's continued like that.

0
Alexey Maslov · Feb 8, 2024

The same behavior is with ";" comments. It seems to be a new feature of InterSystems ObjectScriptv2.12.1:
older versions acted similarly with "///" comments only.

I'm not sure that this innovation makes our life worse, while having the way to switch it off would be useful.

0
Brett Saviano · Feb 9, 2024

Thanks for your feedback! In response, I've submitted Pull Request #1311 which removes the comment-continuation feature for ObjectScript comments (it's still enabled for class description /// comments). It also adds auto-closing of C-style block comments (e.g. typing /* automatically adds */ after the cursor). You can try this out by downloading and installing the latest beta version of the vscode-objectscript extension from GitHub, which can be found here.

0
Rebecca Johnson  Feb 26, 2024 to Brett Saviano

Thanks! Tested and works great.

0