nushell/crates/nu-cli/src
Yash Thakur 75105033b2
Use nucleo instead of skim for completions (#14846)
# Description

This PR replaces `SkimMatcherV2` from the
[fuzzy-matcher](https://docs.rs/fuzzy-matcher/latest/fuzzy_matcher/)
crate with the
[nucleo-matcher](https://docs.rs/nucleo-matcher/latest/nucleo_matcher/)
crate for doing fuzzy matching. This touches both our completion code in
`nu-cli` and symbol filtering in `nu-lsp`.

Nucleo should give us better performance than Skim. In the event that we
decide to use the Nucleo frontend ([crate
docs](https://docs.rs/nucleo/latest/nucleo/)) too, it also works on
Windows, unlike [Skim](https://github.com/skim-rs/skim), which appears
to only support Linux and MacOS.

Unfortunately, we still have an indirect dependency on `fuzzy-matcher`,
because the [`dialoguer`](https://github.com/console-rs/dialoguer) crate
uses it.

# User-Facing Changes

No breaking changes. Suggestions will be sorted differently, because
Nucleo uses a different algorithm from Skim for matching/scoring.
Hopefully, the new sorting will generally make more sense.

# Tests + Formatting

In `nu-cli`, modified an existing test, but didn't test performance. I
haven't tested `nu-lsp` manually, but existing tests pass.

I did manually do `ls /nix/store/<TAB>`, `ls /nix/store/d<TAB>`, etc.,
but didn't notice Nucleo being faster (my `/nix/store` folder has 34136
items at the time of writing).
2025-01-17 06:24:00 -06:00
..
commands Add run-time type checking for command pipeline input (#14741) 2025-01-08 23:09:47 +01:00
completions Use nucleo instead of skim for completions (#14846) 2025-01-17 06:24:00 -06:00
menus Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
config_files.rs Add auto option for config.use_ansi_coloring (#14647) 2024-12-26 11:00:01 -06:00
eval_cmds.rs Convert Path to list in main and preserve case (#14764) 2025-01-10 10:18:44 -06:00
eval_file.rs Convert Path to list in main and preserve case (#14764) 2025-01-10 10:18:44 -06:00
lib.rs Set current working directory at startup (#12953) 2024-09-25 13:04:26 -05:00
nu_highlight.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
print.rs Rely on display_output hook for formatting values from evaluations (#14361) 2024-11-19 21:04:29 +08:00
prompt_update.rs stop the prompt from removing the last newline (#14590) 2025-01-02 09:48:35 -06:00
prompt.rs Make get_env_var return a reference to a Value (#13987) 2024-10-02 13:05:48 +02:00
reedline_config.rs Cut down unnecessary lint allows (#14335) 2024-11-15 19:24:39 +01:00
repl.rs Use non-canonicalized paths in shell integrations (#14832) 2025-01-15 13:21:58 +01:00
syntax_highlight.rs Remove unused FlatShapes And/Or (#14476) 2024-11-29 22:23:40 +01:00
util.rs Add auto option for config.use_ansi_coloring (#14647) 2024-12-26 11:00:01 -06:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00