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

-> Autocompletion breaks "." autocompletion #99

Closed
ryyppy opened this issue Apr 8, 2021 · 3 comments · Fixed by #103
Closed

-> Autocompletion breaks "." autocompletion #99

ryyppy opened this issue Apr 8, 2021 · 3 comments · Fixed by #103

Comments

@ryyppy
Copy link
Member

ryyppy commented Apr 8, 2021

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.

@cristianoc
Copy link
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.

@alexeygolev
Copy link

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?

@cristianoc
Copy link
Contributor

cristianoc commented Apr 8, 2021

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants