diff --git a/src/FsAutoComplete.Core/InlayHints.fs b/src/FsAutoComplete.Core/InlayHints.fs index 002b13572..584dd5421 100644 --- a/src/FsAutoComplete.Core/InlayHints.fs +++ b/src/FsAutoComplete.Core/InlayHints.fs @@ -946,7 +946,8 @@ let provideHints parameterHints.Add hint | :? FSharpMemberOrFunctionOrValue as methodOrConstructor when - hintConfig.ShowParameterHints && methodOrConstructor.IsConstructor + hintConfig.ShowParameterHints + && (methodOrConstructor.IsConstructor || methodOrConstructor.IsMethod) -> // TODO: support methods when this API comes into FCS let endPosForMethod = symbolUse.Range.End let line, _ = Position.toZ endPosForMethod @@ -1004,7 +1005,10 @@ let provideHints for (definitionArg, appliedArgRange) in parms do let! appliedArgText = text[appliedArgRange] - if ShouldCreate.paramHint methodOrConstructor definitionArg appliedArgText then + let shouldCreate = + ShouldCreate.paramHint methodOrConstructor definitionArg appliedArgText + + if shouldCreate then let hint = createParamHint appliedArgRange definitionArg.DisplayName parameterHints.Add(hint) diff --git a/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs b/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs index 8aa3ac17c..a0467c6ca 100644 --- a/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs +++ b/test/FsAutoComplete.Tests.Lsp/InlayHintTests.fs @@ -1140,6 +1140,33 @@ let private paramHintTests state = """ [ paramHint "uriString"; paramHint "uriKind" ] + testCaseAsync "can show param for method applied in curried form" + <| checkAllInMarkedRange + server + """ + $|System.Environment.GetFolderPath $0System.Environment.SpecialFolder.Desktop + |> ignore$| + """ + [ paramHint "folder" ] + + testCaseAsync "can show param for method called in tuple form" + <| checkAllInMarkedRange + server + """ + $|System.Environment.GetFolderPath($0System.Environment.SpecialFolder.Desktop) + |> ignore$| + """ + [ paramHint "folder" ] + + testCaseAsync "can show param for method called in tuple form with multiple parameters" + <| checkAllInMarkedRange + server + """ + $|System.Environment.GetFolderPath($0System.Environment.SpecialFolder.Desktop, $0System.Environment.SpecialFolderOption.Create) + |> ignore$| + """ + [ paramHint "folder"; paramHint "option" ] + testCaseAsync "can show param for name in backticks" <| checkAllInMarkedRange server