Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

-> Autocompletion breaks "." autocompletion #99

Closed

Description

@ryyppy

Excerpt from this forum post by @alexeygolev:

The “->” autocomplete works in vim as described. However “normal” autocompletion for “->” is broken.

"hello"->Js. // no completion prompt here
Some("hello")->Option. // no completion prompt here

Pinned to 1.3.0 as I’d rather have the above. Not sure if this is the intended behaviour
Update: The same happens in VSCode.

So the desired behavior would be:

On >, trigger the function autocompletion, and on every further ., use the module content autocompletion.

Activity

  1. cristianoc commented on Apr 8, 2021

    @cristianoc
    Contributor

    There's no -> autocomplete yet for constants such as "hello", only for variables at the moment.

    The workaround for those examples for now is to leave a space -> Js..

    I guess when -> autocomplete does not lead to anything, it makes sense to handle . in the normal way.

    Side comment, after having played with autocomplete for a while, I am changing my uses of ->. Before I used any time it was possible, now I only use it when the lhs belongs to a module that is collection-style: i.e. that has a main type e.g. t and a bunch of functions on it.

  2. alexeygolev commented on Apr 8, 2021

    @alexeygolev

    There's no -> autocomplete yet for constants such as "hello", only for variables at the moment.

    The workaround for those examples for now is to leave a space -> Js..

    I don't think this is the case:

    let a = Some(a)
    
    a->Option. // no completion
    

    The best workaround for me is just staying on the previous version. It worked perfectly

    I guess when -> autocomplete does not lead to anything, it makes sense to handle . in the normal way.

    Side comment, after having played with autocomplete for a while, I am changing my uses of ->. Before I used any time it was possible, now I only use it when the lhs belongs to a module that is collection-style: i.e. that has a main type e.g. t and a bunch of functions on it.

    I have no idea what you mean to be honest. Modules like Option and Js.String work with built-in types so they don't have a type t. Does this mean that you wouldn't use -> for those modules?

  3. cristianoc commented on Apr 8, 2021

    @cristianoc
    Contributor

    Option and Js.String are about one specific type, even though they don't define it. That's what I mean. So I'd use pipe for them. Well, for Js.String2.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions