You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Find all references doesn't work on closed files #52127
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)
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.
Activity
vscodebot commentedon Jun 17, 2018
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
jrieken commentedon Jun 18, 2018
kiyutink commentedon Jun 18, 2018
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)
mjbvz commentedon Jun 18, 2018
Do you have a
jsconfig.json?kiyutink commentedon Jun 21, 2018
hmm, when i add a jsconfig.json it stops finding references even in opened files
mjbvz commentedon Jun 21, 2018
Please share a minimal code example or small example project
kiyutink commentedon Jun 22, 2018
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.
mjbvz commentedon Jun 25, 2018
In your jsconfig.json, make sure you set
"jsx": "react"undercompilerOptions. That should fix the problem