[Need help] Disappearing colon due to *Indent after a colon #11854
-
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 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @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. |
Beta Was this translation helpful? Give feedback.
-
@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.
} |
Beta Was this translation helpful? Give feedback.
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.