Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the Tooltip markdown, render generic type names with multiple segments correctly #1298

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/FsAutoComplete.Core/TipFormatter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,8 @@ let private formatTaggedText (t: TaggedText) : string =
| TextTag.StringLiteral
| TextTag.Text
| TextTag.Punctuation
| TextTag.UnknownType
| TextTag.UnknownEntity -> t.Text
| TextTag.UnknownType -> t.Text
| TextTag.UnknownEntity
| TextTag.Enum
| TextTag.Event
| TextTag.ActivePatternCase
Expand All @@ -1075,7 +1075,8 @@ let private formatUntaggedText (t: TaggedText) = t.Text

let private formatUntaggedTexts = Array.map formatUntaggedText >> String.concat ""

let private formatTaggedTexts = Array.map formatTaggedText >> String.concat ""
let private formatTaggedTexts =
Array.map formatTaggedText >> String.concat "" >> (fun s -> s.Replace("``", ""))

let private formatGenericParameters (typeMappings: TaggedText[] list) =
typeMappings
Expand Down
2 changes: 1 addition & 1 deletion test/FsAutoComplete.Tests.Lsp/CoreTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ let tooltipTests state =
""
"**Generic Parameters**"
""
"* `'T` is `string`" ] // verify fancy descriptions for external library functions
"* `'T` is `System.String`" ] // verify fancy descriptions for external library functions and correct backticks for multiple segments
verifyDescription
13
11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let arrayOfTuples = [| 1, 2 |]
let listOfTuples = [ 1, 2 ]
let listOfStructTuples = [ struct(1, 2) ]
let floatThatShouldHaveGenericReportedInTooltip = 1.
sprintf "asd"
sprintf<System.String> "asd"

/// <summary>
/// My super summary
Expand Down
Loading