mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Auto merge of #16349 - Young-Flash:use_error_recovery, r=Veykril
fix: add error recovery for use_tree_list parsing This PR adds error recovery for USE_TREE_LIST parsing, avoid the wrong USE_TREE_LIST making the rest parsing incorrectly. before  after  close https://github.com/rust-lang/rust-analyzer/issues/16227
This commit is contained in:
commit
1ab8c7fd27
5 changed files with 112 additions and 38 deletions
|
@ -8,6 +8,33 @@ fn check(ra_fixture: &str, expect: Expect) {
|
|||
expect.assert_eq(&actual)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_tree_completion() {
|
||||
check(
|
||||
r#"
|
||||
struct implThing;
|
||||
|
||||
use crate::{impl$0};
|
||||
"#,
|
||||
expect![[r#"
|
||||
st implThing implThing
|
||||
kw self
|
||||
"#]],
|
||||
);
|
||||
|
||||
check(
|
||||
r#"
|
||||
struct implThing;
|
||||
|
||||
use crate::{impl$0;
|
||||
"#,
|
||||
expect![[r#"
|
||||
st implThing implThing
|
||||
kw self
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_tree_start() {
|
||||
cov_mark::check!(unqualified_path_selected_only);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue