Visual Studio plugin for collapsing C++ codes - c++

I want a Visual Studio plugin to collapse C++ code in visual. For example, I want to collapse the statements in a if block (as shown below). I know Visual Studio has the "outline" menu, but it doesn't seem to work well for me because it sometimes collapses macro defines and other things.
Does anyone know of a tool that can help me?

You need to enable this feature :
Tools -> Options -> Text Editor -> C/C++ -> Formatting -> check everything in "outlining"
Then, reopen the source file to reload outlining.
(PS. This works at least in Visual Studio 2008.)

I have been using Visual Assist X plugin for Visual Studio with great success. It can do what you are looking for and then a lot more.
Unfortunately this is not free software, but this is one of those developer tools that improve your productivity a lot and really worth paying for.

Related

Where is the place to add c++ Preprocessor Directives in Visual Studio 2015 Enterprise?

I saw questions similar to this for older versions of Visual Studio but not this latest version. I am following a course on Lynda.com and basically the instructor is trying to use C++ in a pure form that will look the same for students using a visual IDE on Mac. Anyway, the instructor sets up a Working project for teaching the language constructs and such. He right clicks on the project in Visual Studio and under C++ there is Pre-processor section.
I should note that he is using VS 2013 Community Edition. I have a more fully featured version of VS 2015. I don't see that option for defining pre-processor directives on a "project" basis. MS won't let me install 2 copies of VS 2015, but maybe it will let me install VS 2013.
Still, I hope my question makes enough sense as to what we are trying to accomplish, so that I can find the option in VS 2015 Enterprise.
Thanks,
Bruce
You would need to at least add a .cpp file to your Source Files folder in the the current project that you right will click. That should give you the option you are looking for in Visual Studio 2015.
Right click on your project. Select Properties. You should see the below menu where you can navigate to Configuration Properties > C/C++ > Preprocessor.
This is how I see it in my Visual Studio Enterprise 2015.
Is this what you're looking for?

Visual Studio 2010/2012 Add-in Project Questions

I have already created a simple source code analyses tool for C/C++, but I wanted it to be an extension or tool for Visual Studio 2010 and 2012 editions. It is written completely in C++. For this reason I created it using "Create an Add-in using Visual C++/ATL" option. And then under "Choose Add-in Options", I have some problems. I don't know which one or ones to select. I want it to have a name and icon under Tools section, but on the other hand, my code analyzer can be used from command line too. If someone can advice me which option(s) to select there I would be glad.
My second question is this, when I have opened a source file in Visual Studio, and if I go to Tools -> MyAddin, and press it, I want it to do its job and analyze the code, and show the results in the output section below.
And my last question is that, if I have a C/C++ project with few files let's say, and if I right-click one of the files, I want to see my add-in and be able to execute the add-in from there, not to go always to Tools -> MyAddin. And also the same thing to work if I right-click the project, then it should analyze the all files and show the problems in the output section.
Please note that I have already created the source code analyzer tool in C++, and I have it as a DLL. I can also use it in Linux from terminal, and if I want I can also create a GUI for it, which I plan to do later. But I'm not that much experienced with Visual Studio, especially about add-ins, that's why I need your help. As you can see my first question is a kind of advice, but I think my second and third questions require some source code. I know that it is very hard for you to give me some help without seeing my code, but if you would help me somehow I would be glad.
For Visual Studio 2010 and 2012 you should consider using Extensions, not Add-Ins. It is a new technology introduced in Visual Studio 2010. Extensions come in form of a VSIX packages and are automatically installed in all applicable versions of Visual Studio. If you are not targeting Visual Studio version prior to 2010, I strongly recommend using extensions.
From this point of view, I will not answer any of your technical questions about Add-Ins. Here are a couple of links to start using extensions instead:
Anatomy of a VSIX Package
Building and publishing an extension for Visual Studio 2010
VSX FAQ
Walkthrough: Creating an Options Page
I think you will find valuable information on this topic here: Developing extension packages for Visual Studio 2005/2008/2010/2012 using C# with real-life samples

Intellisense "Toggle Completion Mode" doesn't work with C++ in Visual Studio 2010 Professional

I am having problems with my "Toggle Completion Mode" under the Edit->Intellisense tab in Visual Studio 2010 Professional. The picture describes it quite well.
The completion mode works fine in C#.
Please help.
Thank you in advance!
There is no possibility to turn on suggestion mode on C++ IntelliSense (both in VS 2010 and 2012).
MSDN Library (for VS 2010) says:
Suggestion mode is available in Visual Basic and C#.
It was reported (link) as a bug in VS 2012 RTM and the answer from Microsoft was:
C++ Intellisense only has one completion mode, while VB and C# Intellisense has two different completion modes. Therefore, this command to toggle between completion modes is not available for C++ Intellisense.
If you're annoyed by inserting unwanted code after pushing space when you forget to press ESC you can make the member's list show up only after pressing ctrl+space (or alt+right arrow). In order to do that go to Tools -> Options -> Text Editor -> C/C++ -> General and uncheck Auto list members.
I know this was posted a long time ago but I figured I would offer my solution. I changed the shortcut to something that is not as annoying as ctrl + space. You can do this in Options -> Keyboard -> Edit.CompleteWord.
Hope this helps someone.

.Net-like IntelliSense for VC++?

Up until now in VC++, when I want to see everything I do :: . This shows all of my objects. Is there a way to make it like c# so it checks as you type without needing :: . Thanks
I don't know of a free way to do this, but you could check out Visual Assist.
Use Ctrl+Space to force intellisense to display itself.
Intellisense doesn't do a good job sometimes for C++ projects. They've fixed it's problems, but unfortunately the fix is only available in Visual Studio 2010.
The Visual C++ IDE in Visual Studio does not have the option "Show completion list after a character is typed," which is the specific option from C# that you're referring to. However, you can manually bring the completion list up at any point by typing Ctrl+Space
I'm a VA addict. However, Visual Studio comes with Intellisense...? (VA is just waaay better)

C/C++ codehighlighter in visual studio 2005

I just starting using VS2005 and I wish to have code highlighting in C/C++. The VS menu Tools->Options->TextEditor->C/C++ is very poor.
I come from PHP and there the IDE's are very friendly when is about highlighting. I didn't expect that Visual Studio to be so poor at this kind of options.
Can you recommend me a free tool/plugin/lib in order to have code highlighting for C/C++?
It's not free, but Visual Assist X has some really nice highlighting.
Another (suboptimal for you) solution is to switch editors. Emacs is infinitely configurable. I believe that Eclipse CDT and NetBeans have better syntax highlighting.
We also use Visual Assist X where I work; I would highly recommend it. Beyond simple highlighting it has refactorization tools, go to definition, auto completion and more.