Skip to content

Commit

Permalink
include query item in search suggestions
Browse files Browse the repository at this point in the history
but only if it does not end with ".", since items with "." are partial
names only used to drill down to the actual package/option name.
  • Loading branch information
garbas committed Jul 8, 2020
1 parent af66eef commit 90bf815
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Search.elm
Expand Up @@ -644,7 +644,14 @@ getSuggestions query querySuggest =
result.suggest
|> maybeList (\x -> x.query |> maybeList (List.map .options))
|> List.concat
|> List.filter (\x -> x.text /= query)
|> List.filter
(\x ->
if String.endsWith "." (Maybe.withDefault "" query) then
x.text /= query

else
True
)

_ ->
[]
Expand Down

0 comments on commit 90bf815

Please sign in to comment.