The title.
It's in Visual Studio > settings > text editor > c# > advanced > comments.
(Hint: It does not add // when writing comments.)
CodePudding user response:
What this feature is supposed to toggle is while editing a single-line comment, if you insert a newline in the middle, the next line (with remaining text) will continue the comment. For example, inserting a newline at the | in // foo|bar
becomes
// foo
// bar
Without this, it would be
// foo
bar
The Split String Literals option that @StriplingWarrior mentioned in the comments is similar but specific to strings. "foo|bar"
becomes
"foo"
"bar"
As for why the option doesn't do anything, StriplingWarrior was also spot on. The code for this is in the Roslyn repository on GitHub, so:
- the option is bound to the same setting storage as Split Strings
- the feature implementation does use its own setting (it's not meant to be shared)
- the setting defaults to true if not set otherwise (so you'll always see that behavior), and per the above misbinding, there's no way to set it to false.
TL;DR: it's a handy feature, and there's a bug that you can't turn it off.
edit: issue opened here