1 use base_db
::fixture
::WithFixture
;
2 use expect_test
::{expect, Expect}
;
4 use crate::{db::DefDatabase, test_db::TestDB}
;
6 fn check(ra_fixture
: &str, expect
: Expect
) {
7 let (db
, file_id
) = TestDB
::with_single_file(ra_fixture
);
8 let item_tree
= db
.file_item_tree(file_id
.into());
9 let pretty
= item_tree
.pretty_print();
10 expect
.assert_eq(&pretty
);
19 //! another file comment
21 extern crate self as renamed;
22 pub(super) extern crate bli;
24 pub use crate::path::{nested, items as renamed, Trait as _};
33 #![doc = " file comment"]
35 #![doc = " another file comment"]
37 pub(self) extern crate self as renamed;
39 pub(super) extern crate bli;
41 pub use crate::path::{nested, items as renamed, Trait as _};
43 pub(self) use globs::*;
45 #[doc = " docs on import"]
46 pub(self) use crate::{A, B};
48 pub(self) use a::{c, d::{e}};
73 pub(self) type ExType;
76 pub(self) static EX_STATIC: u8 = _;
79 pub(self) fn ex_fn() -> ();
97 struct Tuple(#[attr] u8);
116 pub(self) struct Unit;
119 pub(self) struct Struct {
124 pub(self) struct Tuple(
129 pub(self) union Ize {
135 #[doc = " comment on Unit"]
137 #[doc = " comment on Tuple"]
142 #[doc = " comment on a: u8"]
154 pub static mut ST: () = ();
159 fn f(#[attr] arg: u8, _: ()) {
163 trait Tr: SuperTrait + 'lifetime {
164 type Assoc: AssocBound = Default;
169 pub static mut ST: () = _;
171 pub(self) const _: Anon = _;
181 pub(self) trait Tr<Self>
186 pub(self) type Assoc: AssocBound = Default;
214 pub(self) mod inline {
215 pub(self) use super::*;
217 pub(self) fn fn_in_module() -> () { ... }
220 pub(self) mod outline;
238 macro_rules! m { ... }
254 c: super::super::SuperSuperTy,
262 pub(self) a: self::Ty,
263 pub(self) b: super::SuperTy,
264 pub(self) c: super::super::SuperSuperTy,
265 pub(self) d: ::abs::Path,
266 pub(self) e: crate::Crate,
267 pub(self) f: plain::path::Ty,
278 a: Mixed<'a, T, Item=(), OtherItem=u8>,
279 b: <Fully as Qualified>::Syntax,
280 c: <TypeAnchored>::Path::<'a>,
281 d: dyn for<'a> Trait<'a>,
286 pub(self) a: Mixed::<'a, T, Item = (), OtherItem = u8>,
287 pub(self) b: Qualified::<Self=Fully>::Syntax,
288 pub(self) c: <TypeAnchored>::Path::<'a>,
289 pub(self) d: dyn for<'a> Trait::<'a>,
299 struct S<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> {
303 struct Tuple<T: Copy, U: ?Sized>(T, U);
305 impl<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> S<'a, 'b, T, K> {
306 fn f<G: 'a>(arg: impl Copy) -> impl Copy {}
309 enum Enum<'a, T, const U: u8> {}
310 union Union<'a, T, const U: u8> {}
312 trait Tr<'a, T: 'a>: Super where Self: for<'a> Tr<'a, T> {}
315 pub(self) struct S<'a, 'b, T, const K: u8>
321 pub(self) field: &'a &'b T,
324 pub(self) struct Tuple<T, U>(
332 impl<'a, 'b, T, const K: u8> S::<'a, 'b, T, K>
345 pub(self) enum Enum<'a, T, const U: u8> {
348 pub(self) union Union<'a, T, const U: u8> {
351 pub(self) trait Tr<'a, Self, T>
355 Self: for<'a> Tr::<'a, T>