aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/asset/comp/suggest.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-12 01:06:24 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-12 01:06:24 +0800
commit7c496151f571b872da523f4c46369751be6f4ca1 (patch)
treee71d2aeb7a16f38996b9d68fe77259269ef25c8f /mingling_core/src/asset/comp/suggest.rs
parent5e10b03acb0312155d0d76e06d366bcf76cb9f27 (diff)
Add ShellContext helper methods for completion logic
Diffstat (limited to 'mingling_core/src/asset/comp/suggest.rs')
-rw-r--r--mingling_core/src/asset/comp/suggest.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/mingling_core/src/asset/comp/suggest.rs b/mingling_core/src/asset/comp/suggest.rs
index 81000d5..62844a7 100644
--- a/mingling_core/src/asset/comp/suggest.rs
+++ b/mingling_core/src/asset/comp/suggest.rs
@@ -1,5 +1,7 @@
use std::collections::BTreeSet;
+use crate::ShellContext;
+
/// A completion suggestion that tells the shell how to perform completion.
/// This can be either a set of specific suggestion items or a request for file completion.
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)]
@@ -23,6 +25,11 @@ impl Suggest {
pub fn file_comp() -> Self {
Self::FileCompletion
}
+
+ /// Filters out already typed flag arguments from suggestion results.
+ pub fn strip_typed_argument(self, ctx: &ShellContext) -> Self {
+ ctx.strip_typed_argument(self)
+ }
}
impl<T> From<T> for Suggest