mirror of
https://github.com/nushell/nushell.git
synced 2025-04-14 16:28:17 +02:00
Change logging
This commit is contained in:
parent
d651cc30e3
commit
7480fcdf16
@ -103,19 +103,19 @@ impl<T: Completer> Completer for CustomCompletion<T> {
|
||||
{
|
||||
completion_options.case_sensitive = case_sensitive;
|
||||
}
|
||||
let positional =
|
||||
options.get("positional").and_then(|val| val.as_bool().ok());
|
||||
if let Some(_positional) = positional {
|
||||
log::warn!("Use of the positional option is deprecated. Use the substring match algorithm instead.");
|
||||
}
|
||||
if let Some(algorithm) = options
|
||||
.get("completion_algorithm")
|
||||
.and_then(|option| option.coerce_string().ok())
|
||||
.and_then(|option| option.try_into().ok())
|
||||
{
|
||||
completion_options.match_algorithm = algorithm;
|
||||
if let Some(positional) =
|
||||
options.get("positional").and_then(|val| val.as_bool().ok())
|
||||
{
|
||||
log::warn!("Use of the positional option is deprecated. Use the substring match algorithm instead.");
|
||||
if !positional
|
||||
&& completion_options.match_algorithm == MatchAlgorithm::Prefix
|
||||
{
|
||||
if let Some(false) = positional {
|
||||
if completion_options.match_algorithm == MatchAlgorithm::Prefix {
|
||||
completion_options.match_algorithm = MatchAlgorithm::Substring
|
||||
}
|
||||
}
|
||||
|
@ -234,7 +234,6 @@ fn customcompletions_override_options() {
|
||||
&["Foo Abcdef", "Abcdef", "Acd Bar"],
|
||||
);
|
||||
|
||||
// positional: false should make it do substring matching
|
||||
// sort: true should force sorting
|
||||
let expected: Vec<_> = vec!["Abcdef", "Foo Abcdef"];
|
||||
let suggestions = completer.complete("my-command Abcd", 15);
|
||||
|
Loading…
Reference in New Issue
Block a user