C
C#•3mo ago
Ellopis

How to formate code in Visual Studio?

I press the button or shortcut to format Document and says it's ready, for me it's a big mess. I would like a linter for everyone who's working in the project.
No description
11 Replies
Angius
Angius•3mo ago
$prettycode
MODiX
MODiX•3mo ago
To format your code in Visual Studio, Visual Studio Code, Rider, use the following shortcut:
Visual Studio CTRL + K + D
Rider / Resharper CTRL + ALT + L
Visual Studio Code SHIFT + ALT + F
Visual Studio CTRL + K + D
Rider / Resharper CTRL + ALT + L
Visual Studio Code SHIFT + ALT + F
NOTE: the first key must be held while doing it. https://cdn.discordapp.com/attachments/569261465463160900/899513918567890944/2021-10-18_01-26-35.gif
Angius
Angius•3mo ago
C# doesn't really have that big of an ecosystem of formatters and linters You have Roslyn analyzers for linters And dotnet format for formatting And... that's basically it
Ellopis
EllopisOP•3mo ago
Thanks for replying, but... It's still not working, the only thing I see changed is the spacing between words. I use the control + k -> D, also Shift + alt + f, also the UI button, all of them have the same result. Only spacing.
No description
Ellopis
EllopisOP•3mo ago
No description
Angius
Angius•3mo ago
Weird
Ellopis
EllopisOP•3mo ago
Yup, making it unusable for me, I even prefer vscode
Angius
Angius•3mo ago
$vsdrunk maybe?
MODiX
MODiX•3mo ago
* close VS * remove the hidden folder .vs * remove all bin and obj folder next to each csproj (DO NOT TOUCH THE .git FOLDER OR WHAT'S INSIDE) * restart vs
Ellopis
EllopisOP•3mo ago
That didn't work either 😦 worst part is all the issues on the internet show vscode 😦 I'm updating it, apparently it had problems with copilot chat That was it, solved, thank you a lot Well, no, It just don't work for that specific file
Omnissiah
Omnissiah•3mo ago
there is also the code cleanup but sure a stronger formatter in vs wouldn't hurt for me
Want results from more Discord servers?
Add your server