Skip to content

Find usages (find all file references / find all folder references) #66162

Open

Description

If you search the issues here on GitHub and on StackOverflow, you'll find that there is a ton of fragmentation around this feature for a few reasons:

  • Everyone is referring to different subsets of the feature
  • Everyone is calling it by different names (users coming from WebStorm will refer to it as "Find Usages")
  • VSCode actually already has this partially implemented, but it's hidden and not documented well.

This feature refers to three subsets of finding references:

1. Find all references of a symbol

VSCode has this already.

2. Find all references of a file

VSCode has this already, but few know about it, and the process for getting to it is unnecessary. Currently you need to use the "find all references" command on an import path that includes the file.

This is a very useful feature, and should be made available in the file explorer, for a file's context menu when right clicking it, as explained here. Additionally, there should be a command, References: Find All References of File as explained here.

3. Find all references of a folder

VSCode does not yet have this feature. When using this on a folder (made available in the context menu), it should show the references for all files inside that folder. A command might be useful here as well (References: Find All References of Folder).

Note:

I've already submitted a feature request mentioning this in the past, which was closed and suggested as an extension. However, it looks like I wasn't clear on what my request was, because VSCode has since implemented a lot of this functionality. And it's also clear that there's a lot of confusion around this among VSCode users.

Activity

  1. vscodebot commented on Jan 7, 2019

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. changed the title [-]Find Usages (aka Find all Folder and File References)[/-] [+]Find usages (aka find all file references / find all folder references)[/+] on Jan 7, 2019
  3. changed the title [-]Find usages (aka find all file references / find all folder references)[/-] [+]Find usages (find all file references / find all folder references)[/+] on Jan 7, 2019
  4. added
    feature-request
    on Jan 7, 2019
  5. korimas commented on Apr 4, 2019

    @korimas

    I spent one day for this, and the result was no way to achieve it.
    sadly.

  6. added
    editor-symbols
    on Apr 4, 2019
  7. alexilyaev commented on Jun 12, 2019

    @alexilyaev

    Jason Bacchetta (@jabacchetta) Was there any progress on this?

    For me, in simple ES6 code with export and import in several files, there's no way to find the references.

    If I right click the exported symbol and click Find All References, it will only find references in the open files in the editor, which is not so useful.

  8. jabacchetta commented on Jun 20, 2019

    @jabacchetta
    Author

    Alex Ilyaev (@alexilyaev)

    The features that I've requested here haven't been added yet, but what you're describing should work, if I understand correctly.

    Are you importing index.js files without explicitly using the entire path (leaving off index.js) by chance? If so, #66170 might be helpful.

    Edit: Woops, just noticed that you already solved your problem in issue above.

  9. alexilyaev commented on Jun 21, 2019

    @alexilyaev

    It only works after adding jsconfig.json, but still, you need to pick a specific export to search references for, you can't search for all references to the whole module (as you suggest).

  10. askhogan commented on Jul 5, 2019

    @askhogan

    This is the single biggest disappointment coming from WebStorm. VSCode wins in so many ways. The two areas that cause weekly pain are:

    1. Lack of ability to Find Usages of file, which is essential when refactoring or renaming or organizing folder structure.
    2. Lack of ability to rename a file and have the editor automatically change the references to the renamed file.
  11. baoanhng commented on Mar 15, 2020

    @baoanhng

    Finally in the backlog, which will take like 2 years or more. But at least there's a milestone.

    I can't believe people can keep using VSCode without a proper "find usages". It is the only reason I still stick with Sublime Text.
    For me as a PHP developer, there's no way you can deal with non-namespace, autoloaded methods and functions without find usages.

  12. jonlepage commented on Nov 20, 2020

    @jonlepage

    for now i found this solution but is really overkill and need a lot of configuration
    but here we go, all reference and connection between files imports exports.
    image
    Really need this in vscode, but without visual node, this will help on productivity on big project architecture.

    https://github.com/pahen/madge

    Hope to see a search files ref relations soon !

  13. tjx666 commented on Sep 18, 2021

    @tjx666
    Contributor

    Very useful feature

  14. liisi29 commented on Aug 22, 2022

    @liisi29

    Any news about this feature? 2 years past, still very much in need of it!

  15. tjx666 commented on Aug 22, 2022

    @tjx666
    Contributor

    I often think that vscode had already implememted find variable/type reference, why not imllements file reference. It should be easier.

  16. alexilyaev commented on Aug 25, 2022

    @alexilyaev

    EDIT:
    Works only on JS/TS files, not for CSS files for example


    I'm happy to say that today I found out that Find File References has been added to VS Code in the File Explorer and file tab context menu:
    image

    Now only missing Find Folder References (didn't find an open issue for that).

  17. liisi29 commented on Aug 25, 2022

    @liisi29

    "Find usages" for a function is also missing. How do you develop without that?
    This is currently the only thing that keeps me from migrating from Webstorm. But really.. how do you find your method references without "find usages"?
    And, no.. just semantic "find all from files" search will not do :D

  18. mjbvz commented on Aug 25, 2022

    @mjbvz
    Contributor

    Liisi Raidaru (@liisi29) That already exists: right click on the function and select find all references. It is built-in for JS/TS. For other languages you need to install an extension that adds support

  19. liisi29 commented on Aug 27, 2022

    @liisi29

    Liisi Raidaru (@liisi29) That already exists: right click on the function and select find all references. It is built-in for JS/TS. For other languages you need to install an extension that adds support

    Correct me if I'm wrong (and I really hope I am), but this only finds references in ONE file. Not in the whole application.
    "Find usages" in Webstorm finds the references in whole application and that functionality is exactly what I am missing (a lot!).

  20. mjbvz commented on Aug 28, 2022

    @mjbvz
    Contributor

    Liisi Raidaru (@liisi29) Try creating a jsconfig or tsconfig to define a JS/TS project

    Screen Shot 2022-08-28 at 9 21 30 AM

  21. alexilyaev commented on Sep 4, 2022

    @alexilyaev

    Liisi Raidaru (@liisi29) That already exists: right click on the function and select find all references. It is built-in for JS/TS. For other languages you need to install an extension that adds support

    Correct me if I'm wrong (and I really hope I am), but this only finds references in ONE file. Not in the whole application. "Find usages" in Webstorm finds the references in whole application and that functionality is exactly what I am missing (a lot!).

    By default without jsconfig or tsconfig (as mentioned above) VS Code only looks at the open files.
    I opened an issue about it way back but it was closed:
    #75341

  22. MarvinXu commented on Sep 9, 2023

    @MarvinXu

    Very useful feature. I have many outdated resources in my project that may no longer be referenced, but It's hard to find them all.

  23. zhibirc commented on Sep 18, 2023

    @zhibirc

    Doesn't work for *.js files in my installation, shows just the file itself. :) Not very useful.
    No special configs, no opened files except of one file that I'm trying to find occurrences of.

    Package info:

    Version: 1.82.2 (Universal)
    Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
    Date: 2023-09-14T05:59:47.790Z
    Electron: 25.8.1
    ElectronBuildId: 23779380
    Chromium: 114.0.5735.289
    Node.js: 18.15.0
    V8: 11.4.183.29-electron.0
    OS: Darwin arm64 21.6.0
    
  24. zhibirc commented on Sep 18, 2023

    @zhibirc

    Used this grep -r -n -I "<file_name>" ./ (recursive, show line numbers, skip binary files) to stay on VScode. But, unfortunately, without quick jump to items in search results. Feels like Slackware user in 2012.

    # wrap to alias function for easy usage
    findstr () { grep -r -n -I "$1" ./; }
    # usage example
    findstr wp-service
  25. eladchen commented on Apr 26, 2025

    @eladchen

    The fact this is not supported is amazingly ridiculous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor-symbolsfeature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions