nushell/crates/nu-lsp/Cargo.toml
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

35 lines
1.0 KiB
TOML

[package]
authors = ["The Nushell Project Developers"]
description = "Nushell's integrated LSP server"
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-lsp"
name = "nu-lsp"
version = "0.101.1"
edition = "2021"
license = "MIT"
[dependencies]
nu-cli = { path = "../nu-cli", version = "0.101.1" }
nu-glob = { path = "../nu-glob", version = "0.101.1" }
nu-parser = { path = "../nu-parser", version = "0.101.1" }
nu-protocol = { path = "../nu-protocol", version = "0.101.1" }
crossbeam-channel = { workspace = true }
lsp-server = { workspace = true }
lsp-textdocument = { workspace = true }
lsp-types = { workspace = true }
miette = { workspace = true }
nucleo-matcher = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
url = { workspace = true }
[dev-dependencies]
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.101.1" }
nu-command = { path = "../nu-command", version = "0.101.1" }
nu-test-support = { path = "../nu-test-support", version = "0.101.1" }
assert-json-diff = "2.0"
[lints]
workspace = true