Skip to content

Conversation

@kerams
Copy link
Contributor

@kerams kerams commented Mar 23, 2022

Continuation of #12351, deals with 2 specific cases, which should now fully cover #5519.

No completions in an incomplete record declaration stub.

type A = {
    $
}

No completions when the caret is within a record declaration, but outside of all fields.

type A = {
    Field: string
    $
}

@auduchinok
Copy link
Member

No completions when the caret is within a record declaration, but outside of all fields.

@kerams Just in case, could you check that it doesn't break completion for compound type usages, when another type name is written after an existing field?

type Record =
    { Field: int {caret} // completion should be allowed here
    }
type Record =
    { Field: int ->
                 {caret} // completion should be allowed here
    }

@kerams
Copy link
Contributor Author

kerams commented Mar 24, 2022

If you don't type anything and place the caret there, you won't see any completions in your 2 cases with Ctrl-space. However, when you type the first letter, the position is immediately recognized as part of the preceding field type declaration, and Intellisense pops up automatically (with type-like suggestions only, thanks to the previous PR).

In the second case, because of the arrow it's apparent that a type is needed, so you technically could expect to get Intellisense without typing, but I don't think it's that big of a deal. To me it's a bit of an edge case and detecting it might be somewhat complicated (type A = { Field: int -> {caret} } is reported as containing no fields.).

Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change!

@vzarytovskii vzarytovskii merged commit 567ea95 into dotnet:main Apr 29, 2022
@kerams kerams deleted the autoc branch April 29, 2022 14:11
charlesroddie pushed a commit to charlesroddie/fsharp that referenced this pull request May 2, 2023
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

Successfully merging this pull request may close these issues.

4 participants