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

VS analyses with respect to saved files, not live buffers #5915

Closed
TIHan opened this issue Nov 16, 2018 · 1 comment · Fixed by #16176
Closed

VS analyses with respect to saved files, not live buffers #5915

TIHan opened this issue Nov 16, 2018 · 1 comment · Fixed by #16176
Assignees
Labels
Area-LangService-Diagnostics FCS code analysis, diagnostics, red squigglies Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@TIHan
Copy link
Contributor

TIHan commented Nov 16, 2018

Repro steps:

  1. In VS, create a a console app project (legacy or newer).
  2. Once created, add a file named 'File1.fs' above 'Program.fs'
  3. Open both files, each with their own window and make sure they are visible.
  4. For File1.fs, use the following code and save file:
module File1

let say () = ()
  1. In Program.fs, use the following code and save file:
[<EntryPoint>]
let main argv =
    File1.say()
    0
  1. With both files open, each in their own window and visible, modify, but don't save, 'File1.fs' by commenting out let say () = ().
  2. Observe that Program.fs is not giving an error, which it should (this is a bug).
  3. Close and re-open 'Program.fs', observe the error is still not appearing (this is a bug).
  4. Then save File1.fs.
  5. Also Observe again that 'Program.fs' is not giving an error, (this is a bug).
  6. Close and re-open 'Program.fs', the error should now be showing.

The main problem is in FCS, but changes may be required in VS also.

FCS does receive the current text from text buffers, but when other files are parsed and type checked, it doesn't take into account files it depends on are invalidated because we rely on timestamps when a file was last wrote. This is the reason why we have issues with rename when editing a file but not saving.

Imagine we fixed the problem in FCS, we still need to make changes in our VS tooling to pass this information along most likely.

The fix for this might not be easy, but an effective start would probably be a way to pass stamps from VS to FCS on documents like we do for projects.

@cartermp cartermp added this to the Unknown milestone Nov 16, 2018
@cartermp cartermp modified the milestones: Unknown / not bug, Backlog May 23, 2019
@dsyme dsyme added the Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. label Aug 26, 2020
@dsyme dsyme added Area-LangService-Diagnostics FCS code analysis, diagnostics, red squigglies and removed Area-FCS Area-LangService-API labels Apr 5, 2022
@dsyme dsyme changed the title [VS] Inconsistency with Analyzing open documents VS analyses with respect to saved files, not live buffers Apr 5, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
@T-Gro T-Gro assigned T-Gro and 0101 Oct 7, 2022
@T-Gro T-Gro modified the milestones: Backlog, November-2022 Nov 2, 2022
@vzarytovskii vzarytovskii modified the milestones: December-2022, Backlog Jan 5, 2023
@0101 0101 modified the milestones: Backlog, January-2023 Jan 5, 2023
@0101
Copy link
Contributor

0101 commented Jan 30, 2023

Fix is available as an opt-in setting, see #14033

@github-project-automation github-project-automation bot moved this from Future to Done in F# Compiler and Tooling Oct 25, 2023
@0101 0101 modified the milestones: Backlog, October-2023 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-Diagnostics FCS code analysis, diagnostics, red squigglies Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants