Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda syntax completion #3830

Closed
sirgl opened this issue May 11, 2019 · 0 comments · Fixed by #7487
Closed

Lambda syntax completion #3830

sirgl opened this issue May 11, 2019 · 0 comments · Fixed by #7487
Assignees
Labels
feature subsystem::сompletion Issues related to completion

Comments

@sirgl
Copy link
Contributor

sirgl commented May 11, 2019

It would be great, if closure syntax (with pipes) can be completed.
E. g. for:

pub fn map<O, F: FnOnce(T) -> O>(self, mapper: F) -> Spanned<O> {
   ...
}

fn use(s: Spanned<i32>) {
   s.map(<caret>)
}

Here I expect completion item |i| <caret>.

Name suggestion already implemented for introduce variable refactoring.
Also, after completion we can suggest change parameter's name.

@Undin Undin added feature subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. labels May 17, 2019
@Undin Undin added subsystem::сompletion Issues related to completion and removed subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. labels Oct 11, 2019
@ozkriff ozkriff self-assigned this Aug 10, 2020
@bors bors bot closed this as completed in 93298c7 Jul 14, 2021
bors bot added a commit that referenced this issue Jul 19, 2021
7551: COMP: Use suggestedNames() in lambda completion r=vlad20012 a=ozkriff

This PR attempts to improve lambda completion by re-using the existing `RsExpr.suggestedNames()` code for initial parameter names.

Related to #3830
Based on #7487

changelog: improve lambda's parameter name suggestion


Co-authored-by: Andrey Lesnikov <Andrey.Lesnikov@jetbrains.com>
bors bot added a commit that referenced this issue Jul 23, 2021
7482: COMP: fix RsCompletionTestFixtureBase::checkCompletion r=vlad20012 a=Kobzol

While working on #3830, I noticed that the function `RsCompletionTestBase::checkCompletion` does not behave correctly. If no testmark is passed to the function, it basically won't do anything, therefore the test will always succeed.

I changed `checkCompletion` so that it actually does something even without a testmark. It now also throws an error if the passed lookup string is not found.

There were a few tests that used `checkCompletion` without a testmark, so they passed even though they were actually failing. I tried to fix them.

Co-authored-by: Jakub Beránek <berykubik@gmail.com>
bors bot added a commit that referenced this issue Jul 23, 2021
7482: COMP: fix RsCompletionTestFixtureBase::checkCompletion r=vlad20012 a=Kobzol

While working on #3830, I noticed that the function `RsCompletionTestBase::checkCompletion` does not behave correctly. If no testmark is passed to the function, it basically won't do anything, therefore the test will always succeed.

I changed `checkCompletion` so that it actually does something even without a testmark. It now also throws an error if the passed lookup string is not found.

There were a few tests that used `checkCompletion` without a testmark, so they passed even though they were actually failing. I tried to fix them.

Co-authored-by: Jakub Beránek <berykubik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature subsystem::сompletion Issues related to completion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants