Find all references (Experimental Version)
Would be great to have Find all references working. Huge helper in large projects.
@nevion, We are aware that this is a highly requested feature, and it has been relatively high on our backlog. However, we have a small team working on this extension, and our priority in the past year has been improving IntelliSense, especially making it easier to configure IntelliSense. Now we've finally got around to look at code navigation features, including to enhance GoToDefinition ( #255) and to add Find All References. Like @sean-mcmanus mentioned above, the implementation is non-trivial, so it may take a little bit of time, but we will get there and it won't be another two years :) You can expect an updated version of GoToDef next, and Find All References will come shortly after.
2 years since open... Hard to call an IDE supports c++ if it can't navigate the function callers. Is there any WIP branch we could help? Really need to get this working since moving from C# to C++ project, really don't want to move to eclipse.
Use cquery
@dbsquared The code that implements Find All References isn't open source, but you could possibly help with some of the issues in our open source TypeScript stuff (https://github.com/Microsoft/vscode-cpptools/labels/help%20wanted ). We may start work on Find All References in November, depending on how many Go to Definition issues we want to fix now or postpone till later.
@sean-mcmanus Why isn't the code open source?
@sguillia The main reason is our C++ front-end/parser is licensed/developed by a Third Party (see https://blogs.msdn.microsoft.com/vcblog/2009/05/27/rebuilding-intellisense/ ).
man, pls dont worry abt go to definition, it works just fine for me. Even if it doesnt work for some corner case, string search can easily workaround it. but find all reference is not easily get around in object oriented language. imagine how many class es could define add(), get() functions etc
if i were the PM, i would fill the blank area first before fixing minor bugs.
@dbsquared Some of the implementation is shared -- find all references on a symbol can't work correctly until we're able to obtain the correct symbol declaration, which is why we decided to do the IntelliSense-based Go to Definition work first; however, I think that shared code is already finished as of 0.19.1-insiders2. I was also thinking about switching to Find All References "right now", but the additional bug fixes for Go to Definition (i.e. overloads not defined in the TU, https://github.com/Microsoft/vscode-cpptools/issues/2677 ) is not expected to take "too long".
@dbsquared Some of the implementation is shared -- find all references on a symbol can't work correctly until we're able to obtain the correct symbol declaration, which is why we decided to do the IntelliSense-based Go to Definition work first; however, I think that shared code is already finished as of 0.19.1-insiders2. I was also thinking about switching to Find All References "right now", but the additional bug fixes for Go to Definition (i.e. overloads not defined in the TU, #2677 ) is not expected to take "too long".
Fair enough. Thanks for your patient and quick response!
Will the "Find All References" feature be available under "Tag Parser" mode?
I have tried another extension called "C++ IntelliSense", which is based on GNU Global tagging system and it works well. I think it's also possible to be implemented in "Tag Parser" mode.
Tag Parser mode won't be accurate enough, so we do not have plans to implement it in tag parser mode. Tag parser mode would give you results similar to VS Code's global search.
@bobbrow In a large project, global search and "Go to Symbol in Workspace" are both SLOW to use. I have tried other GNU Global based extension (e.g., C++ IntelliSense) which implements "Find All References" feature, and it's blazing fast and really convenient when browsing code. Without "Find All References", it's hard for me to choose "Tag Parser" mode of C/C++ extension over other tag-based extensions.
@hungys Sure, we can check if our implementation of Find All References is faster or better than VS Code's global search -- I believe the Tag Parser scenario would be the same code (so no significant additional work), just omitting the IntelliSense symbol filtering/checking, so it'll get results that are "unconfirmed", which matches VS's behavior.
AFAIK, VSCode is implementing List All References. I don't know the principles behind, but in my view as a user, it quite duplicates this issue in some way. Find All References = List All References + filter comment and Find All References in the whole project and include, while List All References in the workspace(?) I just hope that you can reuse or refer to save time when implement Find All References in this extension.
@LeThiHyVong List All References is available in VS Code Insiders and it's just a UI layer over the Find All References results that we return, i.e. any extensions that registers "Find All References" support gets "List All References" auto-added, just like "Peed Definition" is auto-added. However, we need support for async Find All References that dynamically updates as we get more/better results (like Visual Studio's C++ UI does) so VS Code's UI is currently insufficient (we're looking into a solution).
UPDATE: We got Find All References working for unconfirmed references (symbols with a matching name, but potentially not the correct type), but "confirming" the references hasn't been implemented and our priorities are shifting back to improving the configuration experience and improving performance, because too many new users are complaining about having problems configuring IntelliSense (and performance), so finishing this will be delayed.
2 years...
i find "C++ IntelliSense",it works.
Hi everyone,
If one needs to understand how real project on C++ works, then code explore is absolutely necessary. It is needed even before you start writing something.
Visual Studio Code works nice, automatically reads compilation_commands.json generated by cmake. But when you need just to fine the all places where the C++ method is used, which is basic action while exploring code, then you find that you cannot do it. You cannot. Dot. Searching is not suitable at all, because it gives a dozen of entries where "initialize" method is called, for example.
I am writing to you because I want Visual Studio Code to be usable. Really. Hope for understanding and hope to see find all references soon.
Best regards, Taras
“C++ IntelliSense” seems conflict with this. I hope cpptool can add this feature. Its quite useful when read and write c++ code
need this feature!!!
I have stopped using VSCode due to the absence of this feature. I recommend QtCreator for C ++ development.