Open sr229 opened 7 years ago
Hi! Thanks for reporting this issue. We'd definitely like to improve formatting in these particular cases to better match Visual Studio's behavior. Note that you can press Alt+Shift+F to format the current document, which should force the proper formatting.
I have the same issue. Upon forcing formatting it works and using formatOnSave it also works. But not using formatOnType. I find myself saving every block or manually fixing it.
@akshita31 Can you take a look at this one too?
Any new solution for this problem? Still have it with 1.19.
I've got this issue also. Only thing that works for me is format on save. Paste doesn't even format. This affects all formatting extensions not just the C# one.
This small thing is making me considering going back to VS
Any updates on this?
Would like to voice my support for this. That's one of the few things keeping me from going permanent VS Code for C# development.
Looks like this is slated for 1.18 so we finally might see this in that release.
I am on omnisharp 1.22.1 over vscode 1.46.0 and still seeing this issue. I don't like to be rude but the frustration is unbelievable over such a simple function.
I understand the frustration but this is blocked by an issue in VS Code https://github.com/Microsoft/vscode/issues/40235
Thanks filipw. It is really sad that such a simple bug is taking them this long to respond.
and instead they're trying to figure out how to replace the term master with something that won't offend people of color, and any other similar derogatory terms that have nothing to do with their history in the context of programming but oh well, variable and project names are more important than functionality ---- On Wed, 17 Jun 2020 13:12:32 -0500 notifications@github.com wrote ---- Thanks filipw. It is really sad that such a simple bug is taking them this long to respond.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
To be fair to the VS code team, no one is giving them any feedback that it is important. If you're interested in getting this resolved, please follow up on the VS Code blocking issue - https://github.com/microsoft/vscode/issues/40235
I suggest leaving politics out of this @binn. This does not concern OmniSharp in any way at all.
@vcipriani I asked for an update on microsoft/vscode#40235 - is this the only blocker for this feature?
I'm still experiencing this issue. Is there any fix or workaround?
For anyone seeing this in the future. I've found a workaround to automatically place braces on a new line by using keybindgs
and snippets
. Adding the following to your keybinding.json
config should do the trick:
{
"key": "Shift+[",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "\n{\t$0\n}"
}
}
This is not a perfect solution, as it jumps the line when you type {
instead of waiting for you to hit enter
, but it's been working quite nicely for me since the combo { + enter
does exactly what you would expect in other IDEs like VS (you'll have an open brace in new line, and your cursor in the middle of both braces)
how is this still an issue 5 years later, puts me off using vscode for c# dev
how is this still an issue 5 years later, puts me off using vscode for c# dev
I don't write C#, but I have wrote Java, C & C++ in the past, and used VSCode, VS 2019/2022 & IntelliJ/CLion and I can say that VS Code has got better, but all of them had a better experience when using a TRUE
IDE. Currently I write TypeScript as the primary language for professional projects, and I run it not in the frontend, but with a V8 Runtime, (Node or Deno), and I can say this, VS Code is unrivaled when it comes to web-technologies. Traditional software languages though, your going to get issues like this.
I am STILL experiencing this issue, and 2022 has ended. Kinda ridiculous to be honest. It's very off-putting, especially on platforms like Linux where the only other option worth considering is Rider, which is expensive and heavy.
Obligatory 2023 bump. Would love to see this resolved.
Edit: Mac user btw. Can't use visual studio, because the latency in intellisense makes it unusable, as it blocks my input, and I end up constantly waiting a couple of seconds for the editor to catch up to what I've typed. There are other issues but this isn't the place.
I'm doing format on save for now. Best of the bad choices imo.
Any updates on this?
I found an extension that does exactly what I was after, here is the marketplace link: - https://marketplace.visualstudio.com/items?itemName=Ironcutter24.cscurlyformatter
Repost on a closed issue in https://github.com/Microsoft/vscode/issues/29314
Spotted by @binnysenpai
Apparently, the Editor only follow JavaScript-style bracket-styling for the autobracket formatting for C#/C++ files.
video link
Usually in Visual Studio, this would be autoomaticaly formatted by automatically newline the opening bracket and put the statement after the line.
And also it seems not to format automatically this type of statements
video link
Which should look like this
Environment data
dotnet --info
output:VS Code version: 1.13.1 C# Extension version: 1.10.0