How to disable Visual Studio's autocomplete while in comments - visual-studio-2013

Visual Studio seems to have some kind of limited auto-complete that occurs while typing comments. It seems to be listing classes, variables etc just to fill in their name. Here's an image showing it popping up while I type "form".
I find this highly undesirable because comments are not usually code and I'm finding myself typing a common word (like "form") only for it to be replaced with the capitalized version because there's a class with the same name.
How can I disable it only in the comments? I do not want to disable it anywhere else nor make it harder to access elsewhere. Ideally I'd be able to manually open it with CTRL + SPACE or similar (right now that causes a seemingly useless second menu to appear).

Turns out this is being done by the Viasfora extension. It can be disabled from Options > Viasfora > General > Text Editor and set "enable plain-text completion" to be false.

Related

Set Intellisense delay (VS 2019)

Writing C# code in Visual Studio 2019. The constant popups as you type or position the mouse are very distracting. In Tools > Options > Text Editor > All Languages (or your language), you can disable all popups as you type by untciking Auto list members, but this is not what I need. Firstly I don't want to disable them completely and secondly this doesn't affect popups when you hover over a variable.
Ideally, I'd like popups more sparingly and only after a long-ish delay (say 1000ms). Currently they appear nearly instantly whenever I type any character or move the mouse over the code.
Can the delay be configured?
Update
According to a comment to this question, Visual Studio does not currently support a delay. But the experience for C# coding can be improved at Tools > Options > Text Editor > C# > Intellisense. Find the option Show completion list after a character is typed and untick it.
Actually, VS does not such feature to make a delay for code Intellisense.
Suggestion
So my suggestion is that you can disable the option Show completion list after a character is typed just as you said.
And then if you want to invoke Intellisense, you should type Ctrl + Space manually to invoke the Intellisense.
In this way, you can invoke the Intellisense anytime based on your needs.
Besides, if you still want this requirement, I suggest you could suggest your feature on our DC Forum.
Also, you can share the link here and anyone including us will vote it so that it will get more Microsoft's attention.
Update 1
I already suggested the feature for you and you can check the link.
You can vote on it and add any comments if I did not describe the issue in detail. Hope the Team will consider the idea carefully and give us a satisfactory reply.
Since the process would take a long time, so you have to use my workaround manually so far.

How do I stop Visual Studio 2013 jumping out of quotes when I type a space in web editor?

When I'm typing the value of an attribute and I hit space, it automatically jumps to the next attribute. I guess this makes sense when typing an id or something but it's really annoying when typing the class attribute with multiple classes. Does anyone know a way to change this behavior?
The behavior you describe is a function of the IntelliSense "auto list members" feature. You can work around the annoyance by disabling "Auto list members" for HTML. Note: you can also do this for other languages.
To disable "auto list members" for HTML go to:
Tools > Options > Text Editor > HTML > General:
uncheck "Auto list members"
Unchecking this option will prevent the "jumping" behavior you describe but will also prevent the IntelliSense list from automatically displaying. Probably not a big deal since you can just press CTRL+J to display it when you need it.

Resharper (or Visual Studio) auto completion

I'm using VS 2010 with resharper. If I have a class called ConfigParserTests and then write
new ConfigParser(
the code will auto complete to
new ConfigParserTests()
which is not what I want. Any idea how to disable this nasty feature.
[Edit]
What is want is to write out
new ConfigParser()
without pressing "Esc". In this case I am using TDD so ConfigParser does not exist.
[/Edit]
I have been looking around in both the resharper and VS intellisense menus without finding anything helpful.
Open Options window, navigate to Intellisense > Autopopup. You will see auto-complete options correspond to several cases and categorized according to language:
As you see, you can select for each single case:
Do not display.
Display but do not preselect. (seems proper for your case)
Display and preselect. (default)
Different options may be selected in different cases or languages. For example, you can specify different behaviours in C#:
After dot
After 'new'
In doc comments
Letter and digits
Where value is expected
HTH
It's not clear whether you're complaining about which class name it's filling in, or the parentheses. I'll address both.
If the class you're trying to use is in another namespace, and you haven't added the appropriate using yet, then the code completion is doing just what you would expect -- you told it which namespaces to use, and you didn't tell it to use the one with ConfigParser in it; so it uses the nearest match, as expected.
But ReSharper has shortcuts that can save you work by finding the class and adding the using for you. For this case, I would suggest that you look into the different Ctrl+Space options in ReSharper. You could write new cp <Ctrl+Alt+Space> and ReSharper will give you a pop-up menu asking whether you mean ConfigParser or ConfigParserTests. When you hit Enter to select the one you want, it will add the necessary using to the top of your file, and complete new ConfigParser() with the cursor between the parentheses.
(If the ConfigParser class doesn't exist yet, then that's one of the cases where you don't want code completion. Just type new ConfigParser and then hit Esc before typing your open paren.)
If your problem is that it adds a close paren, be aware that if you type ) ReSharper will not add a second close parenthesis -- it will recognize that you're typing a paren that it already added, so it will just move the cursor to the right. If for some reason you still don't want it to complete the open paren for you, #jdv-Jan de Vaan's answer explains where to change this preference.
When doing TDD you should put the VS intellisense into suggestion mode instead of the normal completion mode.
The difference is described here
Unfortunately Resharper takes over the intellisense so you can not change mode without deactivating resharper.
Select Resharper \ Options. From the list on the left, select Enirionment \ Intellisence \ Completion behavior.
Then disable the checkboxes under "Automatically complete single item with:"
If you are using resharper 6.0 I would upgrade to 6.1 as there were a lot of these sort of preselecting bugs introduced in 6.0 and fixed in 6.1.
CTRL+ALT+Space Bar
Gotta give props to Zain for showing us how to get around these issues when utilizing TDD
http://blogs.msdn.com/b/zainnab/archive/2010/01/22/intellisense-suggestion-mode-vstipedit0012.aspx
Select Resharper \ Options \ Environment\ Intellisence \ Completion Behavior
Then Change the options under “Automatically insert parentheses after completion: can disable all together Really Old Man Voice I want to type my own (), Opening Only, or Young Hip Coder Dude I like resharper to do it all for me man

Switch to tab by typing a substring of its name in Visual Studio 2005

Is there a way to navigate between tabs in VS similar to the emacs iswtichb-mode or Firefox ubiquity switch tab mode (https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial#Switching_Tabs) ?
In these apps, you just type a substring of the title of the tab (or buffer for emacs) to switch to this tab. For instance, to switch to a tab named "App_Code/Data/MyProgram.cs", you just invoke the tab switching command and then type "Progr" for instance to list all the tab whose name matches this string, including "MyProgram.cs".
It's much easier to switch between tabs this way when you have a lot of documents open and when you now where to go (which is the case in most situation)
Thank you !
Visual Assist has a function "Open File in Solution" (shortcut Shift-Alt-O), where you can type the filename and list of matching files from the solution is shown. Once you are happy with the selection, you can confirm it by pressing enter, or you can click the file you like with mouse.
As added bonus, this way you can also switch into files which you do not have open in a tab yet.
No this is not a supported operation in Visual Studio. It can be done by adding a Macro or via a plug-in though.
ReSharper will do something similar to this for you. It's not free, but it has many really nice features.
Invoke with Ctrl+T, then start typing the name of a file. It will provide you with a list of matches while you type. It's not limited to open tabs; it searches all files in the solution.
The search is intelligent. For example, if you have ThisIsMyClass.cs, typing 'TIMC' or 'ThisIMCla' will still match based on the idea that capital letters begin new words in file names.

Disabling single line copy in Visual Studio

Is there anyway to disable the rather annoying feature that Visual Studio (2008 in my case) has of copying the line (with text on it) the cursor is on when CTRL-C is pressed and no selection is made?
I know of the option to disable copying blank lines. But this is driving me crazy as well.
ETA: I'm not looking to customize the keyboard shortcut.
ETA-II: I am NOT looking for "Tools->Options->Text Editor->All Languages->Apply cut or copy to blank lines...".
The real problem you probably experience is that you go to paste, with CTRL+V. And you accidentally type CTRL+C, and end up overwriting the stuff that's on your clipboard. You can't disable this as far as I know, however, the work around for this, is that you can press CTRL+SHIFT+V multiple times to go back up the stack of things you have copied in visual studio. Not only does this allow you to recover what you originally copied, but you'll also find that CTRL+SHIFT+V very useful in a lot of other situations.
If you aren't willing to customize the keyboard settings, then Ctrl+C will always be Edit.Copy, which will copy the current line if nothing is selected. If you aren't willing to use the tools VS provides to customize the interface, then you can't do it.
However, the following works:
Assign this macro to Ctrl+C:
Sub CopyOnlyIfSelection()
Dim s As String = DTE.ActiveDocument.Selection.Text
Dim n As Integer = Len(s)
If n > 0 Then
DTE.ActiveDocument.Selection.Copy()
End If
End Sub
There's an extension called CopyOnlySelection for visual studio 2019 and 2017:
https://marketplace.visualstudio.com/items?itemName=KiwiProductions.CopyOnlySelection
This won't solve it immediately, but will add another command called Edit.CopyOnlySelection, which you can bind to Ctrl+C (and remove Ctrl+C from the normal Edit.Copy).
I'm pretty sure the way to do it in 2008 is the same as the way in 2005... check out this tutorial on 'customizing keyboard shortcuts' (about 1/3 of the way down)
http://msdn.microsoft.com/en-us/library/bb245788(VS.80).aspx
I don't believe it is possible to do this without some type of 3rd party clip board manager that would prevent you from overwriting the clipboard content with the empty string.
I've the free SlickEdit add-in installed, and its CommandSpy feature shows that Ctrl+C executes Edit.Copy whether you've got text highlighted or not. Therefore I guess the answer to your question is No.
However, I do remember this feature annoying the hell out of me when I first encountered it; now I rely on it and get annoyed when I try the same trick in other programs and nothing happens.
I have the same problem, but I found a workaround of it.
When I click one time on word in text editor, all occurrences of it are highlighted.
Then I think I will copy this word. But double-click will select text to copy only.
I copy then whole line instead wanted text.
Problem Is: Color of highlighted text parts are very similar to selected text.
I changed these colors to make it easy to distinguish between the situations.
Tools -> Options -> Environment -> Font and colors -> Selected Text
Tools -> Options -> Environment ->Font and colors -> Highlighted references
This is fixed in the latest preview of VS2022 (17.4.0 Preview 3.0)
It now has the option: 'Cut or Copy the current line without selection' and I can confirm that it works.
As for the original question, I don't think it will be fixed in VS2008 :-)

Resources