Skip to content

Find all references doesn't work on closed files #52127

Closed

Description

  • VSCode Version: 1.24.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Use "Find all references" on a declaration while the file with the reference is closed
  2. Open the file with the reference
  3. Use "Find all references"

Does this issue occur when all extensions are disabled?: Yes

Activity

  1. added
    editor-symbols
    on Jun 18, 2018
  2. added
    info-needed
    and removed
    editor-symbols
    on Jun 18, 2018
  3. jrieken commented on Jun 18, 2018

    @jrieken
    Contributor
    • What language/extension are you using?
    • What does closed reference mean?
  4. kiyutink commented on Jun 18, 2018

    @kiyutink
    Author

    JavaScript, no extensions.
    I didn't mean closed reference, I meant to say that the reference won't be found, if the file with the reference is closed (not opened in the editor)

  5. removed
    info-needed
    on Jun 18, 2018
  6. mjbvz commented on Jun 18, 2018

    @mjbvz
    Contributor

    Do you have a jsconfig.json?

  7. added
    info-needed
    javascript
    on Jun 18, 2018
  8. kiyutink commented on Jun 21, 2018

    @kiyutink
    Author

    hmm, when i add a jsconfig.json it stops finding references even in opened files

  9. mjbvz commented on Jun 21, 2018

    @mjbvz
    Contributor

    Please share a minimal code example or small example project

  10. kiyutink commented on Jun 22, 2018

    @kiyutink
    Author

    Hey, I've done some checking and found out that it only happens if you search for references of a variable defined in a .jsx file. Unfortunately, I couldn't find how to configure the project to allow VS Code to enable it. To reproduce this you can just create two files as following:

    file1.jsx:
    export const a = 3;

    file2.jsx:
    import {a} from './file1.jsx'

    Then if you search for references of 'a' from file1.jsx you'll get different results depending on whether you have or don't have a jsconfig.json. If you don't have it you'll only see the reference of 'a' in file2.jsx if it's opened in the editor. If you have a jsconfig.json, you won't see the reference regardless of the file being opened in the editor or not.

  11. mjbvz commented on Jun 25, 2018

    @mjbvz
    Contributor

    In your jsconfig.json, make sure you set "jsx": "react" under compilerOptions. That should fix the problem

  12. locked and limited conversation to collaborators on Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-neededjavascript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions