Timo
Timo

Reputation: 9825

Access source code information from the Visual Studio editor

I'm trying to get into creating Visual Studio extensions. There are a few examples in the online documentation from Microsoft about creating custom stuff but I can't find anything on how to access Intellisense (or any other code analysis).

I know there are some questions about this topic (namely how do you get c++ Intellisense data in a visual Studio Extention?) but those are from 2012 or earlier and not up to date anymore (at least I hope so).

The following is only applied to C++ source code.

What I specifically want, is to examine the expression that the cursor is at. Then I want to check whether the expression is either

From those expressions I want to get the full qualified name (including the namespace) of the type / function and possibly the types of the function / constructor arguments. For example:

// ...
using namespace std;
auto x = max(1, 2);
// ...

Now, if the cursor enters max I need the full qualified name ::std::max and the argument types [int, int].

Another example:

// ...
using namespace std;
string s("my string");
// ...

Here I need the full qualified name ::std::string and the argument types [const char*, std::allocator].

Is this somehow possible? I'm also interested in partial solutions. Any guidance or hints to some sort of documentation is very welcome.

Upvotes: 0

Views: 168

Answers (1)

Related Questions