Skip to content
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

When name's of a discriminated union type and module collide, intellisense in the context of a type definition will show the cases instead of the type name #1980

Open
MangelMaxime opened this issue Feb 4, 2024 · 0 comments

Comments

@MangelMaxime
Copy link
Contributor

Describe the bug

If I have type definition like this one in a file:

[<RequireQualifiedAccess>]
module Response =

    module Read =

        type Question = {
            Id: System.Guid
        }

    [<RequireQualifiedAccess>]
    type Read =
        | Found of Read.Question
        | NotFound

Then trying to define the type a variable will show the cases names instead of the Question record type.

CleanShot 2024-02-04 at 21 38 38@2x

Accessing intellisense from inside of the body of a variable declaration will however show the cases + record name/reference:

CleanShot.2024-02-04.at.21.39.39.mp4

Steps to reproduce

  1. Create an F# file with the following content:

    [<RequireQualifiedAccess>]
    module Response =
    
        module Read =
    
            type Question = {
                Id: System.Guid
            }
    
        [<RequireQualifiedAccess>]
        type Read =
            | Found of Read.Question
            | NotFound
  2. let x : Response.Read. Try to get intellisense while typing and see that the record name/reference is not here.

Expected behaviour

Intellisense in this context should only report the record name/reference because cases cannot be used for type definition.

Machine info

  • Operating system: Darwin
  • Arch: arm64
  • VSCode: 1.85.2
  • UI Kind: Desktop
  • Ionide: 7.17.0
  • Runtime: netcore
  • Dotnet version: 8.0.100

Additional context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant