-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically move { opening braces down to a new line when pressing enter #6834
Comments
I cant believe this is still an issue in 2024. |
I can't believe that such a problem exists at all. |
I can't believe that such a problem exists for 7 years without a fix. |
Anyone got a solution by any chance it triggers me alot... |
@ryzngard can we please mark this as a feature request as well? |
Thanks for the ping @achobanov , idk why this wasn't marked as untriaged :/ . Updated the labels |
Bruh why. This is annoying that this exists. I was wondering why my brackets weren't going on a new line. I'm pretty sure brackets on new lines is supposed to be a csharp code formatting standard. |
There seems to be some similarities between this issue and dotnet/razor#11266, though the other issue is specifically VS and this is for VS Code. |
I’m genuinely astonished that this is an issue. How is this even possible? This is a fundamental aspect of the C# standard, and yet even Microsoft, who established this standard, has introduced a bug like this. It’s baffling. With problems like this, I can’t understand how anyone could rely on VS Code for C# development. |
We're almost at the 1 year anniversary of this now. Any idea from people in the know if this could become a thing? @achobanov @ryzngard. Appreciate your efforts in responding in the first place. |
Enables format on type when the trigger character is a newline. Removes text changes that contain the cursor as we do not want to remove the indentation. https://github.com/user-attachments/assets/962f8229-f41b-4632-a8e9-b7660575e448 Resolves dotnet/vscode-csharp#6834
A change to format on type has been made to the Roslyn LSP. It will flow into the C# extension later this week and be part of a future pre-release. Do note that format on type will need to be enabled. |
Hi all,
I've come across other older issues raised to have opening braces such as { automatically move down to the new line once enter is pressed and the cursor is inside the brace.
As far as I'm aware these were made before the more modern C# extension was created and are issues with the older Omnisharp LSP.
Describe the solution you would like
A setting for the VSCode C# Extension that allows for automatic moving of opening braces { to a newline.
This is the way it works in other C# editors like Visual Studio and Rider.
Applicable Scenarios
In what scenarios would the feature apply?
Currently:
Results in the following after pressing enter:
Proposed { setting enabled would result in the following after pressing enter:
Describe alternatives you've considered
The extension C# Curly Formatter achieves this but it should be a simple included option in the C# extension. This extension also has some issues conflicting with other extension such as Vim.
The text was updated successfully, but these errors were encountered: