
Closes #20391 ### Summary This adds a persistence layer to the command palette so that usages can persist after Zed is closed and re-opened. The current "usage" algorithm is unchanged, e.g.: - Sorts by number of usages descending (no recency preference) - Once a user's query is active, removes these suggestions in favor of fuzzy matching There are some additional considerations in order to keep the DB from growing uncontrollably (and to make long-term use ergonomic): - The "invocations" count handles max values (though at u16, it seems unlikely a user will deal with this) - If a command is un-invoked for more than a month, it stops being considered a recent usage, and its next update will update its usages back to 1 ### Future Considerations - Could make the "command expiry" configurable in settings, so the user can decide how long to hold onto recent usages - Could make a more sophisticated algorithm which balances recency and total invocations - e.g. if I've used COMMAND_A 100 times in the last month, but COMMAND_B 10 times today, should COMMAND_B actually be preferred? - Could do preferential fuzzy-matching against these matches once the user starts a query. Release Notes: - Added persistent history of command palette usages. --------- Co-authored-by: Peter Finn <mastion11@gmail.com> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
46 lines
1.2 KiB
TOML
46 lines
1.2 KiB
TOML
[package]
|
|
name = "command_palette"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/command_palette.rs"
|
|
doctest = false
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
client.workspace = true
|
|
collections.workspace = true
|
|
command_palette_hooks.workspace = true
|
|
db.workspace = true
|
|
fuzzy.workspace = true
|
|
gpui.workspace = true
|
|
picker.workspace = true
|
|
postage.workspace = true
|
|
serde.workspace = true
|
|
settings.workspace = true
|
|
theme.workspace = true
|
|
time.workspace = true
|
|
ui.workspace = true
|
|
util.workspace = true
|
|
telemetry.workspace = true
|
|
workspace.workspace = true
|
|
zed_actions.workspace = true
|
|
|
|
[dev-dependencies]
|
|
ctor.workspace = true
|
|
db = { workspace = true, features = ["test-support"] }
|
|
editor = { workspace = true, features = ["test-support"] }
|
|
env_logger.workspace = true
|
|
go_to_line.workspace = true
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
language = { workspace = true, features = ["test-support"] }
|
|
menu.workspace = true
|
|
project = { workspace = true, features = ["test-support"] }
|
|
serde_json.workspace = true
|
|
workspace = { workspace = true, features = ["test-support"] }
|