ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
850 stars 276 forks source link

Unusual characters in Ionide tooltip #1939

Closed Darkle closed 2 months ago

Darkle commented 9 months ago

Describe the bug

Unusual characters are appearing in the vscode tooltips when using Ionide.

Steps to reproduce

  1. Type something like asd in your code
  2. Hover over it
  3. You should see odd characters in the tooltip

Screenshots

Machine info

Additional context

https://discord.com/channels/196693847965696000/524660202864377896/1157997202128519188

Martin521 commented 7 months ago

I would consider this a compiler bug. Some new error message are "semi-formatted" (including newlines). I don't think they should be.

Darkle commented 2 months ago

Some additional context; it doesn't seem to happen in .fsx files: https://discord.com/channels/196693847965696000/524660202864377896/1229726085546119200

MrLuje commented 2 months ago

The character is a UnicodeCategory.ParagraphSeparator so I guess, it is a preformatted diagnostic as stated by @Martin521 On fs files it is a ParagraphSeparator but a regular \n on fsi files.

From what I see, it's directly coming from "F# Compiler" diagnostics https://github.com/ionide/FsAutoComplete/blob/bc827fb748e9b38615dda6f51732072e56bfdb1f/src/FsAutoComplete/LspServers/AdaptiveServerState.fs#L485-L488

A few questions :

baronfel commented 2 months ago

Good investigation @MrLuje! I think we can approach this in a few places: