How do I stop VS2017 from auto-replacing _inline_ tabs with spaces? - c#

I have Visual Studio 2017 for C# (Express and Community) and I am trying to add some inline comments to my class attributes for Doxygen. Between my declaration and my comment I wish to have tabs to align my comments properly. VS however replaces those tabs with spaces every time I hit the autoformat keys Ctrl-K Ctrl-D. It doesn't help to set "Keep tabs" under "Tools/Options/Text Editor/C#/Tabs". VS doesn't keep those tabs anyway. I didn't find anything under "C#/Code Style/Formatting" either.
Is there anyway to prevent autoformat from replacing my tabs?
I already tried asking on MSDN, but everything they told my to try out didn't help, see here.

Related

Visual Studio 2019 Remove Virtual Vertical Added Blank Lines

When I was previously using Visual Studio 2017 -- I didn't have these inserted virtual vertical lines in my code.
They are slightly bothering me, and I would like to get rid of them.
how do I do so?
Picture above shows this blank space that gets inserted by VS. I've tried googling / looking through Text Editor settings, but I cannot find it.
This is a CodeLens option. To toggle on/off, go Tools > Options > Text Editor > All Languages:
FWIW, though the lines may be blank right now, I've found them pretty useful in tracing dependencies, seeing last/most recent changes to a particular method, etc. You might get used to it, once those (now empty) lines start showing you valuable details.

Visual Studio Code Order In AutoCompletion

I recently switched to Visual Studio Code and I love it! It starts so quickly andI just enjoy the open source environment more than Visual Studio. But there's one problem that I have encountered that bothers me more than it should.
Before I could if I wanted to autocomplete the syntax for an if statement I'd just be able to type in "if" and touble tap tab, but now the autocompletion IntelliSense things pop up in the wrong order:
The red box is the wrong one that gets displayed first and the green box is the one I want at the top. My question is if there's a way to configure it so that I get that statement at the top. It's the same with for-loops, foreach-loops and pretty much every other autocompletion that I want to use.
Create snippet (or edit) ctrl+shift+p Preferences: Configure User Snippets
settings (ctrl+,)
"editor.snippetSuggestions": "top",

C# Formatting Settings for Visual Studio 2013 Have No Effect

I am trying to make VS 2013 stop putting my opening braces on new lines when the code block is not a type. I've gone to Tools -> Options -> Text Editor -> C# -> Formatting -> New Lines and unchecked everything except new lines for types, query expression clauses, and the keyword options.
I hit "OK", and VS STILL keeps putting ALL my opening braces on new lines every time I finish a statement or block or otherwise trigger an auto format. I've even tried restarting VS. No luck.
The settings SAY that they are set to what I wanted, but Visual Studio refuses to obey them. EXTREMELY frustrating. Can anyone help?
Thanks to Lucas Trzesniewski in the question comments, the problem has been found and solved: ReSharper.
I'm working on a machine that another dev was using before me. They installed ReSharper into Visual Studio, which overrides VS's settings with its own. I didn't even know that ReSharper existed--hence my confusion.
For anyone else who didn't know about ReSharper, here's how to set up your opening brace formatting:
Go to Tools -> Options. In the collapsible lists on the left, go to ReSharperPlatformVs12 -> General and click the Options... button that appears on the right.
There will be another set of collapsible lists on the left of the window that pops up. In these, go to C# -> Formatting Style -> Braces Layout.
On the right side, you should find a set of options in a collapsible "Braces Layout" list, each with a drop-down full of all the many ways you can make it treat opening braces for that option. Go ham and set them how you wish :D

How to get Xcode style autocomplete in Visual Studio?

I've used both Xcode and Visual Studio extensively over the past year, and the one thing I miss about Xcode when using VS is the autocompletion suggestions while typing in the middle of words. Let me explain:
In Xcode, autocomplete suggestions (the little dropdown that appears as you begin to type) work from any point in the word. So lets say you start typing something, click somewhere else, then get back to what you were typing; Xcode will happily keep giving you autocomplete suggestions. If you do this in VS, you'll find that autocomplete suggestions don't appear. You have to delete what you typed and start over again. If you were typing a method, you have to erase up to and including the dot, re-type the dot, and only then do you get the suggestions. This is very annoying when going from Xcode to VS. Is there any way to enable Xcode style autocomplete suggestions in VS? I've googled but all I've come up with are plugins like Visual Assist X, which are not free and have a bunch of other features I'm not sure I absolutely need. I'd like something that would solve this specific issue, preferably free.
Isn't ctrl + spacebar doing the trick? It enables autocomplete when used.
There might be something more advanced you are after tho.

How do I get Visual Studio Express 2013 to add a closing tag in XAML

The question has been asked (sort of) here
Make Visual Studio 2013 use Self-Closing Tags for XAML
but not really answered.
When I type in say StackPanel, I can't seem to get the UI to complete the closing tag.
Is there a command or keyboard sequence to do this?
Thanks in advance.
I found the solution myself.
Type in the less-than sign (<) and hit enter.
There is also an option in the settings. Just search for tag in the settings and then Texteditor -> textspecific options(button). There you can set your default.

Categories

Resources