In Visual Studio 2015, I had coloring for the indent guides like this.
I can't seem to find this feature in Visual Studio 2017. Is there an extension that does this?
There's an option in the Fonts and Colors to change the color for all Guidelines. But what I want is the same in 2015 where it's automatically color coded (blue, green, teal, purple, etc.) depending on the type/level of the braces.
I think this is just what you want.This is that extension called "Indent Guides".
The number behind the '#' on behalf of the different level of the Indent Guides.
I know my answer looks terrible. Please forgive me. As a new one here, i really try my best.
Native in VS2017. It's called "Structure Guide Lines"
There is no such feature built into VS2015. It is added by extensions.
Eg. the "Structure Visualiser" from Productivity Power Tools.
However for 2017 there is a (lesser) feature built in, so the Productivity PowerTools 2017 does not include this feature. (It is now also a set of separate extentions rather than a monolithic tool.)
This is explained in a blog post see section What's Missing?
There is also an excellent extension for Visual Studio 2015 called Indent Guides that is working really well.
It is not compatible with VS2017 by default, but you can get around that by modifying the extension manifest file within the vsix file:
1) Download IndentGuide v14.vsix for VS2015
2) Use 7-zip (or other archive utility) to open the .vsix file (which is actually a .zip)
3) Edit the extension.vsixmanifest file within the .vsix file
4) Make a copy of the whole VisualStudio Version="14.0" section
5) Change that new copy to VisualStudio Version="15.0"
6) Save the manifest, save the vsix.
7) Double-click the .vsix file to install it. Ignore the compatibility warning.
This really should be a comment, but as I do not have enough reputation to make it, an "answer" it is.
A uservoice was added to solicit feedback on missing features of the current Structure Visualizer added to VS2017. If you have an interest in seeing these features restored, please vote.
Improve the Structure Visualizer in Visual Studio 2017
In the German Version of VS2017 Enterprise the setting your looking for is called "Strukturführungslinien" in Options / Environment / Fonts and Colors. I would translate it with "structurelines".
Related
Im currently a C++ student in uni. I started using visual studio code configurated by a friend and then i changed to visual studio 2022 (the community version).
In visual studio code the code looks prrety much like this:
Then in visual studio it looks like this:
Does anyone know how to change the highlighted or at least can give me a hint? thanks!
I tried looking in the settings on visual studio but i got confused since there are many options and i dont know exactly what to change
You are probably looking for the Visual Studio Theme Pack extension, which brings the default VS code themes to VS. Also see this blog post for other converted popular VS code themes, and this blog post which describes a tool to convert any VS code theme.
Regarding the colored (rainbow) braces, there is the "Rainbow Braces" extension (corresponding blog post).
For further configuration, you might also want to have a look at the Visfora extension, which also includes rainbow braces.
Extensions aside, many of the colors can also be manually and individually configured in the Visual Studio's options → Environment → Fonts and Colors.
I have placed a .clang-format file in my project and can apply the formatting with Ctrl+K, Ctrl+D. I have also configured and enabled "Run Code Cleanup profile on Save" under Options -> Text Editor -> Code Cleanup. But when I save a file, the formatting is not applied.
Is there something I'm missing?
Thank you in advance!
Edit: Since it does not seem to be possible for C++ (as of June 2022), I will be using the extension Format on Save for VS2022 for now, which has a bit more functionality compared to Sedenion's suggestion.
You can use the free "Format document on Save" extension (github) to format C++ code via clang-format in Visual Studio 2022 on saving.
Side note, in case anyone else is reading this: In Visual Studio 2017 and 2019 you can also use the Microsoft extension "Power Commands for Visual Studio" for this purpose.
Unfortunately, Code Cleanup only applies to C# and VB.Net, and not to C++ code.
From MS documentation
For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup
How to stop the compilation of Visual Studio 2015 when it detects compile error?
I mean first build error (may be first .cpp), not first project because it takes too much time.
(I have only 1 project.)
An extension named "StopOnFirstBuildError" is not an answer,
because it stop on first project that has error.
Question
(more elaborate)
When I pressed F5 or Ctrl+Shift+B, the compiler would compile all (or some) files.
In my case, it can detect some errors using only 5 seconds, so I want it to stop compiling NOW.
However, the VS 2015 become non-responsive.
It also has strong resistance against Ctrl+Break.
It takes about 30 seconds before I can navigate to the location of error.
How can I stop the compile-process on the first compile error automatically?
History
There is an old thread asked about this for Visual Studio 2008.
Its most accepted solution is to go to :-
Visual Studio -> Tools -> Macros -> Macro IDE... (or ALT+F11)
and paste a certain piece of code.
However, macro is not supported anymore in VS 2012.
(I tried to press Alt+F11 in VS 2015, no macro editor / menu appear.)
The claim is consistent with a question for VS 2010 stated that the above trick is not work.
The solution for the VS2010 question is to install an extension named "CancelFailedBuild".
Thus, I downloaded it.
When executed .vsix (the installer), it said
"This extension is not installable on any currently installed products.".
... it makes sense because the extension said "Works with : Visual Studio 2010, 2012".
Now I think I am left with a single choice :-
Use macro (the old VS 2008 way) by installing Macros extension.
(The extension is a result of users' complain about losing the old macro feature.)
Is downloading the extension a good idea?
If so, what is the step after that? Is there a code that I should copy-paste?
If not, what is the easier way?
Sorry for posting a lot of hyperlinks.
Workaround
Below are the approaches that may alleviate some inconvenience, but do not answer the actual question at all.
Install a patch that make Visual Studio responsive, so Ctrl+Break works.
It requires me to press keyboard manually.
It seems to work only for Windows 7. (not tested)
Shorten compile time by creating a simple dummy .cpp, then compiling only that single file.
It is useful for some cases.
The solution for the VS2010 question is to install an extension named "CancelFailedBuild".
...
This extension is not installable on any currently installed products.
...it makes sense because the extension said that "Works with: Visual Studio 2010, 2012."
Visual Studio 2012 extensions are frequently compatible with VS2013 and VS2015. You can update the extension yourself by unzipping the .vsix file (it's just a ZIP archive) and updating its manifest (which is an XML file).
This guide shows you the XML elements to change.
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
I have a huge Visual Studio 2010 solution. I work with Visual Studio 2005, so I want to convert the solution to the desired version. Basically, it's a portable C++ code so it should compile on Visual Studio 2005 too. Changing the version in the *.sln file doesn't help because the *.vcxproj format is completely different from the old *.vcproj format.
Recreating the solution by hand is not an option because of its size. Also there may be some non-default compiler flags, dependencies, etc. that I don't know of (and I can't look through ALL this XML junk that I don't understand).
There is already a related question on How Do I Downgrade a C++ Visual Studio 2008 Project to 2005. However, the utility suggested there supports at most Visual Studio 2008.
Any suggestions?
It really totally sucks, that every proprietary IDE today thinks it needs to create its own project file format.
"Dear IDE developers, just use Makefiles and create a nice GUI for it so that also people without Makefile knowledge can use it!" In VS6 it was at least possible to import/export Makefiles, but not today anymore. And it was possible to use nmake for automated builds. No IDE needed to be installed, just the toolchain which could be grabbed by a simple checkout without installation.
I use CMake now. It's free, it's cross-platform, it is well supported in free IDEs like KDevelop, QtCreator, etc. It can generate Makefiles and Visual Studio projects.
So you maintain only one project source, the CMakeLists.txt file and can work with any IDE. No pain with different versions of Visual Studio or with other proprietary project file formats.
This way you can generate or VS projects for developing and you can generate Makefiles for commandline builds using nmake like in the good old days.
BTW, it's much easier to change settings in a CMakeLists.txt than clicking through various GUI dialogs. But this is a matter of personal preferences.
In my work made a utility which utilized the EnvDTE.dll and scanned a vcproj-file and optionally all vcproj-files within a sln-file. It compared all settings with a "template" and would issue a warning or optionally update the setting to correct values. We used this utility so that settings would be verified to be correct and consistent throughout all projects. I haven't updated the utility to 2010 yet due to other priorities.
EnvDTE hasn't changed much from Visual Studio 2008 to Visual Studio 2010. Perhaps it is possible to create a simple utility which opens the vcxproj-file using DTE100 and saves it using DTE90, or earlier.
Easiest way is probably to create a new project in VS 2005, and use the add existing item dialog to add the code to the project. I'd suggest using 'Empty Project' as the project type, so you don't have a lot of rubbish autogenerated for you that you'll just delete anyway.
I haven't tried it, but this looks promising:
http://www.emmet-gray.com/Articles/ProjectConverter.htm
edit: Nope, not promising, sorry :-(