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

Double space needed to "refresh" Ionide type checker

Open isaacabraham opened this issue 4 years ago • 4 comments

Describe the bug

Sometimes Ionide doesn't "refresh" itself when there are changes to the code e.g. intellisense or coloration isn't refreshed. I've seen that sometimes hitting two spaces (honestly!) will refresh the typechecker. Nothing else does it short of a reset, but for some reason two spaces does the trick.

Expected behaviour

The type checker should never get out of sync, but if it does, it's unclear why double-space refreshes it.

Machine info

  • Windows
  • .NET SDK version: 5 or 6
  • Ionide version: 5.9.0 but I've seen it in earlier versions for a while now.

isaacabraham avatar Nov 09 '21 23:11 isaacabraham

Hey @isaacabraham :wave:,

Thanks for backing our project. If possible, We will handle your issue with priority support. To make sure we don't forget how special you are, we added a backer label to your issue.

Thanks again for backing us :tada:!

I have same issue all the time. If I change something in one file and it affects the other, I have to edit anything in that other file, like hitting a space and backspace and then all the checking and what-else kicks in.

witoldsz avatar Dec 12 '21 12:12 witoldsz

I have the same issue. Need to press space then delete the space to get syntax highlighting to kick in.

UPDATE: I also get this issue when opening a folder in VSCODE. I tend to leave files open when I close VSCODE, and they are opened automatically next time I start it. The selected file does not have syntax highlighting, but other opens files do. Same solution works: space/delete space. Also, I often see errors (red squigglies) in Expecto test files. Again space/delete space solves this.

mrboring avatar May 10 '22 17:05 mrboring

my guess based on these reports is that:

  • VScode opens the file
  • VSCode sends 'textdocument/opened' messages to the LSP
  • FSAC starts typechecking
  • VSCode sends highlighting/etc requests
  • those endpoints try waiting for a tiny bit for 'recent' typecheck responses
  • those endpoints stop waiting
  • FSAC finishes typechecking

a fix for this might be to force those endpoints to wait for fresh typechecking responses instead of trying to find recent ones

baronfel avatar May 10 '22 18:05 baronfel