Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Support infix completions #1267

Merged
merged 4 commits into from
Jun 2, 2019
Merged

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented May 23, 2019

closes #1259

  • [ ] More Documentation
  • More Tests.

@alanz
Copy link
Collaborator

alanz commented May 24, 2019

Looking good.

I think as time passes we are going to end up with ever more tightly focused contexts, so the completion gets more reliable.

@fendor fendor changed the title WIP: Support infix completions Support infix completions May 30, 2019
@fendor fendor requested review from lukel97, wz1000, lorenzo and alanz and removed request for lukel97 May 31, 2019 13:37
item ^. label `shouldBe` "filter"
item ^. kind `shouldBe` Just CiFunction
item ^. insertTextFormat `shouldBe` Just Snippet
item ^. insertText `shouldBe` Just "filter`"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add some assertions about the placeholders the function is suggesting after completing? It would be painful if the placeholders we suggest contain the left hand side of the function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The placeholders are the expected type? e.g. in the case of filter: filter' {2:[a]}?

Copy link
Collaborator

Choose a reason for hiding this comment

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

With backticks the placeholders should just drop the first element right? Because we can assume that the left hand side will supply the first argument

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I dont know. Is this really wanted? I find myself often writing such functions in exisiting expressions, normally I dont want these placeholders...

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is something that has crossed my mind too, but I think it needs a more general solution, to include in the context if there is anything to the right already, and in that case not offering placeholders

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe I am also misunderstanding the question. This particular completion omits the placeholders completely at the moment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So you are proposing that we keep it like that? Which could work. If anyone feels strongly about it we can add them again. I do think that infix operations tend to be binary, so the missing placeholder(s) is probable not an issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think it would be better and we can add it anytime.

Copy link
Collaborator

@lukel97 lukel97 left a comment

Choose a reason for hiding this comment

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

Asides from what @lorenzo said this looks good! By the way have you been able to get the tests running locally yet?

@alanz
Copy link
Collaborator

alanz commented Jun 1, 2019

I think we should wait for the more complete tests before merging this.

@fendor
Copy link
Collaborator Author

fendor commented Jun 1, 2019

Asides from what @lorenzo said this looks good! By the way have you been able to get the tests running locally yet?

Yes, with some workaround. First I dont use stack to get the hie executable, I just use the one on the path and then I can use cabal new-run :func-test

@alanz
Copy link
Collaborator

alanz commented Jun 1, 2019

Ok, LGTM, will merge after the pending monthly release.

@alanz alanz merged commit 637bff5 into haskell:master Jun 2, 2019
@alanz alanz added this to the 2019-06 milestone Jul 7, 2019
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 this pull request may close these issues.

Completions should be aware of infix backticks
4 participants