How to configure my solution to show all projects collapsed on Visual Studio? - visual-studio-2010

Every time I check out my solution from the SCM I have to collapse manually each project in my solution to get a good overview of it.
I know that the collapsed settings are stored in a .suo file, which is binary. I don't want to commit this file to the SCM, instead I am looking for a xml tag that I could put in the .sln file so when I open it all projects are collapsed.
How to do that?

Install DPack for Visual Studio and use the "collapse all projects" context menu item ;-)

Install Productivity Power Tools and use Solution Navigator instead of Solution Explorer:
Solution Navigator is a new tool window that acts like an enhanced Solution Explorer. With it, you can:
* Expand code files to navigate to its classes, expand classes to navigate to their members, and so on (C# and VB only)
* Search your solution, all the way down to class members
* Filter your solution or projects to see just opened files, unsaved files, and so on
* View related information about classes and members (such as references or callers/callees for C#)
* Preview images by hovering over them, or preview rich information by hovering over code items
* We've also added support for multiple selection and drag & drop. (New!)
It also haves a collapse all button.

The smallest plugin that helped me is Collapse Selection In Solution Explorer

Related

Search File Or Class quickly from the solution In VS?

If there are lots of projects in one solution and each of them has lots of .cs file.
Also, there might be one more classes in one file.
So, what I want to ask is: How can I find a file or a class quickly?
I really don't like use the ctrl+F every time.
Is there any plugin like if I click the CTRL+SHIFT+R it will open a window of show a class list or a file list and I can input the keyword what I'd like to find.
Then, when I double click the result, the file will be opened for me.
In VS2010 at least, there is the Navigate To feature. It indexes file names, classes, and methods for quick searching. Hit Ctrl+, (comma) to bring up the dialog:
Also, if you don't mind paying (and getting additional features), there is Visual Assist X and ReSharper, both of which I believe support VS2008/VS2010 and have source navigation features.
You can try out the "Productivity Power Tools" extension for VS2010.
It adds a new menu called "Solution Navigator", which has a search box with autosuggest, that enables searching your solution.
it has lots of other features and I highly recommend it.

Solution Explorer Context Menu Too Long

Ok, so I installed plenty of useful extensions from Extension Manager in Visual Studio 2010.
I really like them but now my context menu in solution explorer is way too long.
So long in fact that I have to scroll down/up using little arrows which is really annoying.
Any solution to that anyone?
The problem is that when you right-click on an entity within the Solution Explorer, the resulting context menu is so loaded down with options, extensions, menus, lists and levels that you have to start scrolling around to get anywhere.
The solution is to declutter that context menu by removing unneccessary items. This can be achieved through the Commands tab of the Tools -> Customize dialog. Specifically, click on the Commands tab, and select the Context Menu button to start customizing anything and (almost) everything to do with those context menus.
Many of the entities within the Solution Explorer have some sort of representation here; the biggest issue you have will be finding the right place to start customizing.
For example, I have a method of Source Control integrated within the Visual Studio environment which causes 7 new menu items to appear when I right-click on a project (Check In, Check Out, Get Latest Version, etc). I do all of my source controlling outside of Visual Studio, so these menu items are just clutter to me. I go to Project and Solution Context Menu | Project and delete anything and everything related to Source Control. Now, when I right-click on a project, none of those options appear in the menu.

How to show code outline in Visual Studio?

This kind of stuff exists in Eclipse:
But I've not found it in Visual Studio yet. Is there such a window to show code outline at all?
I tried both Document Outline and Class View windows. The Class View is close, but it only shows class information, can it come up with function info also?
One great plugin for VS is CodeMaid. It is powerful and it is open source!
You can also sort your methods within the CodeMaid Spade view.
Here is a screenshot.
Also non-free, but Jetbrains Resharper provides a File Structure Window, what perhaps is what you are searching for.
To display this dockable window, select from the menu: ReSharper → Windows → File Structure (default shortcut Ctrl+Alt+F
This question was asked quite a while ago and before Visual Studio Code existed but I found it when searching for how to do this with Visual Studio Code so I thought others might stumble on this question too so I thought I'd share my solution. Here's how to do it in Visual Studio Code. I'm using TypeScript but it works for JavaScript, too.
1) View -> Open View
2) select (or type) Outline
3) You'll now get an Outline palette that shows full information on the class including properties and functions.
In newer Visual Studio versions (e.g. 2015) you can see this directly in the solution explorer. Simply expand the .cs file and you will get the list of the methods in the order they are listed in the file. This is exactly the same as the Outline in Eclipse.
If you want to see the stuff alphabetically, open the file and between the tab pane and the editor, there is a row showing the project name, the class name with namespace, and a drop down with the available methods and properties.
not free, but if you install Visual AssistX, each document gets a dropdown box listing all methods in a file (alphabetically or in the order they occur)
check Class View again, it does show functions (but not per document). Also check out the Code Definition Window, extremely nice when combined with Class View.
You can use the Class View Window, or you can use outlining to collapse the code window to definitions (Ctrl-M-O and Ctrl M-L in the standard keyboard set up)
Trick is to call Ctrl+F2, then Tab, then Tab, then Down arrow. I've done it with this simple AutoHotkey script when I hit Ctrl+o:
#IfWinActive ahk_exe devenv.exe
^o::
Send ^{F2}
Send {Tab}
Send {Tab}
Send {Down}
return
#IfWinActive
It will show dropdown that is closest to Quick Outline in Eclipse or others.
There is now a free add-in available through the add-in manager in VS2010 that works quite well. It also has a dark theme.
VS10x Code Map v2
Screenshot:
Go To "Solution Explorer" and select your project; then select a class file you want to outline, then expand the little triangle just below that class (as shown in the figure below)
In VS2017 you can navigate between items in the file directly from the upper right corner of the Editor.
you can have document outline window by going to view-> Other Window -> Document Outline or you can have it using Ctrl+W, U
I am using VS-2008. You can have a look at the following links also:
http://wildermuth.com/2008/06/06/The_Document_Outline_in_Visual_Studio_2008
http://dotnetkicks.com/tipsandtricks/Visual_Studio_2008_Document_Outline_Split_View
Hope this answers your question.
// 2019 answer
There is an free extension for Visual Studio that provide code outline: https://marketplace.visualstudio.com/items?itemName=SamirBoulema.CodeNav
I've started using VSCommands 10.
This has support for the most common languages used when developing in Visual Studio 2010, including JavaScript.
There's an extension provided Free, by Microsoft, that enables this and many other features into Visual Studio. The extension is Productivity Power Tools.
Ctrl+Shift+O comes closest to what you want
If you need more, see: discussion of the Outline Feature on github
If you use PHP, make sure you install full version as mentioned in the docs
Resharper has a feature of inspection. You can see incoming and outgoing calls from there.
shortcut: CTRL+ Shift + ALT +
A list of things you can use:
1.Visual Studio default's ClassView
2.Visual Assist's VA OUTLINE Feature
3.CodeMaid's Spade Feature
In Visual Studio Code, the popup outline is not called outline but symbol list. The command is "Go to Symbol in Editor...", and default shortcut is "Ctrl + Shift + O".
Checked again, the question is to Visual Studio, I guess it could be same with Visual Studio Code.

Visual Studio window which shows list of methods

In Visual Studio, is there a window which shows list of methods in the active class? A small window like the Solution Explorer would be great. In Eclipse, there is one.
There's a drop down just above the code window:
It's called Navigation bar and contains three drop downs: first drop down contains project, second type and third members (methods).
You can use the shortcut Ctrl + F2 (move focus to the project drop down) and press Tab twice (move focus to the third drop down) to focus it, down arrow will expand the list.
Full size image
I found how to turn the drop down on as shown in the first answer (#ChrisF):
Go to Options->Text Editor->(your language)
and tick "Navigation bar" in the display section.
Since Visual Studio 2012, you can view the outline ( fields and methods) in the solution explorer by expanding the node corresponding to your file .
Shortcut to Navigation Bar is Ctrl+F2. Takes you to the types dropdown first. Press tab to go to method dropdown, and then enter on a method to go to that one.
ReSharper has a 'ReSharper | Windows | File Structure' window, which is used for visualizing current code file structure.
Resharper has the File Structure window which is very similar to eclipse outline view. Originally answered in:
Visual Studio 2012: List of all Methods in class
Resharper help:
http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html
Despite it's an old question maybe this answer help you as helped me.
you can download codemaid extension from here : codemaid website
it has a lot of functionality that you may find in their website.
the one that is related to this question is code digging
Visualize and navigate through the contents of your C# and C++ files from a tree view hierarchy. Quickly switch between different sorting methods to get a better overview. Drag and drop to reorganize the code. See McCabe complexity scores and informative tool tips.
in other words it give you ability to see the methods and properties and also reorganize them just with drag and drop. it's my everyday use extension
There is no direct equivalent to the Outline View in Eclipse. The closest thing I've found is the Class View, which lists all classes and their members/methods. There is a search box at the top to narrow the selection.
In Visual Studio 2019, there is the "Go To Member" action located in Edit - Go To that is mapped by default to ALT+\. I think this was added in Visual Studio 2017.
This is what pops up which provides the desired functionality and a couple of options:
In Visual Studio 2015, View > Other Windows > Resource View. The keyboard shortcut is Ctrl+Shift+E. I find this cleaner than Class View. With Class View Windows you can filter methods/attributes based on access modifier (private/protected/public) etc.
A nice clean way to do this is to use the command View.SynchronizeClassView by entering it into the Command Window (View > Other Windows > Command Window or Ctrl+Alt+A) but there's no way to do it automatically.
Additionally, you can:
pin your Class view window
collapse the top pane (listing all the classes)
And now it feels just like the Visual Assist's feature "List Methods in Current File" (which also list members btw).
At the top of your text editor, you should have a dropdown that lists all the methods, properties etc in the current type; and it's clickable (even if those members are defined in other files - in which case they're greyed out but you can still navigate with them).
Also, if you use the Class Explorer (Ctrl+Alt+C) to navigate your project, then you'll get a full overview of all your types. However, there doesn't appear to be a setting in Tools/Options that allows you to track the active type in that window (there is for the solution explorer) - perhaps a macro or addin is in order...
Microsoft doesn't feel like implementing this useful tool, but if by chance you can have Visual Assist, you have it in VAssistX > Tools > VA Outline. The plugin is not free though.
In Visual Studio 2005 and 2008 you can try the Source Code Outliner Power Toy.
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SourceCodeOutliner&DownloadId=3493
Do you mean the class view window (View->Class View, or Ctrl+W,C)?
You also have the intellisence popup-window
With Visual Studio 2010
You choose Tools->Settings->Expert Settings
On the left-bottom corner, you will see the tab "Class View" right next tab "Solution Explorer"
In the top area of "Class View" layout, you will see the list of class name, enum, struct, ...
In the bottom area of "Class View layout, you will see the list of member for these class, enum or struct
I have been using USysWare DPack since forever. It is very small and not intrusive so if all you want is a quick shortcut window showing list of methods of the current file you are using, it provides just that. Good thing is that the author is still active after more than 10 years just to keep providing the same features into latest VS release.
https://marketplace.visualstudio.com/items?itemName=SergeyM.DPack-16348
After installation, just use Alt + M to bring up the method list window. I prefer to show all members instead, but it's up to you.
In VS 2012, just go to View > Class View...then you get the Class View GUI in the main tab area. Now, drag this over to the side dock and you have the exact same layout as you would in Eclipse.
-e
My best way to do this is, that i open the Code Definition Window, under View -> Code Definition Window or press Ctrl + W,D .
And then i got it floated and i have the definitions of methods in separate windows.
Regards
grep -i " sub " filename.vb > methods.txt
grep -i " function " filename.vb >> methods.txt

Visual Studio 2008 -- Can I change which "add reference" tab is selected by default?

Every time you start Visual Studio, the first time you click "Add Reference" to add a DLL reference to a project, by default, the .NET tab on that dialog box is selected. As most people reading this have probably noticed, it can take a long time -- often more than 30 seconds -- for the full list of .NET components to fill in.
Because of the way we're designing our solutions, though, about 80% of the time, I want to select either from the "Projects" tab or from the "Browse" tab.
Is there a setting anywhere in Visual Studio that will let me make "Projects" be the first tab that loads up? Does anyone know any other, hidden tricks to accomplish the same effect?
I use this tip to do this in a different way. Open your Object Browser (Cntrl + Alt + J). Change Browse dropdown to "My Solution". Select the project you want. On Toolbar, click "Add to References in Selected Project in Solution Explorer".
A neat work around which has saved me many hours.
If you have the PowerCommands for Visual Studio 2008 installed, there is functionality to copy-paste references between projects, as well as copy-paste individual projects as references, all without opening the references dialog.
I have never found anywhere that allows you to change the default tab. And yeah, it's annoying how long that window can take to load. I think this is something that we just have to live with.
Tuna Toksoz has created a Fast Add Reference dialog plugin for Visual Studio.
http://devlicio.us/blogs/tuna_toksoz/archive/2009/06/18/vs-addin-fast-add-reference-dialog-no-more-coffee-break.aspx
Another tip you might consider is that if you reference a type in another project, ReSharper will notice it and offer to add it to your references for you.
With this, I never visit that tab unless I have file dll references to add.
I am afraid the answer, as far as I can tell, is no. I even took a trip through the registry to determine if there was someway to reorder the tabs. You might be able to do it with a hex editor but I would advise against that.

Resources