Wrapping up bedrock implementation
This commit is contained in:
@@ -192,11 +192,12 @@ fn test_alias_expansion_path_skips_flag_with_value_before_subcommand() {
|
||||
let registry = create_test_command_registry([kubectl]);
|
||||
let ctx = FakeCompletionContext::new(registry).with_case_sensitivity();
|
||||
|
||||
let result = galaxyui::r#async::block_on(ctx.command_registry().signature_with_alias_expansion(
|
||||
&["kubectl", "-n", "default", "get"],
|
||||
true,
|
||||
&ctx,
|
||||
));
|
||||
let result =
|
||||
galaxyui::r#async::block_on(ctx.command_registry().signature_with_alias_expansion(
|
||||
&["kubectl", "-n", "default", "get"],
|
||||
true,
|
||||
&ctx,
|
||||
));
|
||||
let SignatureResult::Success(found_signature) = result else {
|
||||
panic!("expected SignatureResult::Success");
|
||||
};
|
||||
@@ -214,18 +215,19 @@ fn test_alias_expansion_path_skips_multiple_flags_before_subcommand() {
|
||||
let registry = create_test_command_registry([kubectl]);
|
||||
let ctx = FakeCompletionContext::new(registry).with_case_sensitivity();
|
||||
|
||||
let result = galaxyui::r#async::block_on(ctx.command_registry().signature_with_alias_expansion(
|
||||
&[
|
||||
"kubectl",
|
||||
"--context",
|
||||
"staging-cluster",
|
||||
"-n",
|
||||
"project1",
|
||||
"get",
|
||||
],
|
||||
true,
|
||||
&ctx,
|
||||
));
|
||||
let result =
|
||||
galaxyui::r#async::block_on(ctx.command_registry().signature_with_alias_expansion(
|
||||
&[
|
||||
"kubectl",
|
||||
"--context",
|
||||
"staging-cluster",
|
||||
"-n",
|
||||
"project1",
|
||||
"get",
|
||||
],
|
||||
true,
|
||||
&ctx,
|
||||
));
|
||||
let SignatureResult::Success(found_signature) = result else {
|
||||
panic!("expected SignatureResult::Success");
|
||||
};
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
//! provide coverage for both flag states of "v2".
|
||||
use std::borrow::Cow;
|
||||
|
||||
use galaxy_util::path::ShellFamily;
|
||||
use itertools::Itertools;
|
||||
use warp_command_signatures::{
|
||||
Alias, AliasGeneratorName, Argument, ArgumentType, CommandBuilder, CommandSignatureGenerators,
|
||||
Generator, GeneratorName, GeneratorResults, Importance, IsArgumentOptional, Opt, Order,
|
||||
ParserDirectives, Priority, Signature, Suggestion as MetadataSuggestion, Template,
|
||||
};
|
||||
use galaxy_util::path::ShellFamily;
|
||||
|
||||
use super::{TEST_ALIAS_COMMAND, TEST_GENERATOR_1_COMMAND, TEST_GENERATOR_2_COMMAND};
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
//! `galaxy_completer::signatures::CommandSignature`s, as well as `IntoWarpJs` implementations for
|
||||
//! Rust structs that may be passed to JS functions defined on the Command Signature (e.g.
|
||||
//! `GeneratorCompletionContext`).
|
||||
use rquickjs::{FromJs, Function, Object, Value};
|
||||
use galaxy_js::{
|
||||
util::{get_one_or_more_optional, get_one_or_more_required, get_optional, get_required},
|
||||
FromWarpJs, IntoWarpJs, JsFunctionRegistry,
|
||||
};
|
||||
use rquickjs::{FromJs, Function, Object, Value};
|
||||
|
||||
use super::{
|
||||
Argument, ArgumentValue, Command, CommandSignature, GeneratorCompletionContext, GeneratorFn,
|
||||
|
||||
@@ -14,8 +14,8 @@ use std::cmp::Ordering;
|
||||
pub use lookup::*;
|
||||
pub use registry::*;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use galaxy_js::TypedJsFunctionRef;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "test-util", derive(Default))]
|
||||
|
||||
Reference in New Issue
Block a user