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

After opening diff editor, analysis temporary goes wrong #1810

Closed
vain0x opened this issue Dec 27, 2022 · 9 comments
Closed

After opening diff editor, analysis temporary goes wrong #1810

vain0x opened this issue Dec 27, 2022 · 9 comments

Comments

@vain0x
Copy link
Contributor

vain0x commented Dec 27, 2022

Describe the bug

When I open a diff editor of F# file and go back to a text editor, analysis (diagnostics, hover, rename) doesn't work, until I input in text editor.

Steps to reproduce

  • Assume an F# file (say Program.fs) is committed to git repository
  • Open Program.fs in a text editor tab
  • Open source control side bar, click Program.fs in it
  • Diff editor of Program.fs will be opened. Close it
  • In a text editor tab of Program.fs, hover doesn't work correctly

Link to sample reproduction

Expected behaviour

Analysis work as usual

Screenshots

peek-ionide-issue.mp4

Machine info

  • Operating system: Linux
  • Arch: x64
  • VSCode: 1.74.2
  • UI Kind: Desktop
  • Ionide: 7.4.0
  • Runtime: netcore
  • Dotnet version: 6.0.404

Additional context

In trace, VSCode sent a didOpen message with git: scheme URI to server:

[Trace - 22:17:08] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "git:/home/owner/repo/fs-playground/Program.fs?%7B%22path%22%3A%22%2Fhome%2Fowner%2Frepo%2Ffs-playground%2FProgram.fs%22%2C%22ref%22%3A%22~%22%7D",
        "languageId": "fsharp",
        "version": 1,
        "text": "module Program\r\n\r\nlet someFun () = ()\r\n\r\n[<EntryPoint>]\r\nlet main _ =\r\n    someFun ()\r\n    0\r\n"
    }
}

and didClose later:

[Trace - 22:17:12] Sending notification 'textDocument/didClose'.
Params: {
    "textDocument": {
        "uri": "git:/home/owner/repo/fs-playground/Program.fs?%7B%22path%22%3A%22%2Fhome%2Fowner%2Frepo%2Ffs-playground%2FProgram.fs%22%2C%22ref%22%3A%22~%22%7D"
    }
}

I guess, that didOpen message has written contents of text document in server cache, perhaps due to ignoring scheme.

@baronfel
Copy link
Contributor

That's a good guess - I think we'd need to make sure in FsAutoComplete that git-schemed URIs are just entirely ignored for open/close/etc notifications

@TheAngryByrd
Copy link
Member

ionide/FsAutoComplete#1031 FSAC issue

@sjohnsonaz
Copy link

I'm having a similar issue as well. Any time I open the a file from the "Source Control" panel for comparison, the original version is picked up for compilation instead of the current version.

@TheAngryByrd
Copy link
Member

As a workaround for noq, you should be able to save the file and type checking should come back.

@vain0x
Copy link
Contributor Author

vain0x commented Feb 8, 2023

Resolved at v7.4.1. Thank you!

@vain0x vain0x closed this as completed Feb 8, 2023
@sjohnsonaz
Copy link

Thank you for fixing this! I saw the GitHub release, but it's not available in the Marketplace yet.

@mrboring
Copy link

I also can't find this release in the Marketplace. Will installing it manually affect future auto updates?

@baronfel
Copy link
Contributor

We're having an issue with the release pipeline that we're digging into, but it is perfectly safe to install from the vsix on the GitHub release - VSCode will seamlessly pick up future updates.

@Krzysztof-Cieslak
Copy link
Member

7.4.2 is now available in VSCode Marketplace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants