mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Complete crate
, super
and self
in non-usetree paths
This commit is contained in:
parent
2b6770c936
commit
9f9cc72ee5
10 changed files with 126 additions and 57 deletions
|
@ -30,6 +30,9 @@ fn in_mod_item_list() {
|
|||
sn tmod (Test module)
|
||||
sn tfn (Test function)
|
||||
sn macro_rules
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
"##]],
|
||||
)
|
||||
|
@ -58,6 +61,9 @@ fn in_source_file_item_list() {
|
|||
sn tmod (Test module)
|
||||
sn tfn (Test function)
|
||||
sn macro_rules
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
md module
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
|
@ -174,6 +180,9 @@ fn in_impl_assoc_item_list() {
|
|||
kw fn
|
||||
kw const
|
||||
kw type
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
md module
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
|
@ -205,6 +214,9 @@ fn in_trait_assoc_item_list() {
|
|||
kw fn
|
||||
kw const
|
||||
kw type
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
md module
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
|
|
|
@ -18,6 +18,9 @@ fn target_type_or_trait_in_impl_block() {
|
|||
impl Tra$0
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
en Enum
|
||||
st Record
|
||||
|
@ -38,6 +41,9 @@ fn target_type_in_trait_impl_block() {
|
|||
impl Trait for Str$0
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
en Enum
|
||||
st Record
|
||||
|
|
|
@ -16,6 +16,9 @@ fn predicate_start() {
|
|||
struct Foo<'lt, T, const C: usize> where $0 {}
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
en Enum
|
||||
st Record
|
||||
|
@ -38,6 +41,9 @@ fn bound_for_type_pred() {
|
|||
struct Foo<'lt, T, const C: usize> where T: $0 {}
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
md module
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
|
@ -54,6 +60,9 @@ fn bound_for_lifetime_pred() {
|
|||
struct Foo<'lt, T, const C: usize> where 'lt: $0 {}
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
md module
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
|
@ -69,6 +78,9 @@ fn bound_for_for_pred() {
|
|||
struct Foo<'lt, T, const C: usize> where for<'a> T: $0 {}
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
md module
|
||||
ma makro!(…) #[macro_export] macro_rules! makro
|
||||
|
@ -84,6 +96,9 @@ fn param_list_for_for_pred() {
|
|||
struct Foo<'lt, T, const C: usize> where for<'a> $0 {}
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tt Trait
|
||||
en Enum
|
||||
st Record
|
||||
|
@ -107,6 +122,9 @@ impl Record {
|
|||
}
|
||||
"#,
|
||||
expect![[r##"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
sp Self
|
||||
tt Trait
|
||||
en Enum
|
||||
|
|
|
@ -30,6 +30,9 @@ struct Foo<'lt, T, const C: usize> {
|
|||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
sp Self
|
||||
tp T
|
||||
tt Trait
|
||||
|
@ -54,6 +57,9 @@ struct Foo<'lt, T, const C: usize>(f$0);
|
|||
expect![[r#"
|
||||
kw pub(crate)
|
||||
kw pub
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
sp Self
|
||||
tp T
|
||||
tt Trait
|
||||
|
@ -76,6 +82,9 @@ fn fn_return_type() {
|
|||
fn x<'lt, T, const C: usize>() -> $0
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tp T
|
||||
tt Trait
|
||||
en Enum
|
||||
|
@ -99,6 +108,9 @@ fn foo<'lt, T, const C: usize>() {
|
|||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
tp T
|
||||
tt Trait
|
||||
en Enum
|
||||
|
@ -140,6 +152,9 @@ trait Trait2 {
|
|||
fn foo<'lt, T: Trait2<$0>, const CONST_PARAM: usize>(_: T) {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw self
|
||||
kw super
|
||||
kw crate
|
||||
ta Foo = (as Trait2) type Foo;
|
||||
tp T
|
||||
cp CONST_PARAM
|
||||
|
|
|
@ -22,11 +22,11 @@ mod foo {}
|
|||
// nothing here
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw crate::
|
||||
kw self::
|
||||
kw super::
|
||||
md foo
|
||||
md other_crate
|
||||
kw self::
|
||||
kw super::
|
||||
kw crate::
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ mod foo { pub struct S; }
|
|||
use self::{foo::*, bar$0};
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw self
|
||||
st S
|
||||
md foo
|
||||
"#]],
|
||||
|
@ -230,10 +229,10 @@ pub mod bar {}
|
|||
pub use $0;
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw crate::
|
||||
md bar
|
||||
kw self::
|
||||
kw super::
|
||||
md bar
|
||||
kw crate::
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -247,10 +246,10 @@ mod bar {}
|
|||
use {$0};
|
||||
"#,
|
||||
expect![[r#"
|
||||
kw crate::
|
||||
md bar
|
||||
kw self::
|
||||
kw super::
|
||||
md bar
|
||||
kw crate::
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue