How to show uses of function in Visual Studio Code?

Visual Studio-Code

Visual Studio-Code Problem Overview


I am used from Pycharm to be able to press ctrl + click on a function definition and see the uses. Is there an equivalent in VSC?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

you can use shift+f12 for get better view of usage

https://github.com/Microsoft/vscode-tips-and-tricks

read this and you can get better idea

Solution 2 - Visual Studio-Code

2020-03-05 update

You can CTRL+CLICK (Windows) or CMD+CLICK (Mac) on the function name and look on the right column.

Solution 3 - Visual Studio-Code

There is, but VSCode doesn't support key bindings with mouse buttons. The relevant issue is #3130. That means that it will not work the same way as it works in PyCharm.

What You can do though is to use - I believe - ShiftF12 or set some key combination to show all usages of function.

To do this You can press CtrlK, then CtrlS and click on 'keybinding.json' link in the sentence: "For advanced customization open and edit keybinding.json".
After getting keybinding.json open, add the following entry there.

{
    "key": "ctrl+shift+d",
    "command": "editor.action.referenceSearch.trigger",
    "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor"
}

It should let You show usages of function by pressing CtrlShiftD. Obviously, You can customize it however You like.

I also recommend adding the following entry to close the dialog with the same key combination.

{
    "key": "ctrl+shift+d",
    "command": "closeReferenceSearch",
    "when": "referenceSearchVisible && !config.editor.stablePeek"
}

Solution 4 - Visual Studio-Code

Right-click and select "Go to References" or "Find All References" from context menu:

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHakaishinView Question on Stackoverflow
Solution 1 - Visual Studio-CodeDileepaView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeCap BarracudasView Answer on Stackoverflow
Solution 3 - Visual Studio-CodekcprView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeDo AsyncView Answer on Stackoverflow