You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In a cpp file asterisk as first non-whitespace character on a line triggers another asterisk on new line #2072
Then hit enter at the end of the line to begin a new line. You'll get
a = a
* b;
*
This is not expected behavior in this context. This is perhaps expected when in the middle of a multiline decorated comment but not otherwise.
This does not happen in an unsaved file, a file with no extension, .txt extension etc. and does not happen if the cpptools extension is disabled and happens when it is re-enabled.
changed the title [-]In a cpp file asterisk at start of line triggers another asterisk on new line[/-][+]In a cpp file asterisk as first non-whitespace character on a line triggers another asterisk on new line[/+]on Jun 1, 2018
Sorry, I misread the repro. Because the comment continuation stuff is reg-exp based (and not multiline aware), this is actually the expected behavior for the default value. You will observe the same behavior with JavaScript and TypeScript files.
If you want to disable this behavior, you can set "C_Cpp.commentContinuationPatterns": [] in your settings file.
Thanks for looking at the report. From my (user) perspective I expect the behavior to be context aware. So, If I'm in the middle of a multiline comment (I started with /*) I expect this to happen. If I'm not, then I expect this to be disabled.
Activity
[-]In a cpp file asterisk at start of line triggers another asterisk on new line[/-][+]In a cpp file asterisk as first non-whitespace character on a line triggers another asterisk on new line[/+]sean-mcmanus commentedon Jun 1, 2018
Looks like a bug with our comment continuation patterns, i.e. /** is supposed to continue the line with *.
bobbrow commentedon Jun 1, 2018
Can you please share the value you have set for
"C_Cpp.commentContinuationPatterns"? I don't see this behavior with the default value.bobbrow commentedon Jun 1, 2018
Sorry, I misread the repro. Because the comment continuation stuff is reg-exp based (and not multiline aware), this is actually the expected behavior for the default value. You will observe the same behavior with JavaScript and TypeScript files.
If you want to disable this behavior, you can set
"C_Cpp.commentContinuationPatterns": []in your settings file.kghose commentedon Jun 1, 2018
Hi all,
Thanks for looking at the report. From my (user) perspective I expect the behavior to be context aware. So, If I'm in the middle of a multiline comment (I started with
/*) I expect this to happen. If I'm not, then I expect this to be disabled.Thanks!
bobbrow commentedon Jun 1, 2018
I agree with you, but you may need to ask the vs code team for help here since we are unfortunately limited by the reg exp support.
bobbrow commentedon Dec 5, 2019
This is being tracked by microsoft/vscode#50952