Skip to content
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

"Find All References" doesn't show unsaved references #3308

Closed
mattmccutchen-microsoft opened this issue Jul 5, 2017 · 4 comments
Closed
Assignees
Labels
Area-LangService-FindAllReferences Find all references across projects and solutions Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@mattmccutchen-microsoft
Copy link

"Find All References" doesn't seem to show references that have been added to an open file but not saved. This is inconsistent with the behavior for C#, which is to show references based on the latest available version of each file (the editor content if the file is open, otherwise the content on disk). Is this expected?

Repro steps

  1. Create a new F# library and add the following code to the file, but do not save:
type A = int
type B = A
  1. Right-click the first A and choose "Find All References".

Expected behavior

The reference from type B = A is shown.

Actual behavior

"No references found to 'A'".

Known workarounds

Save all files.

Related information

Nightly Visual F# Tools 15.4.1.17070403

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.14) Release
VisualStudio.15.Release/15.2.0+26430.14
Microsoft .NET Framework
Version 4.7.02046
@cartermp
Copy link
Contributor

cartermp commented Jul 5, 2017

This is expected, unfortunately. FCS requires the files to be saved on disk.

@vasily-kirichenko
Copy link
Contributor

It should work on private symbols where we use file check results, for example it should work on function arguments and local values and functions.

@mattmccutchen-microsoft
Copy link
Author

I guess an option would be to prompt the user, "Added references in unsaved files will not be found. Do you want to save all files first?" with a "Remember my decision". Do we think that when there are unsaved files, a high enough percentage of "Find All References" requests relate to unsaved references that a prompt would be worthwhile? I hit this many times over the past few days and decided "Find All References" was unreliable and fell back to a text search, until today when I decided to investigate and file an issue.

@dsyme dsyme added Bug Area-LangService-API Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels Jul 11, 2017
@cartermp cartermp added this to the 16.0 milestone Aug 29, 2018
@cartermp cartermp modified the milestones: 16.0, 16.1 Feb 21, 2019
@cartermp cartermp modified the milestones: 16.1, 16.2 Apr 23, 2019
@cartermp cartermp modified the milestones: 16.2, Backlog Apr 30, 2019
@dsyme dsyme added Area-LangService-FindAllReferences Find all references across projects and solutions and removed Area-LangService-API labels Apr 5, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
@0101 0101 self-assigned this Mar 16, 2023
@0101
Copy link
Contributor

0101 commented Apr 20, 2023

This has an opt-in fix available: #14033 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-FindAllReferences Find all references across projects and solutions Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Archived in project
Development

No branches or pull requests

5 participants