I want VScode to inform where a defined function is being called from.
file utils.js
function counter(){
console.log('counter');
}
export default counter;
file index.js:
import counter from './utils';
counter();
I want to know in counter function definition in utils.js that it is being used at index.js
if the function counter is called in different files I want to get the information about where the function is being used | called from.
3
Answers
Thanks for the answers. I found that VScode has an inbuilt reference locater. Just right-click the function and select the option find all references, and VScode will locate all the references to that functions Shortcut: Alt + Shift + F12
Explain: Browser log should show the whole callstack where the error should throw
As stated by @hUwUtao, the callstack has the information about the callers of your
counter()
function when it is executing. If you want to find references without executing, VS Code can do this by right-clicking the function, then selecting Go to References, as seen in the following screenshot.