Skip to content

Intellisense shows when defining fields in a record #5519

Closed

Description

@isaacabraham

This is a case where (in 15.8) I think VF# is too keen to provide intellisense. When I define the fields on a Record, VS eagerly shows me intellisense suggestions - even of types. There's no need for them in this case:

image

At best, it should suggest fields or names of symbols that are already in scope, but nothing more. I would be quite satisfied is it didn't show anything at this point, and in fact I actually find it quite annoying that it keeps popping up with suggestions.

Activity

  1. added this to the 16.0 milestone on Aug 16, 2018
  2. cartermp commented on Aug 16, 2018

    @cartermp
    Contributor

    The main issue is that there is no completion context for record field declaration, so it generates a full completion list.

    But looking into this there is just weirdness all around. For example, if you're instantiating a record, there is a completion context, but the things it gathers are more than just record labels (the function also gathers class fields).

    Additionally, consider the following:

    type R = { Data : string }
    
    { D }

    This will generate a completion list with 45 modules, the field contents from Ref<'T>, and the class R. The namespace Data replaces the Data field label due to de-duping logic that isn't aware of this context.

  3. cartermp commented on Aug 16, 2018

    @cartermp
    Contributor

    In short this is just one of many symptoms of something that seems like it needs a fundamental redesign in the language service, even without a parser change to provide additional context.

  4. TIHan commented on Aug 16, 2018

    @TIHan
    Contributor

    We will have to see how the parser behaves in this case when you have incomplete idents with no type. I suspect the parser won't be able to effectively tell us what context we are in when creating a record.

    It's not impossible, but very difficult if the parser doesn't help us out today.

  5. TIHan commented on Aug 16, 2018

    @TIHan
    Contributor

    If we were to try to tackle this, I would try to go for anything that wants ident : ?type, and it could provide some context on either side and we give the appropriate completions.

  6. modified the milestones: 16.0, Unknown on Aug 25, 2018
  7. kerams commented on Jun 14, 2022

    @kerams
    Contributor

    I've tested this is in 17.3 Preview 2 and it appears to be fully taken care of. @isaacabraham @vzarytovskii.

  8. vzarytovskii commented on Jun 14, 2022

    @vzarytovskii
    Member

    Going to close it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions