How do I make the Enter key on intellisense when typeing in VB react the same way as in C# in Visual Studio? - visual-studio

I'm using Visual Studio 2008 and I'm used to C# where when Intellisense pops up, I select what I want by hitting enter and it doesn't skip down to the next line. In VB when I hit the enter on intellisense, I jump to the next line. Does anyone know where the setting for this intellisense option might be?

Hitting the SPACEBAR or TAB key in VB does the same thing that ENTER does in C#.

I know that this doesn't really answer your question, but intellisense is designed to work so that you just push the "next" character to choose the highlighted item (such as open parenthesis, period, semi-colon, etc).

I was bothered by this behavior in VB as well. This will be fixed in the next version of Visual Studio with a new setting for enter-key behavior.
https://github.com/dotnet/roslyn/pull/11873
Corrected link: https://github.com/dotnet/roslyn/pull/11769

Related

How to prevent enter key from making new line during resharper intellisense completion

I have a lot of experience as an Intellij developer where the enter key will always insert the first auto-complete suggestion. In visual studio with resharper however, the enter key will create a new line instead of inserting the first intellisense suggestion. Can anyone suggest a way to allow the enter key to replicate the Intellij behavior? I know pressing the tab key behaves as expected by my muscle memory keeps pressing enter without me thinking about it.
Can anyone suggest a way to allow the enter key to replicate the
Intellij behavior? I know pressing the tab key behaves as expected by
my muscle memory keeps pressing enter without me thinking about it.
In your side, you have installed Resharper, so you have two ways to use Intellisense: Visual Studio Intellisense which is the default way for Visual Studio, Resharper Intellisense.
1) If you use Visual Studio Intellisense(make sure you choose Visual Studio by the top menu ReSharper-->Options-->Environment-->Intellisense-->General) and face this issue, please try this:
choose Never add new line on enter by Tools-->Options-->Text Editor-->C#(please choose the corresponding development language)-->Intellisense-->Enter Key Behavior.
2) If you use Resharper Intellisense(make sure you choose Resharper by the top menu ReSharper-->Options-->Environment-->Intellisense-->General), you will not face this issue.
Note: if you face this issue in Resharper Intellisense, l think it is the issue about some changes in Resharper Option.You can try to reset Resharper settings by Resharper-->Manage Options-->Reset all settings.
Hope it could help you.
Just a quick update for the previously posted answer as I noticed the location has changed slightly as of now. I found this option (using Visual Studio Intellisense) under:
Tools menu > Text Editor > C/C++ (or whatever language you are using) > Advanced > IntelliSense section > set Member List Commit Aggressive to True.

Prevent Visual Studio to scroll to the end of file when pressing Ctrl A (select all)

It's basically in the title.
Whenever you "select all" in the Visual Studio code editor, the editor will scroll down to the bottom of the file. Is there a way to prevent this?
I'm using Visual Studio 2008 at the moment, but this applies to all versions.
No, you cannot change this behavior.
Microsoft has been aware of this since at least VS 2010, but either doesn't think it's a bug or doesn't think it's important enough to fix.
From their response to a 2010 bug report filed on the issue:
We unfortunately do not plan to change Ctrl+A's scrolling at this
time, so we're unfortunately resolving this issue as Won't Fix for VS
2010. However, it will remain in our database to be revisited for a future release of Visual Studio.
Source: Microsoft Connect
A quick Ctrl-Z-Ctrl-Y will get you back to where you were. If you tend to do a Ctrl-S Ctrl-A Ctrl-C a lot then just get used to this whole chain instead: Ctrl-SACZY. Or, create a macro: https://msdn.microsoft.com/en-us/library/a0003t62%28v=vs.90%29.aspx
I was struggling with this myself, but the "undo" suggestion gave me an idea and I feel kinda dumb for not thinking of it earlier. Visual Studio includes "Navigate Backwards" and "Navigate Forwards" buttons (CTRL-, and CTRL+, respectively). So after you finish selecting and copying, simple click the navigate backwards button or type CTRL- and voilĂ ! you're back where you were.
I know it doesn't stop the scroll to begin with, but at least it puts your cursor back exactly where you left it!

Visual Studio surround with current line if nothing selected

I'm using the Surround With feature in Visual Studio with some custom code snippets. Is there a way to configure visual studio (or a custom surround snippet) to treat the entire line like it is selected, if there is currently no selection?
The same functionality is provided when you do a keyboard shortcut such as Ctrl+C, Ctrl+V etc. If you have no selected text, it performs the action on the entire line.
If someone still wants to answer this as far as doing this with Visual Studio's native functions, they can - However it was pointed out to me in a comment that resharper does this automatically. Which is something I did not realize. Seem's I'll be moving all my VisualStudio surround snippets over to Resharper Surround templates!

Highlight all references to X?

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.
If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.
I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.
Does anyone know of a free addin which will add this functionality?
If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.
There is an add-in for Visual Studio that will do something similar called RockScroll.
When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.
I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.
I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.
Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.
The RockScroll Addin is not available for Visual Studio 2010 and above.
As a replacement, the free "Highlight all occurrences of selected word" plugin will highlight all occurences of the selected string after a doubleclick. There is no delay as with the native vs2010 highlighter.
It is string-based, which means it works inside comments and string literals.
Microsoft published a tool that sort of does what you want.
Some of my favourite features:
Enhanced Scrollbar
Auto Brace Completion
Ctrl + Click Go To Definition
Open Containing Folder
and the list goes on.
For Visual Studio 2010 and for Visual Studio 2012

Keyword highlighting on selection in Visual Studio 2008

A little while ago I managed to get Visual Studio 2008 (C++) into a state where, if I would select a keyword (or any symbol for that matter), by either double clicking on it or highlighting it, all other instances of that symbol within the current file would become highlighted too.
This was a really useful feature.
Since then it's gone away, and I don't know how to get it back.
Please help.
#Sander - that'll be it. Thanks!
I think you've installed RockScroll. It also lights them up in the graphical scrollbar (its main feature)
I use MetalScroll, it's like RockScroll only better; it doesn't interfere with Resharper (a VS must-have) and you can set it up to only highlight if you hold down 'alt' when you double-click.
There is something called "WordLight" by Mikhail Nasyrov.
An add-in for Visual Studio 2008 that highlights all occurrences of a selected text.
It searches and highlights substrings that are currently selected in a text editor.
Can be found at below link
WordLight
https://marketplace.visualstudio.com/items?itemName=MikhailNasyrov.WordLight

Resources