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

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.

Related

Visual Studio code completion like ctrl+k in netbeans?

My question is there code completion for Visual studio like in Netbeans where you cycle the buffer with ctrl+k, when you type something?
There's now a nice extension called Simple Autocomplete which adds one command simpleAutocomplete.next that you can map to a shortcut of your choice.
No, there isn't a similar feature in Visual Studio.
The traditional Visual Studio autocomplete is using intellisense.
When you start typing, intellisense may bring up a drop down with suggestions. In that case you can tab to complete using the current suggestion or use the arrow keys to choose another.
Ctrl-Space (or Alt-Right arrow) will bring up this intellisense menu if it's not up.
I find it does a pretty good job overall.
Some extensions like Resharper or Visual Assist offer their own code completion or other similar features (like Suggestion List for Visual Assist).
I know it's been ages since I asked this question but I found the next best thing to do this. What I would suggest is to use VsVim extension and to use Vim's anyword completion; however, in order for this work, what must be resolved is the keyboard shortcuts that conflict:
Go to "Tools options" in Visual Studio.
Then go to VsVim category(alternatively you can search "VsVim" and
should bring the options) and click keyboard.
As far as I know vim deals with this type of completion with these keys
CTRL+P and CTRL+N so what we do is to let Visual Studio give up
these keybindings and let VsVim deal with it by Selecting from the drop
down of the keys(CTRL+P and CTRL+N) and let it be "Handled by VsVim".
I hope this has helped someone out.

Backspace doesn't work in Visual Studio

I keep getting a very annoying problem in Visual Studio. When I try to delete some text by pressing backspace it doesn't work. Why is this? What is going on? Sometimes I have to close and open Visual Studio to make this problem go away but I just tried that right now and it didn't work. Backspace works in Notepad in case you are wondering.
In Visual Studio go to:
Tools
Options
Environment
Keyboard
Find "Edit.DeleteBackwards" command.
In "Use new shortcut in:" dropdown select "Text Editor".
In "Press shortcut keys:" click backspace so it would show "Bkspce"
Click "OK".
Backspace should start working for you again.
This seems to happen to me when I open a solution and there are files already open. I used to close the files, then close and re-open the solution to fix it, but now I just hit Alt + Enter.
Here is the blog where I found this trick.
I solved this issue resetting keyboard mapping scheme.
Tools -> Options -> Environment -> Keyboard -> Reset.
A quick fix for me is to simply open any menu from the menu bar. Once the menu is closed the non-character keys start to work again.
Except for the above methods.
You should also check the shortcut key settings:
File -> Preferences -> Keyboard Shortcuts -> 'Then check the item: deleteLeft'.
I get this from time to time in VS2010 as well and simply just using the mouse to change tabs/files seems to always fix it now. Nothing more.
This method is working at 100%.
Go to "File-> Preferences -> Keyboard Shortcuts" and search for deleteLeft and add keybinding "Backspace".
Odd that this is still an issue even in VS 2019. Both the backspace and delete keys didn't work. Quick fix, I just ran the project and it seemed to give it the kick it needed.
All I did was exit visual studio and restart it.None of the above options worked for me.
In my case the problem was the "When" Condition in "File-> Preferences -> Keyboard Shortcuts".
I removed "textInputFocus && !editorReadonly" and it works now as expected.
I'm looking forward to the side effects ;).
Try resetting your Visual Studio Settings
Go to :
All Program > Visual Studio 20xx > Visual Studio Tools
Run Developer Command Prompt for VS20xx as Administrator and this command:
devenv.exe /resetsettings
A quick work-around for me is locking the pc (Windows+L) and logging in again.
You can reset keyboard mapping scheme like this
Options => Environment => Keyboard then select (Default) in the comboBox and click Reset button and then Ok button to confirm
Visual studio 2019 : Keyboard mapping sheme
Tested in Visual Studio 2019
This problem happened for me when I used a different version of resharper at home and then took that project to my employment. Backspace works for me now after I deleted the bin and obj and resharper directories.
I have this problem after I install Vim, uninstall Vim Backspace works fine.
When this issue has happened to me, I've found that hitting delete or backspace is unresponsive only within a portion of my code. This portion happened to be some code that I've pasted in from the internet somewhere.
To fix this issue, I cut out the recently pasted problematic code and then pasted it into a text editor like Notepad++. Then copying and pasting that same code out of the text editor and back into Visual Studio fixed the problem.
Using Visual Studio Community 2019 (16.4.3)
I just searched this issue because I could click in my document, type, et cetera, but I could not use backspace, delete, ctrl+z, or the arrow keys.
Opening the "File" menu, I noticed the Save option referred to a different file. I checked that file and found that all of the keys that seemed not to work were actually editing that other file.
Switching between the file in half-focus and the file I intended to edit worked and, luckily, undo was able to fix the file I unknowingly butchered.
If you wound up here, check your "File" menu to make sure the correct file is referenced, since the fix is quick and easy to try.
Just had this exact issue (along with 'Enter', 'Ctrl+X', 'Ctrl+C', 'Ctrl+V', 'Ctrl+Z' keyboard mappings seemingly doing nothing) in the latest VS preview version below:
Microsoft Visual Studio Professional 2022 (64-bit) - Preview
Version 17.2.0 Preview 6.0
The fix for me was to move to another tab (I had multiple open) use the backspace key which worked fine, then move back to the original tab with which it wasn't working, save the file (as it had outstanding changes) and then I found backspace and all other shortcuts then worked!
I can only think that VS got in a locked (to keyboard mappings) state for that particular tab.
A few notes on this:
I knew it wasn't a keyboard issue as I was able to use those
keys/mappings fine in other apps.
I found closing and reopening VS didn't work.
Also resetting the keyboard mappings (through Options menu as others have described) didn't work.
I had multiple tabs open.
Resharper was disabled.
I just had this happen in one instance of Visual Studio 2022, caused by the debug settings editor window being open in another instance of Visual Studio 2022 in the background where I couldn't see it.
Closing that window resolved it.
I've had this issue for a long time. I'm not sure what causes it, but Alt + Enter works.
The extensions that I'm running include AnkhSVN, MySQL Tools, and Productivity Power Tools.

ReSharper 5.1 can't navigate to a type from anywhere

I'm running Visual Studio 2010 (10.0.40219.1 SP1Rel) with ReSharper 5.1 (5.1.3000.12). Recently, it seems as though ReSharper has completely lost the ability to navigate to a type.
Here are some actions I can take in the UI that now do nothing:
Right-click on type name in code
editor and select "Go To
Declaration"
Right-click on type name in code
editor and select "Go To
Implementation"
R# "Go to type" (Ctrl-T)
In the R# "Find Results" window, double-clicking a type
Here are some actions that still work:
Double-clicking an item in Solution Explorer
Opening a file from VS Command Window
I've completely uninstalled Visual Studio, then reinstalled it with SP1, and ReSharper 5.1, and I still have the same problem.
I'm assuming there's some kind of configuration open that I've done that is disabling the ability to navigate to a type with ReSharper, I just can't figure out what it is.
Any advice would be much appreciated.
I just experienced this problem. None of the previous suggestions worked for me unfortunately, but I managed to resolve it:
Go to Resharper -> Options
Under Keyboard Shortcuts, temporarily switch to a different scheme than the one selected
Press 'Apply Scheme' button then press Save
hen repeat, but this time select the scheme you actually want and press 'Apply Scheme'
Hopefully that fixes it!
I am using VS 2010 SP1 (same as you)
Delete the Resharper temp files in the same location as your solution file. The folder name will be something like _ReSharper.SomeSolution
Failing that, try one of the R# nightly builds here altho it should work with your current config.

How do I make the Enter key on intellisense when typeing in VB react the same way as in C# in 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

Visual Studio Editor does not underline errors anymore

My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
Does anyone know the problem and how to restore this functionality again?
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
About possible causes.
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
Found it in Visual Studio 2019 as: Tools > Options > Text Editor > General > Show error squiggles
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
How you will do in Visual studio 2013?
TOOLS -> Options... -> Text Editor -> C/C++ -> Advanced -> Disable Squiggles: True/False (Under IntelliSense) -> Press OK
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
For example:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
Solution:
Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
For visual studio 2017 act according to HeeJae's comments in:
https://developercommunity.visualstudio.com/content/problem/113112/design-time-error-checking-isnt-working.html
i.e:
Hi. you are probably hitting a known issue. can you try this?
1.Update to latest release If that doesn’t solve it
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
3.Close VS.
4.Delete the “.vs” directory beside their solution file.
5.Reopen VS.
..
thank you
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
Good luck
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
For everyone wondering in 2021..
search for "C_Cpp.errorSquiggles" in the settings.
Make sure to have it active for the user, as well as the workspace.
No need to restart Visual Studio.
For me (VS 2019) , after trying the other answers also, setting the scope of analysis from "Current document" to Open document" brought back the missing error markers
Just go to settings and search for errors and Image in Error Squiggles. You can see the Error squiggles (Modified: Workspace - Right now you can't see it because I modified it). Just click on modified and you will see the disabled option. If by mistake you disabled it, just enable it and you can see the red line errors again in your code.
In latest edition, check for .vscode folder in same project folder. There will be a setting.json file in that. Delete the key value pair of "C_Cpp.errorSquiggles": "Disabled". Restart the vs code.

Resources