What is the command for promoting a peek preview to document? - visual-studio

When I'm in peek preview, I sometimes wish to promote it to document. It's done by mousing on the icon as shown below.
On occasion (most of the occasion, in fact), my mouse is tired and wants me to use my keyboard for such promotion to document. According to the wisdom on the net, it's achieved by CtrlAltHome.
In my VS, there's nothing assigned to the key combination, so I'm guessing someone snack in and changed that without my permission. However, to restore it, I need to know what the command in Tools | Options | Environment |Keyboard is called.
I can't find anything appropriate there (I've tried different variations of the MS's description of the command: "Promote the Peek Definition window to a regular document tab").
So, what is it called? If it differs between versions, I'd like to know the name for each, where the peeking is avaialble (started in VS13, if I'm not mistaken).
Given the meaningful effort I've put into composing the image, every and each can clearly see that it's a crucial and important matter, given the circumstances.

In Visual Studio 2013 the command name is Window.KeepTabOpen.

I had the same issue but on reverse. I hate the Peek Definition and didn't know how to get rid of it. Well, I found it. In Visual Studio 2017 you need to go to Tools -> Options -> Productivity Power Tools -> General -> Control click options. There you need to check/uncheck the Control click shows definitions in Peek
Hope it helps!
PS. In order to see Productivity Power Tools you need to get it first using NuGet

A workaround for this (for Visual Studio 2015) is the following:
With focus on the peek window to open/dock:
Close peek window
Esc
Go to definition
F12
Pin tab
Alt+-, P
If there are multiple/nested peeks, then replace step 1 with:
Previous peek window
Ctrl+Alt+-

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 can I add a note to a Visual Studio bookmark or line?

When I am in the middle of debugging I often find more than one area that can be improved (or fixed) and I like to mark them in such away that I can come back later and make the improvement.
Currently I add a bookmark to the line but this can't include any notes that can be used to remind me why the bookmark was there (you can change the name of the bookmark but this isn't enough). I suppose I really want to be able to add a TODO to the code while the code is running but although Edit and Continue is enabled it is not available in the ASP.NET WebForms (3.5) project.
Are there any Visual Studio features or extensions that will enable this?
Instead of enabling Edit and Continue then entering a TODO: into the source code, you can create a Task List Shortcut (key cord Ctrl + K, Ctrl + H).
This adds an entry to the Shortcuts section of the Task List window. From there you can change the description of the task to remind you why you created it.
Due to the fact the answer marked as accepted has been deprecated in VS 2015 onwards, I used this solution instead:
Bookmark a line of code using the key cord Ctrl+K Ctrl+K, then open the Bookmarks window (Ctrl+K Ctrl+W). In the Bookmarks window you can rename your bookmarks to whatever you please.
I have tested this in both VS 2015 and 2017 (Community).
IMPORTANT NOTE: Make sure to File->Save All (Ctrl+Shift+S) every once in a while so you don't lose the bookmarks you've been working on if VS or Windows decide to crash. I have fallen victim to this and it is painful.
The Edit and Continue feature will let you make simple changes to your code while debugging. If you your change is simple enough then you can make the change on the fly while coding. For more complicated changes, you can add a TODO comment of the form:
// TODO: Explanation of fix
You can see a list of all TODO comments by looking at the task list within Visual Studio.

Visual Studio - easy way to bring up type definition as source code

Oftentimes I want to bring up a system class in a source view, so that I can browse the properties and methods exposed by the class. Below is the screenshot of what I mean:
Srting from metadata http://img443.imageshack.us/img443/940/stringfrommetadata.png
Usually I do this by selecting the class name and pressing F12 (or right click>Go To Definition). However, if I haven't got it anywhere ready, i have type it up and then do Go To Definition. Most of the time I have to delete what I typed later on.
Is there a way to bring up this view without having to type the class name? The VS2010 Navigate To dialog doesn't support this.
EDIT: When I posted the question I didn't use any Visual Studio plugins. Now that I realised that I have full CodeRush license (thanks to StackOverflow promotion for users with 10K rep) I will accept answers that use CodeRush or Refactor!.
EDIT: At this stage I haven't really got anywhere with trying to answer this question. I am going to leave it open and let the bounty auto-award itself to Rory as he explained what's happening the best. In the meantime(schedule allowing) I will investigate doing this with DXCore as I think it should be possible.
The view you're looking at appears to have been built by some sort of analysis of the IL of the framework. Without knowing the type you intend to look at, no deconstruction can be done. Therefore I feel that, you are unlikely to find exactly what you have said you are looking for.
Allow me to suggest a few alternatives though.
Disclaimer: I work for DevExpress as a CodeRush Community Evangelist.
The Object Browser (Ctrl+Alt+J) This screen will load without attempting to show you any particular type, it will therefore be down to you to find the type in question. However all types are available and full search functionality is provided. once the type you're looking or is found, all members are listed and available.
Update: If you use the (Ctrl+K, Ctrl+R) shortcut to launch the object browser, then it will launch focused on the Search box. This is invaluable.
There are a number of CodeRush features which can prove useful when trying to locate code.
TabToNextReference (Tab) Whilst the caret is positioned within a type, strike the tab key and the next reference to that type will be located. More Details
References ToolWindow (Shift+F12) When activated the References ToolWindow will show you any references to the current type or member. This toolwindow can also be used to navigate said references. The References Toolwindow can be used in both on demand and Live mode. this allows you to have the window update as you navigate your code (via mouse or keyboard) and locate all references of any symbol the caret lands upon.
QuickNav (Ctrl+Shift+Q): This feature is closest in style to VS2010's NavigateTo feature. QuickNav will locate symbols matching whatever you type into it's filter box. This facility also supports Camel Case search. More details
QuickNav is also much more configurable than it's VS counterpart
Finally
Please also keep in mind that CodeRush is build upon the DXCore, a framework which allows users to create their own plugins for use alongside each other and CodeRush.
This framework has been repeatedly been leveraged by the community to add additional functionality. So even if you don't see any thing quite to your needs, consider suggesting something to the community by way of the forums or even contact me directly RoryB at DevExpress dot Com
I'm sure there's something we can do to help you out :)
I was not aware of that new "Navigate To" feature, but I used to use Reflector for this sort of things. The pro version offers some integration with Visual Studio (Right clicking the method and selecting "Open In .NET Reflector"). It will open the reflector window and won't show the code in the VS itself. You can watch the demo that shows this feature and some others.
This is not the best answer that I'd expect but is a good option to know.
There is no way that I know of to do this in Visual Studio 2010. However, you can do this in ReSharper via the 'navigate to' menu. I suggest you try the 30 day trial from them, then if you really do need this then purchase it.
A number of add-ins allow you to browse objects (though usually in an object-browser treeview manner rather than in a "header" file form - I believe Resharper, CodeRush and Visual Assist X all have variations on this theme).
However, one add-in to consider (as it's free) is the VS Productivity Power Tools. It adds a Solution Navigator window that gives a view onto your solution just like Solution Explorer, but (among other enhancements):
can search & filter the files listed, e.g. show only those files that are named Test.
can "expand" any file entry to show the types and members within it.

Eclipse's Ctrl+click in Visual Studio?

After working for a few days with Eclipse Java I totally got addicted to pressing Ctrl and clicking on an identifier to go to its definition. Since then I've been looking for a way to achieve this in Visual Studio as well.
I realize VS has right click, Go to definition, and that F12 does the same. I also realize that Visual Assist does something similar with Alt + G. Yet none of these are as perfect as Ctrl + click.
I've actually tried my luck for a few hours trying to write a VS plugin to do it but didn't get anywhere in the time frame I thought reasonable for this.
Does anyone know how this could be achieved? A ready plugin? A macro of some kind?
If you use Visual Studio 2010, you can use the free
Visual Studio 2010 Productivity Power Tools from Microsoft to achieve this.
I use visual studio 2013 and 2015, I installed Go To Definition. To install this extension navigate on TOOLS -> Extensions and Updates.
I'll answer the commentors who asked about the difference between Ctrl-click and F12.
Ctrl-click workflow:
Move hand to mouse
Move mouse to hover over variable name
Other hand holds down Ctrl key while you click
Move mouse to position cursor, highlight, right-click, or whatever
Move hand back to keyboard to continue typing
F12 workflow
Move hand to mouse
Mouse mouse to hover over variable name
Move hand back to keyboard
Hit F12 key
Move hand back to mouse
Move mouse to position cursor, highlight, right-click, or whatever
Move hand back to keyboard to continue typing
If you assume the cursor is already positioned on the desired variable, F12 is better. However, that's rarely the case. Also, if you stop after this specific action, assuming you want hands back at the keyboard, the cost is the same. But if you keep in mind that you probably had a reason for wanting to go to the definition, the Ctrl-click workflow saves you an instance of moving between the keyboard and mouse.
Visual Assist supports Ctrl+Click as of June 2009 (build 1727). Activate Ctrl+LeftClick in VA Options | Advanced | General. (See the comment below.)
If you have Visual Studio 2010 you can use "Go To Definition" by Noah Richards.
http://visualstudiogallery.msdn.microsoft.com/en-us/4b286b9c-4dd5-416b-b143-e31d36dc622b
oh man, just install resharper!! (vs plugin) with it installed you just go and Ctrl + click to go to definition.
this is not the only thing resharper does, try it out free!!!
I use the built in options (F12, Right-click -> Go to definition) but I know a lot of the guys at my company use Resharper and it definitely has this functionality.
Microsoft released a Visual Studio 2010 extension named "Productivity Power Tools" which now adds Ctrl+Click functionality. So if you're like me, and hate installing third-party addons, you can now have the same functionality!
Another option with VS (besides F12 and right-click > Go to Def) is add the code definition pane (View > Code Def Window). This is essentially another editing pane that shows the code for the current symbol - no need to Ctrl-click or anything. I keep it pinned to my secondary monitor. Any time I need to see the implementation for a symbol I just click it and look over.
Another nice thing about F12 is you can also do ShiftF12 to find references to a symbol and F8 through them. The two go together like love and happiness.
I prefer to bind Go To Definition to CtrlD. This makes it extremely easy to use either with both hands on the keyboard (CtrlD to go tho the definition of the symbol under the cursor) or one hand on the keyboard and one hand on the mouse (Click on a symbol, then CtrlD).
All in all, both VS and Eclipse have weird key shortcuts.
I just had to respond, too: F12 is far too right on the keyboard and you have to leave the the mouse right hand for the keyboard to use it. As a long time VS user I just didn't find it until I searched for the Ctrl+Mouse equivalent in Eclipse. It's completely borked. OK? No need to argue. (The same goes for F3 in Eclipse going for definition. ???? Why the face??? It's FIND NEXT for Pete's sake. But this can be removed after mastering the Eclipse keyboard shortcut system in the course of a few years.)
Anyway, as has been said here before, Microsoft has already understood this can be an issue for new programmers coming in from Eclipse, so they provided the Power Tools (I followed the link up above).
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/
If you are using Visual Studio 2017, you can use Productivity Power Tools 2017
I don't work in VS much, so I haven't used it, but I've heard incredibly good things about Resharper from everyone I know who does. Everyone has told me it's worth every penny, and significantly improves efficiency in Visual Studio. I think it has a feature like what you're looking for, along with a TON of others.

Plugin for Visual Studio to Mimic Eclipse's "Open Type" or "Open Resource" Keyboard Access

If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list.
I'm looking for a similar functionality for Visual Studio 2008. I know there's a findfiles plugin on codeproject, but that one is buggy and a little weird, and doesn't give me access to functions or classes.
Vs11 (maybe 2010 had it too) has the Navigate To... functionality which (on my machine) has the Ctrl+, shortcut.
By the way it understands capitals as camelcase-shortucts (eclipse does so too). For instance type HH to get HtmlHelper.
This isn't exactly the same as Eclipse from your description, but Visual Studio has some similar features out of the box (I've never used Visual Assist X, but it does sound interesting).
The Find ComboBox in the toolbar ends up being a sort of "Visual Studio command line". You can press Ctrl+/ (by default) to set focus there, and Visual Studio will insert an ">" at the beginning of the text (indicating that you want to enter a command instead of search). It even auto-completes as you type, helping you to find commands.
Anyway, to open a file from there, type "open <filename>". It will display any matching files in the drop down as you type (it pulls the list of files from the currently open solution).
To quickly navigate to a function, in the code editor press Ctrl+I to start an incremental search. Then just start typing until you find what you are looking for. Press Escape to cancel the search, or F3 to search again using the same query. As you are typing in the search query, the status bar in the lower left corner will contain what Visual Studio is searching for. Granted, this won't search across multiple files (I've never used Eclipse much, but that sounds like what it does from your description), but hopefully it will help you at least a little bit.
If anyone stumbles upon this thread:
There's a free plugin (created by me) for Visual Studio 2008 that mimics the Eclipse Ctrl+Shift+R Open Resource dialog (note, not the Open Type dialog). It works with any language and/or project type.
You can find it at Visual Studio Gallery.
Some of the neat features are available in Visual Assist X, though not all of them. I've asked on their forums, but they haven't appeared as yet. VAX gets updated regularly on a rough 4 week period for bug fixes and a new feature every couple of months.
If you are looking for an add-in like this to quickly navigate to source files in your project:
try the Visual Studio 2005/2008 add-in SonicFileFinder.
Resharper does this with the Ctrl-N keyword. Unfortunately it doesn't come for free.
Visual Studio doesn't have anything like this feature beyond Find.
Found this thread while searching for Eclipse's Ctrl+Shift+R, and after seeing the Visual Studio Gallery, found the DPack Tools (they are free, and no, I'm not endorsed in any way by them).
But it's exactly what I was searching:
- Alt+U -> File Browser (a la Eclipse Ctrl+Shift+R)
- Alt+M -> Code Browser (Method list in the actual class)
It has more features, but I'm happy with these ones.
I have been using biterScripting along with Visual Studio to do more flexible searching and manipulation.
It can search the entire workspace.
It can search within any project - EVEN IF THAT PROJECT IS NOT LOADED OR EVEN PART OF A WORKSPACE.
It can find things using regular expressions.
AND, ABOVE ALL, it can make bulk changes. For example, want to change the name of a class from CCustomer to CUser, I can do it in just a few command lines - Actually, I have written scripts for things like this I do often. I DON'T HAVE TO CLICK ON EACH INSTANCE AND MANUALLY DO THE CHANGE.
And, it is inexpensive ($0). I downloaded it from http://www.biterscripting.com .
I'm also comming from the Java Development side and was looking for the CTRL+T feature in the Visual Studio. The other answers refer to open file, but since in C# the class name and file name can be different this is not what i was looking for.
With the Class View or the Object Browser you can search for Objects and Classes
[View]->[Class View] or [View]->[Object]

Resources