Skip to content

Commit

Permalink
allow exact match
Browse files Browse the repository at this point in the history
  • Loading branch information
frederik-uni committed Sep 29, 2024
1 parent 28b28f7 commit 0a8740d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargotom"
version = "0.13.3"
version = "0.13.4"
edition = "2021"

[dependencies]
Expand Down
5 changes: 3 additions & 2 deletions src/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,12 @@ impl Backend {
Some(
result
.into_iter()
.filter(|(crate_name, _, _)| !existing_crates.contains(crate_name))
.filter(|(crate_name_, _, _)| {
crate_name_ == &crate_name.value || !existing_crates.contains(crate_name_)
})
.map(|(name, detail, version)| CompletionItem {
label: name.clone(),
detail,
filter_text: Some(format!("{name} = \"")),
insert_text: Some(match root_dep.contains(&name) {
true => format!("{name} = {} workspace = true {}", '{', '}'),
false => format!("{name} = \"{version}\""),
Expand Down

0 comments on commit 0a8740d

Please sign in to comment.