vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

"Find all references" Not working

Open alexdima opened this issue 9 years ago • 22 comments

Moved from Microsoft/vscode#17070

From @dfroze


Version 1.7.2 Commit 7ba55c5860b152d999dda59393ca3ebeb1b5c85f Date 2016-11-21T22:14:18.217Z Shell 1.3.8 Renderer 52.0.2743.82 Node 6.5.0

Since the first time I installed the vscode till now (so it isn't only just recent), this feature never worked for me. It always showed an empty list. I thought that it was a cpptool problem but they never responded. Can anyone help me with it? Do I need to configure something !?

Thank you.

alexdima avatar Dec 12 '16 13:12 alexdima

What extension do you have installed? I assume the C/C++ extension? You may need to set your include paths by running C/Cpp: Edit Configurations and modifying the c_cpp_properties.json.

sean-mcmanus avatar Dec 12 '16 23:12 sean-mcmanus

Hy @sean-mcmanus. Thank you for the fast reply. Yes I have C/C++ extension. I have a big project that contains a lot of *.h in include folders and src folders, how should I set this in json? Do I have to add all possible paths to it? What about .c/.cpp files?

Also, just found the console and am seeing a lot of errors there. Not sure if there are from the extension or vscode.

Error: Error: Command failed: global --encode-path " " -xa config_data global: unrecognized option '--encode-path' Usage: global [-aGilnqrstTvx][-e] pattern global -c[qrsv] prefix global -f[anqrstvx] files global -g[aGilnoOqtvx][-e] pattern global -I[ailnqtvx][-e] pattern global -P[aGilnoOqtvx][-e] pattern global -p[qrv] global -u[qv] global --encode-path " " -xa config_data (exited with error code 2)

Error: Error: Command failed: global -u Warning: 'file name.odt' ignored, because it includes blank. Warning: 'file name.odt' ignored, because it includes blank. Warning: 'file name.odt' ignored, because it includes blank. Warning: 'file name.rc' ignored, because it includes blank. Warning: 'file name.pdf' ignored, because it includes blank. Warning: 'file name.pdf' ignored, because it includes blank. Warning: 'file name.pdf' ignored, because it includes blank. Segmentation fault global -u (exited with error code 1)A.logExtensionHostMessage @ extensionHost.ts:293 extensionHost.ts:293 [Extension Host] Object

I've modified the paths from warning, they don't point to the same file. Thank you for your help

dfroze avatar Dec 15 '16 13:12 dfroze

Sorry, I misunderstood your report originally. The C/C++ extension doesn't currently implement Find All References. The option shouldn't be shown for C/C++ files unless you have some other extension installed that is trying to handle it.

sean-mcmanus avatar Dec 15 '16 14:12 sean-mcmanus

You are right. It was an other extension. It would be great and a really helpful to have this feature working properly. I would like to help if possible.

dfroze avatar Dec 15 '16 16:12 dfroze

Issues #404 and #388 appear to be the same.

BillDenton avatar Jan 04 '17 11:01 BillDenton

Also seems to be the same as #361

BillDenton avatar Jan 04 '17 11:01 BillDenton

Is this on the roadmap? Is it technically difficult?

I feel like this highly useful navigation feature (the only approximation of "Call hierarchy" we can have for now) should be higher priority...

It's also a jarring user-experience, I spent a few minutes hitting Shift+F12 repeatedly and wondering why vscode was broken, until I found out that it worked everywhere else (python, typscript, go...) but c++.

eddy-geek avatar Mar 14 '17 08:03 eddy-geek

Yes, it's on the roadmap, but it's not first in line. We can't really do this very accurately until proper intellisense is added in. The tag parser we use for autocomplete right now doesn't have any semantic knowledge of symbols. It doesn't see local variables either.

bobbrow avatar Mar 14 '17 15:03 bobbrow

Actually, we have another issue tracking "find all references" (#15). I will close this one.

bobbrow avatar Mar 14 '17 17:03 bobbrow

The search tool (magnifying glass in the left-side toolbar) will display all references

dalbert2 avatar Jul 20 '18 17:07 dalbert2

@sean-mcmanus : Is "find all references" now supported ?

I am using VS code version 1.27.2 and the C/C++ IntelliSense extension.

princehektor avatar Oct 10 '18 22:10 princehektor

@princehektor No, it's not supported yet. Find all references is being tracked at https://github.com/Microsoft/vscode-cpptools/issues/15 . We're working on some of the pre-requisite implementation.

sean-mcmanus avatar Oct 10 '18 22:10 sean-mcmanus

My VSCode also cannot display the reference! And I have no idea about it. the message is: cannot find the reference of "ledName" image

lifuguan avatar Oct 25 '18 08:10 lifuguan

@lifuguan Our C/C++ extension doesn't not currently expose a Find All References command, so it must be coming from another extension.

sean-mcmanus avatar Oct 25 '18 18:10 sean-mcmanus

Just updated november version. The hotkey combination (shfit+fn+option+F12) is working but using mouse/click is not working. it happened on macbook.

mikedoan avatar Dec 14 '18 05:12 mikedoan

Have the same version on ubuntu 16.04 and windows:

Version: 1.30.1 (user setup) Commit: dea8705087adb1b5e5ae1d9123278e178656186a Date: 2018-12-18T18:12:07.165Z Electron: 2.0.12

"Find all references" feature is present on windows, but doesn't work. Absent on linux at all.

In my opinion this is basic code browsing feature. It is supported by ancient cscope plugin for vim. I don't get how do you guys prioritize the features for the IDE.

What should I do to make this feature released?

metal4people-zz avatar Jan 08 '19 17:01 metal4people-zz

@metal4people We have not shipped Find All References yet, see https://github.com/Microsoft/vscode-cpptools/issues/15 , so I'm not sure why you think it's present on Windows -- I assume from another extension. It is a feature near the top of our priorities, but we still have (lots of) users having problems configuring IntelliSense so we might make more fixes in that area first.

sean-mcmanus avatar Jan 08 '19 20:01 sean-mcmanus

Find All References is available in 0.25.0-insiders: https://github.com/microsoft/vscode-cpptools/releases/tag/0.25.0-insiders , but you'll need to set the C_Cpp.experimentalFeatures setting to "Enabled".

sean-mcmanus avatar Aug 09 '19 03:08 sean-mcmanus

I want to disable the find all references feature in cpptools, how to do that?

mkitby avatar Aug 22 '19 06:08 mkitby

There is no way to do that. Why do you want to disable it? You don't have to use the feature if you don't want to.

bobbrow avatar Aug 22 '19 16:08 bobbrow