From 7c496151f571b872da523f4c46369751be6f4ca1 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 12 Apr 2026 01:06:24 +0800 Subject: Add ShellContext helper methods for completion logic --- mingling_core/src/asset/comp/suggest.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mingling_core/src/asset/comp/suggest.rs') 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 From for Suggest -- cgit