diff --git a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs index e4bb923b9e9..db8298d826f 100644 --- a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs +++ b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs @@ -69,9 +69,12 @@ module InlineParameterNameHints = symbol.DeclaringEntity |> Option.exists (fun entity -> entity.CompiledName <> "Operators") + let isNotCustomOperation = + not <| symbol.HasAttribute() + (symbol.IsFunction && isNotBuiltInOperator) // arguably, hints for those would be rather useless || symbol.IsConstructor - || symbol.IsMethod + || (symbol.IsMethod && isNotCustomOperation) else false diff --git a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs index 998cb78bdce..60b7fa0f0e4 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs @@ -478,4 +478,17 @@ let test sequences = let actual = getParameterNameHints document - Assert.AreEqual(expected, actual) \ No newline at end of file + Assert.AreEqual(expected, actual) + + [] + let ``Hints are not shown when CustomOperation attribute is detected`` () = + let code = + """ +let q = query { for x in { 1 .. 10 } do select x } +""" + + let document = getFsDocument code + + let actual = getParameterNameHints document + + Assert.IsEmpty actual \ No newline at end of file