I'm looking for a plugin or way to simply go from any namespace, type, method, property, etc in my .Net code to the MSDN page that covers it via a context menu item or hyperlink-like mechanism. Does anyone know of anything that will do that?
The "Go to Definition" option when you right click almost covers this, but it doesn't quite work well enough - no support for namespaces and you often end up at an ugly metadata page. I'm still on vs2005, so if vs2008 is better at this I'd like to know about it.
Have you tried F1. This will automatically open the help to the appropriate method or object. Not sure if this works for namespaces.
Besides using F1 (which doesn't always work) I haven't found an add-in for VS to do this, I have another quick way around it.
I use Launchy (from launchy.net) and setup the Weby plug-in so I can quickly do MSDN searches. So if I'm looking for String.Format, my keyboard only sequence (from VS, or anywhere else) would be this:
alt-space
MSDN
String.Format
that brings me right to an MSDN search, where usually the first listing is what I'm looking for. It's not a perfect solution, but having a fast internet connection and the keyboard only approach works well for me.
Related
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.
Has any one found a replacement for Rockscroll or Metalscroll for Visual Studio 2010?
I miss it so much that I looked into making one my self but only have word highlighting working and a place holder scroll bar and seems to be much harder than I thought it would be. I'm happy to share what I got if someone is interested in helping.
The Productivity Power Tools extension for VS2010 just added an "Enhanced Scrollbar"!
To enable the minimap go to Tools->Options->Productivity Power Tools->Enhanced Scroll Bar and check "Full map mode". Optionally you can assign the background color and highlighted region.
Just tried ProgressiveScroll and it looks and feels like the original MetalScroll; it also works in Visual Studio 2012!
A user named Kryo at the "Sins of solar empire" forum have made a pretty good imitation of MetalScrollbar for VS 2010, called MetalMargin. Available here. Just installed it, and it seems to work pretty well, although highlight on double click is not yet implemented.
David Pugh released a version of his Structure Margin, which serves a similar purpose. His All Margins extension combines a bunch of the other smaller extensions in the same vein.
It's not exactly the same, but I find the structure margin to be an interesting way to visualize the entire code file.
I haven't tried it myself yet but AllMargins looks really nice. Whoops you already linked it Noah Richards. Sorry.
The code is also available for the OverviewMargin - I haven't tried it at all, but it may be a good place to start from if you want to roll your own.
Did You try RockMargin ?
http://visualstudiogallery.msdn.microsoft.com/1b0d7360-40dd-447e-8bef-90e2cf52f683
This is useful
For anyone looking for a replacement for just the Highlighting part of RockScroll, the free plugin "Highlight all occurrences of selected word" does exactly that.
I've been looking into into MEF (Managed Extensibility Framework), but I am not entirely sure if it is something that I need and can help me accommplish what I need to do.
Can someone provide an easy to understand description of MEF, provides good resources and tutorials (aside from MSDN), and/or know if it can do the task I am trying to do under Visual Studio?
The task I am trying to do is to "log" a string of text to a text file whenever the user selects a string of text. I also need this functionality to run passively and real-time, which Visual Studio Add-in's do not support this functionality, as their behavior is "click the button to work".
It looks like the docs here
http://msdn.microsoft.com/en-us/library/dd885240(v=VS.100).aspx
may be one useful starting point.
See my response to a similar question.
The answer is "yes", this is possible/supported. Look for the following in samples/documentation/walkthroughs:
IWpfTextViewCreationLister - for detecting when editor instances are created.
ITextView.Selection - the selection object
ITextSelection.SelectionChanged - raised whenever the selection changes (though not for the empty-selection tracking the caret)
I'm sure this is possible in .NET without going 'close to the metal', probably a reference to 'lower level code'. The .NET Method TextPattern.GetSelection Method will help you to accomplish your task if combined with a MouseEvent Handler.
By default Visual Studio displays all members and its extension methods for a type in intellisense.
Sometimes I would like to hide the extension methods to make it easier to find the member I am actually looking for (especially when using Linq).
Is there a shortcut or another way to display only the members of a type in intellisense?
Not that I'm aware of - but one thing you might want to do is get rid of the using directive for System.Linq. At that point the extension method won't be accessible, and I believe it won't be offered by Intellisense.
Obviously that's no good if you want to use LINQ from one bit of code in a class, but not in another - but for classes which aren't using LINQ at all, it might help you.
In theory you could do this with the appropriate decorator attribute*, but googling this it seems it's bugged, with the fix awaiting a service pack presumably.
* [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
Perhaps you could try using something like resharper which filters the list of methods as you type. I find this helps me to quickly get to what I need. And it will do so without hiding useful extention methods
Visual Studio 2022 has this.
When Intellisense is displaying, you can toggle 'Show only Properties' and 'Show only Methods' (hold Ctrl to get click both).
If you want to only see the extension methods, you can toggle 'Show only Extension methods'.
I find the solution explorer is a bit slow to get around in sometimes, and think that there might be a better UI solution out there. I like Ctrl+T but sometimes a visual cue is better than remembering the class name?
I think it would be nice you had a second, similar window, that only shows files that have been opened during the current session? Any other suggestions
If you want to upgrade your experience to the next level, you need to have Visual AssistX.
It enables links between your code and the files it comes from. And it's also light-weight. You will forget the Solution Explorer quite rapidly.
http://www.wholetomato.com
In the toolbar's search box, you can type ">of ". It will give you an intellisense-like dropdown of files in your solution as you type out the filename (e.g. ">of def" will show "default.aspx" and "default.aspx.vb" if those two files are in your solution).
I'm not sure if this any more/less cryptic than ctrl+t, but I thought I'd throw it out there.