-
Notifications
You must be signed in to change notification settings - Fork 28.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Find All References in JS only shows references in open files #75341
Comments
Do you have a jsconfig.json file? See this comment on another issue. |
@gjsjohnmurray Indeed Basically, I think this should work out of the box. |
See the docs for more details on jsconfigs |
@mjbvz I understand the desire to close issues, especially when there's a working solution. May I suggest, though, to reconsider this one. There is a way that VS Code could provide a better experience for developers. But ideally, similar to how WebStorm works, VS Code could identify projects of certain natures and make a good guess by default, or at least offer a specific configuration based on the prediction (btw, WebStorm does that for many things like linters, file watchers, transpilers, etc.). |
Agreeing with @alexilyaev here, regardless of what the documentation says, this is a user experience bug. I just noticed this behaviour myself because it led to me introducing a bug into our production system, though I was sure that I had checked Find All References to confirm that the function I modified was only used in one place. If Find All References doesn't mean Find All References, then the name should be changed. |
@mjbvz maybe the extension implementing the ReferenceProvider in this case could at least show a warning message if there's no |
I also agree with @alexilyaev and @Jake-Convictional. If the feature functions only as "Find references in open files" without a valid One of the basic principles of UX is "don't surprise the user" and this is a clear and particularly bad violation of that rule. |
Issue Type: Bug
I've searched related issues:
I'm specifically talking about finding references of a symbol in JavaScript (ES modules) that is being
export
ed.Basically the opposite of Go To Definition (across files).
Reproduction Steps
doSomething
infile-a.js
>Find All References
Expected
Should show
file-b.js
in the results.Actual
file-b.js
in not shown in the results (unless it is already opened in the editor!)Notes
Updates based on comments
Adding
jsconfig.json
does solve this issue, based on this comment, BUT...I really think it should work out of the box.
Migrating from WebStorm, this is an expected behavior, considering the fact that I've opened a folder in VS Code (meaning that's the project I want to work on).
I manage many different projects, do I now need to add
jsconfig.json
in each and every one of them?This adds unnecessary friction.
Suggestion
I wish VS Code would just take a guess that I want all of the files in my project to be included for the Find All References feature.
Probably best to ignore
node_modules
and alike by default as well.System Info
VS Code version: Code - Insiders 1.36.0-insider (f291714, 2019-06-12T05:18:48.847Z)
OS version: Darwin x64 18.6.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: