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

Provide fuzzier type member matching and more polished sorting. #629

Merged
merged 2 commits into from Apr 4, 2019

Conversation

olafurpg
Copy link
Member

@olafurpg olafurpg commented Apr 3, 2019

Fixes #620

Previously, the following completion returned empty results

class Foo { def getTimeStamp: Int = 42 }
new Foo().time@@

Now, the completion results include getTimeStamp.

Since we started allowing fuzzier results, we needed better sorting of
completion items in the same category. For example, in the following
example

class Foo {
  def toInt: Int = 42
  def instance: Int = 42
  def intNumber: Int = 42
}
new Foo().int@@

we want the results sorted in the following order

intNumber // because prefix match
toInt     // because literal substring match
instance  // last fallback

This improvement in sorting benefitted non-fuzzy non-type members too.
Previously, the query Iterator returned the order
BufferedIterator,Iterator because they were sorted alphabetically.
Now, the order is Iterator,BufferedIterator instead, a big
quality-of-life improvement.

Previously, the following completion returned empty results
```scala
class Foo { def getTimeStamp: Int = 42 }
new Foo().time@@
```
Now, the completion results include `getTimeStamp`.

Since we started allowing fuzzier results, we needed better sorting of
completion items in the same category. For example, in the following
example
```scala
class Foo {
  def toInt: Int = 42
  def instance: Int = 42
  def intNumber: Int = 42
}
new Foo().int@@
```
we want the results sorted in the following order
```scala
intNumber // because prefix match
toInt     // because literal substring match
instance  // last fallback
```

This improvement in sorting benefitted non-fuzzy non-type members too.
Previously, the query `Iterator` returned the order
`BufferedIterator,Iterator` because they were sorted alphabetically.
Now, the order is `Iterator,BufferedIterator` instead, a big
quality-of-life improvement.
@olafurpg olafurpg merged commit 1897147 into scalameta:master Apr 4, 2019
@olafurpg olafurpg deleted the local-sort branch April 4, 2019 06:34
@olafurpg olafurpg added this to the Metals v0.5 - Mercury milestone Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Case in-sensitive fuzzy matching for type members
1 participant