fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Comments get decolorized in some newly created projects

Open psfinaki opened this issue 1 year ago • 6 comments

Repro steps

  1. First create a new F# Console App
  2. Then create a new F# Console Application(.NET Framework)
  3. Observe Program.fs

Expected behavior

All good, nothing special happens.

Actual behavior

In a few minutes, comments go gray:

945492ac-8132-4236-8f8c-60555a282950

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.

psfinaki avatar Mar 18 '24 11:03 psfinaki

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

psfinaki avatar Mar 18 '24 11:03 psfinaki

Need to see if it's even an F# thing. Not many templates have comments there right away, so it's not clear yet.

psfinaki avatar Mar 18 '24 11:03 psfinaki

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:

  1. Roslyn asks us about both syntactic and semantic highlighting for specific ranges in document
  2. We just return what's on these ranges
  3. 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.

vzarytovskii avatar Mar 18 '24 12:03 vzarytovskii

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.

majocha avatar Mar 18 '24 12:03 majocha

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 :)

vzarytovskii avatar Mar 18 '24 12:03 vzarytovskii

Oops, just right now. Opening FSharp.sln with some preopened documents. image

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:

image

majocha avatar Mar 18 '24 12:03 majocha