Skip to content

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

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

Open
BrianVallelunga opened this issue May 28, 2021 · 3 comments
Labels
Area-LangService-AutoComplete autocomplete/intellisense Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@BrianVallelunga
Copy link

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>
@cartermp
Copy link
Contributor

cartermp commented May 30, 2021

This is an interesting feature request. It would require work at the language service level and the IDE level to trigger signature help when typing.

The reason why it's a feature request is it's a new kind of overloading to be brought up into tools. There isn't such a concept today.

@BrianVallelunga
Copy link
Author

OK, thanks for the information.

@dsyme dsyme changed the title Custom CE keyword overloading does not trigger intellisense scrolling from corresponding summaries QuickInfo for overloaded custom CE operator does not show info for specific resolved method Oct 30, 2021
@dsyme
Copy link
Contributor

dsyme commented Oct 30, 2021

Note QuickInfo is showing the wrong hover tip as of VS2022 - it always shows the info for the last overload no matter what the resolution.

@dsyme dsyme added Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Feature Request labels Oct 30, 2021
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-AutoComplete autocomplete/intellisense Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Status: New
Development

No branches or pull requests

3 participants