[Need help] Disappearing colon due to *Indent after a colon #11854
Answered
by
bobbrow
ullas kunder (ullaskunder3)
asked this question in
Q&A
|
I am experiencing an issue in the C++ language mode where, when I enter a colon : and then press Enter for a new line, the colon disappears it will work if I use space after colon . This behavior is unexpected using: C/C++ v1.18.5 Microsoft Extension
record.from.2024-01-10.12-40-27.mp4 |
Answered by
bobbrow
Jan 11, 2024
Replies: 2 comments 4 replies
|
Hi ullas kunder (@ullaskunder3), Did you add that global snippet, or do you have an extension installed that added it? The C++ extension does not add that snippet so this issue appears to be specific to how your instance of VS Code is configured. |
3 replies
|
Bob Brown (@bobbrow) how to configure new line indentation after a colon for C++ example class Apple {
public:
// Cursor here after pressing Enter, I want the indentation on the next line to be aligned with the colon above.
} |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Those are your settings, but what we need to look for is your global user snippets. Try running the "Snippets: Configure User Snippets" command in VS Code. It should show you whether you have a global snippets file for your installation or any of the languages already. Pick one of those files and look for the snippet called "Indent after a colon".
I suspect this is related to Python, do you have any Python extensions installed? If this advice doesn't help you locate the issue, you might want to try asking some folks over in the Python extension.