Visual Studio 2017 "Go To Definition" for partial classes - visual-studio-2017

In our solution, we work with many partial classes. The implementation is spread over 2 files, whereas one of the files only contains auto generated code.
When I press F12 (Go to Definition) on instances of such classes, VS 2017 displays a list of declarations (2 files) instead directly opening the "non auto-generated" file, like older VS versions do.
How can I get the old behavior again with VS 2017?

Visual Assist : Visual Assist has a wealth of features to enhance developer productivity.

Related

Visual Studio C++ Document Outline

I have CMake C++ projects in Visual Studio 2022 and would like to view the document outline for cpp/h files. But the Document Outline view is not available for this file type:
In VS Code, with the C++ extensions installed, there is a nice outline view:
But for various reasons, I need to use Visual Studio (not VS Code). I have diligently searched the extensions on Visual Studio Marketplace and found nothing that does this. It is surprising that as powerful as Visual Studio is, there is no outline view for C++ files. It seems like such an obvious feature -- I can't possibly be the only one who has ever needed it. Does anyone know of an extension for this?

Can Intellisense in Visual Studio 2017 suggest C++ headers to include?

Coming from a primarily C# background, I used ReSharper for many years. Being able to place my cursor on an unresolved reference, hit Alt+Enter, and select an option to add the appropriate using statement was invaluable. Now, Visual Studio 2017 has this capability natively! With this (and many other features added in VS2017) I got rid of ReSharper and am enjoying a very fast and responsive Visual Studio experience.
I've recently started doing some work in C++, and while I do get suggestions from Intellisense about fields and methods, when it comes to an unresolved reference it doesn't suggest any headers to #include.
My question is whether or not Visual Studio 2017 added the feature to suggest #include options for C++ or not? After scouring around, it seems Visual Assist X and ReSharper C++ have this feature, but I can find nothing detailing whether this feature is now available natively (and if it is, how do I enable it?) or whether it is still an extension exclusive.
It seems Intellisense does not, as of Visual Studio 2017, support suggesting headers to include for C++ types. As recommended by #Jack Zhai-MSFT, I have opened a user-voice issue for this request.

Cannot associate .hpp, .cpp extensions with visual studio 2017RC in Windows 10

You know my question. Here is the longer version. Downloaded 2017RC, it took me a day to set it up to work with UCRT, CMake, Google test and all the goodies. Then I tried to associate the usual hpp, h, cpp extensions two ways:
Control panel -> Default Programs -> Set Default Programs, choose Visual Studio 2017RC and then -> Set Program Associations where all the possible extensions that can be handled by this program are listed. None of the usual C++ extensions are listed.
Right click on a .cpp file, Open with, visual studio 2017 RC doesn't show up in the apps list, hunt it down and click on it. A dialog box pops up saying that The program you have chosen cannot be associated with this file type.
FYI, currently all the c, C++ extensions are associated with Qt. Am I to think that RCs are not expected to have this feature? Or is it some other sub-program within VS, with which the association should be made? Thanks for your help
I had the same problem for Visual Studio 2015. The answer here is a good starting point:
https://superuser.com/questions/977271/windows-10-visual-studio-2015-xaml-file-association
Specifically, modifying "HKEY_CLASSES_ROOT.cpp". I changed the (Default) String value to VisualStudio.cs.14.0 and it now opens .cpp files in Visual Studio 2015.
You would have to use whatever version Microsoft has for Visual Studio 17. Take a look at an existing working file extension to see what it uses.
As usual, backup everything before messing around in the Windows registry.
For what it's worth, Microsoft appears to have fixed this bug, and will apparently be releasing the fix in the next release:
https://developercommunity.visualstudio.com/content/problem/3122/vc-file-association-not-correct.html

Visual Studio environment alternative

I use Visual C++ (7.1 and 8.0) on huge C++ project. The solution contains thousands of files. Visual Assist helps in jumping to function and class definitions. The problem is that it sometimes becomes too slow. I just can't edit a single letter without delay.
Is there some alternative to this environment? I mean something that may read .sln and .vcproj files, use MSVC debugger, compile with MSVC compiler or even use IncrediBuild if necessary. I don't need any sophisticated features. It should be possible to find and open a file by name and jump to function/class definition from place where it is used.
May be Vim with some plugins? Or something else?
It seems there is no alternative to MS Visual studio. I've added separate HDD for source files and it works much better.
Currently i left Visual studio because c++ support just sucks (still using Visual studio 2013 but only for C# projects)
i use NetBeans right now, and really enjoy the refactoring part.
The visual C++ compiler support can be added using a free plugin (VCC4N - Visual C++ Compiler For NetBeans)
good luck

How visual studio intellisense recognize functions and properties in classes even though there is no reflection in C++?

I want to list properties and functions present in c++ classes. Is that functionality already implemented in any library ? Does visual studio intellisense use any library ? Is that library available publicly from Microsoft?
Visual Studio parses your code, so that's how it knows. You would need to do the same.
The Visual C++ team maintains a blog that has had several very nice articles about how IntelliSense has worked in the past and how it will work in the future:
IntelliSense History, Part 1
IntelliSense, Part 2 (The Future)
Visual C++ Code Model
Rebuilding Intellisense
Visual C++ Code Model in Visual Studio 2010
Essentially they build their own 'reflection' database (the .ncb file in current and past version sof VS, using a compact SQL database starting with VS2010) by parsing the headers and other source files - using both custom parsers and parsing that's done with the cooperation of the compiler.
Apparently at least some of that information is available in the VCCodeModel and related interfaces that the Visual Studio extensibility model provides. I have no idea how well the extensibility model works or how easy it is to use.
They use a propriety format to store intellisense information (they are saved as NCB files). You can delete these files to force VS to recreate its intellisense database if things go wrong.
They then scan header files for class information as well as dependencies, then build the NCB file for future reference.
No, this library is not available for personal use.
Intellisense in C# is lots better than the one in C++
VS2010 will see C++ have the same intellisense features as C# currently enjoys.
I would imagine that Visual Studio uses the header files to provide Intellisense.