ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

Changing branch requires a restart to get correct type checking

Open isaacabraham opened this issue 3 years ago • 6 comments

If you move from one branch to another, the type checker in Ionide does not realise that code has changed. Even rebuilding in the command line and then forcing a Clear Cache doesn't fix the issue - you need to reload VS Code. This causes confusion with users, particularly those using Ionide for the first time.

isaacabraham avatar Sep 27 '20 13:09 isaacabraham

I'm seeing this more and more now - sometimes not even when changing a branch.

(btw - for some reason this issue hasn't been tagged with the backer label - not sure why)

isaacabraham avatar Oct 20 '20 18:10 isaacabraham

Some more information on this one... not sure if it's about branching but even on scripts I'm seeing intellisense die necessitating a reload:

  Code: -32603 
[Error - 00:45:50] Request textDocument/completion failed.
  Message: no type check results
  Code: -32603 
[Error - 00:45:50] Request textDocument/completion failed.
  Message: no type check results
  Code: -32603 
[Error - 00:45:50] Request textDocument/completion failed.
  Message: no type check results
  Code: -32603 
[Error - 00:45:51] Request textDocument/documentHighlight failed.
  Message: Cached typecheck results not yet available
  Code: -32603 

isaacabraham avatar Nov 18 '20 23:11 isaacabraham

Some context: those aren't necessarily errors per se. in any situation where typecheck information isn't available you'll get them, and there might be a less blatant way of reporting that. This can be seen for example immediately after loading a large project while the initial project parsing and file typechecking is going on. Not saying you're not seeing an issue, just that I don't think these errors map 1-to-1 with the root cause of the issue.

baronfel avatar Nov 18 '20 23:11 baronfel

One thing I personally have noticed is that document formatting can sometimes stackoverflow, resulting in a restart of the language server. This is bad because when the server is restarted there's some initialization logic that doesn't seem to be running to return you to your old state (in terms of typechecking). For my work project where I see this, I've enforced that formatting on save be disabled to prevent this issue. Perhaps you are seeing the same.

baronfel avatar Nov 19 '20 00:11 baronfel

Hey, can you create reproduction for it - i.e repo with multiple branches and description of operations after which Ionide stops workin.

Krzysztof-Cieslak avatar Dec 14 '20 16:12 Krzysztof-Cieslak

Hi all, I'm getting the same when opening a project made with the Azure function and HttpTrigger templates. The project is new so no added code, just what the templates created. There is no git repository initialized so it doesn't seem to be a branching issue. Reloading doesn't seem to fix the issue.

Template install: dotnet new --install Microsoft.Azure.WebJobs.ProjectTemplates dotnet new --install Microsoft.Azure.WebJobs.ItemTemplates

Creating the project: dotnet new func --language F# --name testfunc dotnet new http --language F# --name HttpTrigger

dotnet version: 3.1.404 OS: Ubuntu 20.04.1 LTS Vscode: 1.5.2 Ionide: 4.17.0 Microsoft.Azure.WebJobs.ItemTemplates: 3.1.1648 Microsoft.Azure.WebJobs.ProjectTemplates: 3.1.1648

Firgeis avatar Dec 19 '20 15:12 Firgeis