diff options
Diffstat (limited to 'mingling_macros/src/lib.rs')
| -rw-r--r-- | mingling_macros/src/lib.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs index b09eedf..f0ba25b 100644 --- a/mingling_macros/src/lib.rs +++ b/mingling_macros/src/lib.rs @@ -1123,7 +1123,7 @@ pub fn program_comp_gen(input: TokenStream) -> TokenStream { match read_ctx { Ok(ctx) => { let suggest = ::mingling::CompletionHelper::exec_completion::<#name>(&ctx); - CompletionSuggest::new((ctx, suggest)).to_render() + crate::CompletionSuggest::new((ctx, suggest)).to_render() } Err(_) => std::process::exit(1), } @@ -1139,13 +1139,21 @@ pub fn program_comp_gen(input: TokenStream) -> TokenStream { match read_ctx { Ok(ctx) => { let suggest = ::mingling::CompletionHelper::exec_completion::<#name>(&ctx); - CompletionSuggest::new((ctx, suggest)).to_render() + crate::CompletionSuggest::new((ctx, suggest)).to_render() } Err(_) => std::process::exit(1), } } }; + #[cfg(feature = "dispatch_tree")] + let internal_dispatcher_comp = quote! { + use __internal_completion_mod::__internal_dispatcher___comp; + }; + + #[cfg(not(feature = "dispatch_tree"))] + let internal_dispatcher_comp = quote! {}; + let comp_dispatcher = quote! { #[doc(hidden)] mod __internal_completion_mod { @@ -1156,6 +1164,7 @@ pub fn program_comp_gen(input: TokenStream) -> TokenStream { CompletionSuggest = (::mingling::ShellContext, ::mingling::Suggest) ); } + #internal_dispatcher_comp use __internal_completion_mod::CompletionContext; use __internal_completion_mod::CompletionSuggest; pub use __internal_completion_mod::CMDCompletion; |
