Merge pull request #99710 from oxalica/rust-analyzer
rust-analyzer: 2020-09-28 -> 2020-10-05
This commit is contained in:
commit
ba8c117a81
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
rust-analyzer-unwrapped = callPackage ./generic.nix rec {
|
rust-analyzer-unwrapped = callPackage ./generic.nix rec {
|
||||||
rev = "2020-09-28";
|
rev = "2020-10-05";
|
||||||
version = "unstable-${rev}";
|
version = "unstable-${rev}";
|
||||||
sha256 = "1ynwrkdy78105xbrcynk0qimk90y849hn54sw8q3akdlyfx1kdrs";
|
sha256 = "1vj5xwqif2ipzlb8ngpq3ymgqvv65d0700ihq7hx81k0i2m2awa6";
|
||||||
cargoSha256 = "0iy7h3q7dp2nbfzzg7yc8zbkb5npghz8l15d83xd8w8q39i3qff5";
|
cargoSha256 = "14n7nk64qq27a7ygqm0bly2bby3bmsav6nvsap3bkbkppyr5gyrg";
|
||||||
};
|
};
|
||||||
|
|
||||||
rust-analyzer = callPackage ./wrapper.nix {} {
|
rust-analyzer = callPackage ./wrapper.nix {} {
|
||||||
|
@ -21,10 +21,10 @@ index fe33cee53..2184a4154 100644
|
|||||||
|
|
||||||
rewriter.replace_ast(&tree, &merged);
|
rewriter.replace_ast(&tree, &merged);
|
||||||
diff --git a/crates/assists/src/utils/insert_use.rs b/crates/assists/src/utils/insert_use.rs
|
diff --git a/crates/assists/src/utils/insert_use.rs b/crates/assists/src/utils/insert_use.rs
|
||||||
index 09f4a2224..2c3a0ca0b 100644
|
index f6025c99a..f9bd31cf3 100644
|
||||||
--- a/crates/assists/src/utils/insert_use.rs
|
--- a/crates/assists/src/utils/insert_use.rs
|
||||||
+++ b/crates/assists/src/utils/insert_use.rs
|
+++ b/crates/assists/src/utils/insert_use.rs
|
||||||
@@ -280,7 +280,7 @@ fn common_prefix(lhs: &ast::Path, rhs: &ast::Path) -> Option<(ast::Path, ast::Pa
|
@@ -274,7 +274,7 @@ fn common_prefix(lhs: &ast::Path, rhs: &ast::Path) -> Option<(ast::Path, ast::Pa
|
||||||
}
|
}
|
||||||
res = Some((lhs_curr.clone(), rhs_curr.clone()));
|
res = Some((lhs_curr.clone(), rhs_curr.clone()));
|
||||||
|
|
||||||
@ -33,36 +33,16 @@ index 09f4a2224..2c3a0ca0b 100644
|
|||||||
Some((lhs, rhs)) => {
|
Some((lhs, rhs)) => {
|
||||||
lhs_curr = lhs;
|
lhs_curr = lhs;
|
||||||
rhs_curr = rhs;
|
rhs_curr = rhs;
|
||||||
@@ -324,7 +324,7 @@ fn path_cmp(a: &ast::Path, b: &ast::Path) -> Ordering {
|
@@ -452,7 +452,7 @@ fn find_insert_position(
|
||||||
// cmp_by would be useful for us here but that is currently unstable
|
|
||||||
// cmp doesnt work due the lifetimes on text's return type
|
|
||||||
a.zip(b)
|
|
||||||
- .flat_map(|(seg, seg2)| seg.name_ref().zip(seg2.name_ref()))
|
|
||||||
+ .flat_map(|(seg, seg2)| zip(seg.name_ref(), seg2.name_ref()))
|
|
||||||
.find_map(|(a, b)| match a.text().cmp(b.text()) {
|
|
||||||
ord @ Ordering::Greater | ord @ Ordering::Less => Some(ord),
|
|
||||||
Ordering::Equal => None,
|
|
||||||
@@ -404,8 +404,8 @@ fn find_insert_position(
|
|
||||||
let path_node_iter = scope
|
let path_node_iter = scope
|
||||||
.as_syntax_node()
|
.as_syntax_node()
|
||||||
.children()
|
.children()
|
||||||
- .filter_map(|node| ast::Use::cast(node.clone()).zip(Some(node)))
|
- .filter_map(|node| ast::Use::cast(node.clone()).zip(Some(node)))
|
||||||
- .flat_map(|(use_, node)| use_.use_tree().and_then(|tree| tree.path()).zip(Some(node)));
|
+ .filter_map(|node| Some((ast::Use::cast(node.clone())?, node)))
|
||||||
+ .filter_map(|node| zip(ast::Use::cast(node.clone()), Some(node)))
|
.flat_map(|(use_, node)| {
|
||||||
+ .flat_map(|(use_, node)| zip(use_.use_tree().and_then(|tree| tree.path()), Some(node)));
|
let tree = use_.use_tree()?;
|
||||||
// Iterator that discards anything thats not in the required grouping
|
let path = tree.path()?;
|
||||||
// This implementation allows the user to rearrange their import groups as this only takes the first group that fits
|
@@ -989,3 +989,7 @@ use foo::bar::baz::Qux;",
|
||||||
let group_iter = path_node_iter
|
|
||||||
@@ -423,7 +423,7 @@ fn find_insert_position(
|
|
||||||
segments
|
|
||||||
.clone()
|
|
||||||
.zip(check_segments)
|
|
||||||
- .flat_map(|(seg, seg2)| seg.name_ref().zip(seg2.name_ref()))
|
|
||||||
+ .flat_map(|(seg, seg2)| zip(seg.name_ref(), seg2.name_ref()))
|
|
||||||
.all(|(l, r)| l.text() <= r.text())
|
|
||||||
});
|
|
||||||
match post_insert {
|
|
||||||
@@ -931,3 +931,7 @@ use foo::bar::baz::Qux;",
|
|
||||||
assert_eq!(result.map(|u| u.to_string()), None);
|
assert_eq!(result.map(|u| u.to_string()), None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user