Skip to content

QuickInfo for overloaded custom CE operator does not show info for specific resolved method #11612

@BrianVallelunga

Description

@BrianVallelunga

I was trying out the preview feature for custom computation expression keyword overloads and came across an issue with intellisense/tooltips. This is related to: https://github.com/fsharp/fslang-design/blob/master/preview/FS-1056-allow-custom-operation-overloads.md

The tooling should show each possible overload's documentation and parameters similar to how it is done in other languages such as C#. Instead, it only shows the first instance of the documentation.

I am totally new to writing computation expressions and only came across this when trying to contribute to Farmer and researching how overloaded keywords work.

Provide the steps required to reproduce the problem:

Here's a sample bit of code that must have the LangVersion set to preview in the project file.

type Person = { Name: string; Age: int }

type PersonBuilder() =
    member __.Yield _ =
        { Name = ""
          Age = 0 }

    member __.Run (person:Person) =
        person

    /// Creates a person with a given name and age
    [<CustomOperation "create">]
    member __.Create(person: Person, name: string, age: int) = 
        { person with 
            Name = name
            Age = age }

    /// Creates a person with a given name and birthdate
    [<CustomOperation "create">]
    member __.Create(person: Person, name: string, birthdate: DateTime) = 
        let now = DateTime.Now
        { person with 
            Name = name
            Age = now.Year - birthdate.Year }
                
let person = PersonBuilder()

let p = person {
    create "Fred" 31
    create "Fred" (new DateTime(1990, 9, 1))
}

Expected behavior

In VS both summaries should be shown as tooltips with the ability to arrow up/down between them to discover both method signatures.

Actual behavior

Only the first is shown.

Known workarounds

Hovering over the completed line create "Fred" (new DateTime(1990, 9, 1)) does show the correct tooltip, but there's no auto-completion help when just typing create and hitting space.

Related information

Provide any related information (optional):

  • VS 2019 16.10
  • F# 5
  • Using <LangVersion>preview</LangVersion>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-AutoCompleteautocomplete/intellisenseBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions