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

Refactor autofill option #932

Merged
merged 1 commit into from Sep 18, 2019

Conversation

@tgodzik
Copy link
Collaborator

commented Sep 17, 2019

  • alternatives now start with ???
  • it only shows up when using named parameters or is explicitly called
  • doesn't auto-fill default arguments
    After suggestion from @olafurpg also:
  • add subtypes as valid values
Copy link
Member

left a comment

Thank you for looking into this!

s"${param.name} = $${${index + 1}${findDefaultValue(param)}}"
}
.mkString(", ")
val edit = new l.TextEdit(editRange, editText)
val filter = if (isExpilicitelyCalled) suffix else prefix + suffix

This comment has been minimized.

Copy link
@olafurpg

olafurpg Sep 17, 2019

Member

When is filter not "autofill"?

This comment has been minimized.

Copy link
@tgodzik

tgodzik Sep 17, 2019

Author Collaborator

It's always autofill, at least part of it. This is because I wanted it to be the last option and not show up before any legit completions. The suffix in that case is not that important, it just needs to be something so that it goes later in the list.

This comment has been minimized.

Copy link
@olafurpg

olafurpg Sep 17, 2019

Member

The sort text determines the order while the filter text determines what completion match what the user types. I'm struggling to understand the logic behind if (isExpilicitelyCalled) suffix else prefix + suffix, what is the difference between that and "autofill"?

This comment has been minimized.

Copy link
@tgodzik

tgodzik Sep 17, 2019

Author Collaborator

Ach right, I was wrong, this was done to show autofill when parameters are completed.
Nothing actually to do with sorting, sorry!

This comment has been minimized.

Copy link
@olafurpg

olafurpg Sep 17, 2019

Member

I would personally be in favor of not presenting autofill completions unless the user has typed a prefix of "autofill" or the empty string.

This comment has been minimized.

Copy link
@tgodzik

tgodzik Sep 17, 2019

Author Collaborator

Will leave it also when writing parameter names for now. I think it can be much more useful this way, otherwise nobody will find it. If that proves to be problematic, I will remove it myself.

@tgodzik tgodzik force-pushed the tgodzik:simplify-snippets branch from 912eb3a to 4980f66 Sep 17, 2019
Copy link
Member

left a comment

LGTM 👍

@tgodzik tgodzik force-pushed the tgodzik:simplify-snippets branch from 4980f66 to 521fb29 Sep 17, 2019
- alternatives now start with ???
- it only shows up when using named parameters or is explicetely called
- doesn't autofill default arguments
- add subtypes as valid values
@tgodzik tgodzik force-pushed the tgodzik:simplify-snippets branch from 521fb29 to baf3290 Sep 17, 2019
@tgodzik tgodzik merged commit bfe3ff5 into scalameta:master Sep 18, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
scalameta.metals Build #20190917.6 succeeded
Details
@tgodzik tgodzik deleted the tgodzik:simplify-snippets branch Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.