1 //! Completion tests for type position.
2 use expect_test::{expect, Expect};
4 use crate::tests::{completion_list, BASE_ITEMS_FIXTURE};
6 fn check(ra_fixture: &str, expect: Expect) {
7 let actual = completion_list(&format!("{}\n{}", BASE_ITEMS_FIXTURE, ra_fixture));
8 expect.assert_eq(&actual)
12 fn record_field_ty() {
15 struct Foo<'lt, T, const C: usize> {
32 ma makro!(…) #[macro_export] macro_rules! makro
40 fn tuple_struct_field() {
43 struct Foo<'lt, T, const C: usize>(f$0);
61 ma makro!(…) #[macro_export] macro_rules! makro
72 fn x<'lt, T, const C: usize>() -> $0
85 ma makro!(…) #[macro_export] macro_rules! makro
96 fn foo<'lt, T, const C: usize>() {
112 ma makro!(…) #[macro_export] macro_rules! makro
119 fn foo<'lt, T, const C: usize>() {
131 ma makro!(…) #[macro_export] macro_rules! makro
138 fn completes_types_and_const_in_arg_list() {
145 fn foo<'lt, T: Trait2<$0>, const CONST_PARAM: usize>(_: T) {}
151 ta Foo = (as Trait2) type Foo;
160 ma makro!(…) #[macro_export] macro_rules! makro
173 fn foo<'lt, T: Trait2<self::$0>, const CONST_PARAM: usize>(_: T) {}
182 ma makro!(…) #[macro_export] macro_rules! makro
191 fn enum_qualified() {
196 const ASSOC_CONST: () = ();
199 fn func(_: Enum::$0) {}
202 ta AssocType type AssocType = ();