@@ -13,7 +13,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC
1313 if ctx. in_use_tree ( ) {
1414 // only show modules in a fresh UseTree
1515 cov_mark:: hit!( unqualified_path_only_modules_in_import) ;
16- ctx. scope . process_all_names ( & mut |name, res| {
16+ ctx. process_all_names ( & mut |name, res| {
1717 if let ScopeDef :: ModuleDef ( hir:: ModuleDef :: Module ( _) ) = res {
1818 acc. add_resolution ( ctx, name, & res) ;
1919 }
@@ -29,7 +29,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC
2929 Some ( ImmediateLocation :: Visibility ( _) ) => return ,
3030 Some ( ImmediateLocation :: ItemList | ImmediateLocation :: Trait | ImmediateLocation :: Impl ) => {
3131 // only show macros in {Assoc}ItemList
32- ctx. scope . process_all_names ( & mut |name, res| {
32+ ctx. process_all_names ( & mut |name, res| {
3333 if let hir:: ScopeDef :: MacroDef ( mac) = res {
3434 if mac. is_fn_like ( ) {
3535 acc. add_macro ( ctx, Some ( name. clone ( ) ) , mac) ;
@@ -42,7 +42,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC
4242 return ;
4343 }
4444 Some ( ImmediateLocation :: TypeBound ) => {
45- ctx. scope . process_all_names ( & mut |name, res| {
45+ ctx. process_all_names ( & mut |name, res| {
4646 let add_resolution = match res {
4747 ScopeDef :: MacroDef ( mac) => mac. is_fn_like ( ) ,
4848 ScopeDef :: ModuleDef ( hir:: ModuleDef :: Trait ( _) | hir:: ModuleDef :: Module ( _) ) => {
@@ -83,7 +83,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC
8383 }
8484 }
8585
86- ctx. scope . process_all_names ( & mut |name, res| {
86+ ctx. process_all_names ( & mut |name, res| {
8787 if let ScopeDef :: GenericParam ( hir:: GenericParam :: LifetimeParam ( _) ) | ScopeDef :: Label ( _) =
8888 res
8989 {
@@ -252,4 +252,58 @@ pub mod prelude {
252252 "# ] ] ,
253253 ) ;
254254 }
255+
256+ #[ test]
257+ fn respects_doc_hidden ( ) {
258+ check (
259+ r#"
260+ //- /lib.rs crate:lib deps:std
261+ fn f() {
262+ format_$0
263+ }
264+
265+ //- /std.rs crate:std
266+ #[doc(hidden)]
267+ #[macro_export]
268+ macro_rules! format_args_nl {
269+ () => {}
270+ }
271+
272+ pub mod prelude {
273+ pub mod rust_2018 {}
274+ }
275+ "# ,
276+ expect ! [ [ r#"
277+ fn f() fn()
278+ md std
279+ "# ] ] ,
280+ ) ;
281+ }
282+
283+ #[ test]
284+ fn respects_doc_hidden_in_assoc_item_list ( ) {
285+ check (
286+ r#"
287+ //- /lib.rs crate:lib deps:std
288+ struct S;
289+ impl S {
290+ format_$0
291+ }
292+
293+ //- /std.rs crate:std
294+ #[doc(hidden)]
295+ #[macro_export]
296+ macro_rules! format_args_nl {
297+ () => {}
298+ }
299+
300+ pub mod prelude {
301+ pub mod rust_2018 {}
302+ }
303+ "# ,
304+ expect ! [ [ r#"
305+ md std
306+ "# ] ] ,
307+ ) ;
308+ }
255309}
0 commit comments