-
Notifications
You must be signed in to change notification settings - Fork 215
Fuzzy function name matching #466
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
Comments
Note to myself or anyone who may want to take this one: |
It seems easy enough to make it work. defmodule SuggetionMatch do
@moduledoc """
Documentation for `SuggetionMatch`.
"""
@doc """
Fuzzy match string
## Examples
iex> SuggetionMatch.match("map", "map")
true
iex> SuggetionMatch.match("map", "m")
true
iex> SuggetionMatch.match("map", "ma")
true
iex> SuggetionMatch.match("map", "mp")
true
iex> SuggetionMatch.match("chunk_by", "chub")
true
iex> SuggetionMatch.match("chunk_by", "chug")
false
"""
@spec match(name :: String.t(), hint :: String.t()) :: boolean()
def match(<<head::utf8, name_rest::binary>>, <<head::utf8, hint_rest::binary>>) do
match(name_rest, hint_rest)
end
def match(<<_head::utf8, name_rest::binary>>, <<_not_head::utf8, _hint_rest::binary>> = hint) do
match(name_rest, hint)
end
def match(_name_rest, <<>>) do
true
end
def match(<<>>, <<>>) do
true
end
def match(<<>>, _) do
false
end
end |
That's not the only place in elixir_sense that uses hint matching with |
Yup. I did notice other occurrences in the same module, and repeated implementation in other modules as well. |
So, the list of files where this could help, in ElixirSense:
|
Associated PR: #491 |
While fuzzy matching on function names has been merged there are other cases where it may be useful - see elixir-lsp/elixir_sense#122. Besides those I think we need to change matching algorithm in WorskpaceSymbolsProvider. |
Fixes elixir-lsp#242 Fixes elixir-lsp#541 Fixes elixir-lsp#466
* Bump elixir_sense Fixes elixir-lsp#242 Fixes elixir-lsp#541 Fixes elixir-lsp#466 * fix test
Typing
Enum.chub
I'd like to seeEnum.chunk_by
being suggested instead of terminating the auto completionThe text was updated successfully, but these errors were encountered: