ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
Unusual characters in Ionide tooltip
Describe the bug
Unusual characters are appearing in the vscode tooltips when using Ionide.
Steps to reproduce
- Type something like
asd
in your code - Hover over it
- You should see odd characters in the tooltip
Screenshots
-
- Discord user Christian's screenshot:
Machine info
- OS: debian linux bullseye
- .NET SDK version: 7.0.401
- Ionide version: v7.12.4
- vscode 1.82.2
Additional context
https://discord.com/channels/196693847965696000/524660202864377896/1157997202128519188
I would consider this a compiler bug. Some new error message are "semi-formatted" (including newlines). I don't think they should be.
Some additional context; it doesn't seem to happen in .fsx files: https://discord.com/channels/196693847965696000/524660202864377896/1229726085546119200
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 :
- can we reformat the message with linebreaks in FSAC https://github.com/ionide/FsAutoComplete/blob/main/src/FsAutoComplete/LspHelpers.fs#L101-L116 ?
- if yes, should it impact all IDE relying on FSAC ? (ex: does ionide-vim handle
ParagraphSeparator
properly or is also impacted by this issue ?) - or should it be fixed directly in compiler ?
Good investigation @MrLuje! I think we can approach this in a few places:
- Do the newline replacement on the message in FSAC
- Raise an issue/discussion on dotnet/fsharp for clarification about the intent here
- Longer term, this particular event could be moved to the new infrastructure that @nojaf and others have created where the diagnostic can contain data that would provide the suggestions directly instead of us having to format the new lines.