overview
When using vscode to write C++ code and right-click "Find all reference", I found that the response was extremely slow and very inaccurate. A workaround is to use gtags for the global component.
step
-
Install the gtag plugin in VSCode (installing the C/C++ GNU global plugin may be useful, but I haven't tried it)
-
Install global in ubuntu environment, installation method:
sudo apt install global
-
In the windows environment, go here to download the windows version of global, and configure the environment variables
-
In the source code root directory run
gtags .
-
At this point "Find all reference" works fine.
Further reading: VSCode correctly supports "Find all reference"