diff --git a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs index ef6a49413dc..22affc41a77 100644 --- a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs +++ b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs @@ -123,7 +123,7 @@ type InlineParameterNameHints(parseResults: FSharpParseFileResults) = let curryRanges = getCurryRanges symbolUse let ranges = - if Seq.isEmpty tupleRanges then + if symbol.IsFunction || Seq.isEmpty tupleRanges then curryRanges |> List.toSeq else tupleRanges diff --git a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs index d179a792629..1607662a96c 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs @@ -4,6 +4,7 @@ namespace FSharp.Editor.Tests.Hints open Xunit open HintTestFramework +open FSharp.Test module InlineParameterNameHintTests = @@ -599,3 +600,42 @@ None let actual = getParameterNameHints document Assert.Equal(expected, actual) + + [] + let ``Hints are shown correctly in type constructors mixed with functions`` () = + let code = + """ +type X = | X of a: int list * b: string + +let x = X(List.map id [ 42 ], "") + """ + + let document = getFsDocument code + + let expected = + [ + { + Content = "a = " + Location = (3, 11) + Tooltip = "field a" + } + { + Content = "mapping = " + Location = (3, 20) + Tooltip = "parameter mapping" + } + { + Content = "list = " + Location = (3, 23) + Tooltip = "parameter list" + } + { + Content = "b = " + Location = (3, 31) + Tooltip = "field b" + } + ] + + let actual = getParameterNameHints document + + actual |> Assert.shouldBeEquivalentTo expected