-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Substring match algorithm #15474
Description
Related problem
We currently have two match algorithms exposed to users: prefix and fuzzy. Internally, we also have a positional: bool option. With prefix matching, when positional is false, we actually do substring matching instead. Custom completers can include positional: false in their options to take advantage of this. However, there's no way for users to enable substring matching for all completions in $env.config.
Describe the solution you'd like
I'd like a new match algorithm, substring, for doing substring matching. Users would then be able to do $env.config.completions.algorithm = "substring" to use substring matching for all their completions.
As for custom completers, they would still be able to set the positional for a couple of releases, with a warning being logged. After that, positional would be removed completely, possibly with an error being logged if a custom completer tries to use it.
Describe alternatives you've considered
We could add a $env.config.completions.positional option. This would also allow users to enable substring matching, but it's not as intuitive. positional also does nothing when used with the fuzzy algorithm. I'd prefer to just remove positional.
Additional context and details
No response