Comments get decolorized in some newly created projects
Repro steps
- First create a new F# Console App
- Then create a new F# Console Application(.NET Framework)
- Observe Program.fs
Expected behavior
All good, nothing special happens.
Actual behavior
In a few minutes, comments go gray:
Known workarounds
Start editing the doc, things go back to normal.
Related information
17.10.0 Preview 3.0 [34714.165.main], X64 and ARM64.
The ticket above in a copy from an internal backlog, we cannot repro this fully yet, but I can see something similar (colors disappearing right away without a few minutes' lag):
https://github.com/dotnet/fsharp/assets/5451366/450aa39f-bdd9-4233-a8f6-73a380680057
Need to see if it's even an F# thing. Not many templates have comments there right away, so it's not clear yet.
I know Petr P. had the same issue sometimes in his setup, but I didn't and we never figured out. Right now colouring (roughly) work as follows:
- Roslyn asks us about both syntactic and semantic highlighting for specific ranges in document
- We just return what's on these ranges
- Roslyn/vs colours it.
What I suspect can be happening: a. We return incorrect type for some range at some point for some reason. b. Roslyn or some other "extension" for some reason resets it at some point. c. There's some weird set of dogfood options for some accounts which reset colouring settings themselves for a brief period.
I don't see any other semantic colouring broken in the repros, as well as it's reported, that only new projects are affected, it's not critical, but we better investigate it since it can (theoretically) be affecting something else.
FWIW I've seen this quite often at some point when opening existing slns, but not recently. The only classification affected was the comment, everything else was normal, so I assumed it's some bug on VS side.
so I assumed it's some bug on VS side.
Yeah, that what I was thinking as well. I have never seen it in my setup. Like not a single time :)
Oops, just right now. Opening FSharp.sln with some preopened documents.
This is clearly the default plain text classifictation. Only the current document is affected when opening VS. The rest look fine. As soon as I do some edit in the file it gets back to normal. So this is minimal impact IMV.
Should look like this in my case: