Visual Studio Code version 1.27.2
Find all References only list references in the current file. I need to find all references across files in a project.
Is it possible ?
Something like find usages
If you right click a symbol and select "find usages". If the current symbol is a function, then "find usages" searches for all places where this function is called. If the current symbol is a variable, then "find usages" searches for all places where this variable is used etc etc.
3 Answers
Advanced features such as Find all references are implemented by each language extension.
For JavaScript, try creating a jsconfig.json at the root of your workspace with the contents:
{ "compilerOptions": { "target": "ES6" }, "exclude": [ "node_modules", "**/node_modules/*" ] } This file tells VS Code to treat all JS files in your workspace as part of the same javascript project. Find all references still may not work properly in JavaScript if your code is too dynamic. It works best against modern js that uses import/export, class, and friends
In Visual Studio Code you can do this by first highlighting the text you want to search for, then using the command: CTRL + SHIFT + F (pressing all at once).
CTRL + SHIFT + F is just a shortcut for accessing the search tab on the left-hand side of VSCode. Hope that helps and apologies for the scribbles :)
4Right-click on the variable and choose Find All References This is how it looks in VSCode
My About Visual Studio Code Info:
Version: 1.47.2 Commit: 17299e413d5590b14ab0340ea477cdd86ff13daf Date: 2020-07-15T18:18:50.054Z (5 days ago) Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Darwin x64 18.6.0 1
