aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/asset/comp
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-10 16:47:40 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-10 16:47:40 +0800
commitb18749170b6006e53976dbb6df9f59a3b9c34127 (patch)
treea0f9288fdc9082e26daab218167da1f54521d32b /mingling_core/src/asset/comp
parent3bb5afcbe01ad16293a66084dc1ad35f3378a833 (diff)
Add completion macro infrastructure without logic
Diffstat (limited to 'mingling_core/src/asset/comp')
-rw-r--r--mingling_core/src/asset/comp/flags.rs1
-rw-r--r--mingling_core/src/asset/comp/shell_ctx.rs1
-rw-r--r--mingling_core/src/asset/comp/suggest.rs2
3 files changed, 4 insertions, 0 deletions
diff --git a/mingling_core/src/asset/comp/flags.rs b/mingling_core/src/asset/comp/flags.rs
index b432b08..0762d0d 100644
--- a/mingling_core/src/asset/comp/flags.rs
+++ b/mingling_core/src/asset/comp/flags.rs
@@ -1,6 +1,7 @@
use just_fmt::snake_case;
#[derive(Default, Debug, Clone)]
+#[cfg_attr(feature = "general_renderer", derive(serde::Serialize))]
pub enum ShellFlag {
#[default]
Bash,
diff --git a/mingling_core/src/asset/comp/shell_ctx.rs b/mingling_core/src/asset/comp/shell_ctx.rs
index 081337f..4771e63 100644
--- a/mingling_core/src/asset/comp/shell_ctx.rs
+++ b/mingling_core/src/asset/comp/shell_ctx.rs
@@ -4,6 +4,7 @@ use crate::ShellFlag;
/// providing information about the current command line state
/// to guide how completions should be generated.
#[derive(Default, Debug)]
+#[cfg_attr(feature = "general_renderer", derive(serde::Serialize))]
pub struct ShellContext {
/// The full command line (-f / --command-line)
pub command_line: String,
diff --git a/mingling_core/src/asset/comp/suggest.rs b/mingling_core/src/asset/comp/suggest.rs
index 4e7ce82..55a874f 100644
--- a/mingling_core/src/asset/comp/suggest.rs
+++ b/mingling_core/src/asset/comp/suggest.rs
@@ -3,6 +3,7 @@ use std::collections::BTreeSet;
/// 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)]
+#[cfg_attr(feature = "general_renderer", derive(serde::Serialize))]
pub enum Suggest {
/// A set of specific suggestion items for the shell to display.
Suggest(BTreeSet<SuggestItem>),
@@ -59,6 +60,7 @@ impl std::ops::DerefMut for Suggest {
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[cfg_attr(feature = "general_renderer", derive(serde::Serialize))]
pub enum SuggestItem {
Simple(String),
WithDescription(String, String),