Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion golem-cli/src/app/build/gen_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async fn create_generated_base_wit(
{
ctx.component_base_output_wit_deps(dep_component_name)?
.add_packages_with_transitive_deps_to_wit_dir(
&[dep_exports_package_name.clone()],
std::slice::from_ref(dep_exports_package_name),
&component_generated_base_wit,
)?;
}
Expand Down
2 changes: 1 addition & 1 deletion golem-cli/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl<P: AsRef<Path>> PathExtra<P> {
self.0.as_ref().into()
}

pub fn display(&self) -> std::path::Display {
pub fn display(&self) -> std::path::Display<'_> {
self.as_path().display()
}
}
Expand Down
51 changes: 24 additions & 27 deletions golem-cli/src/model/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,30 @@ pub fn fuzzy_match_function_name(
let fuzzy_search = FuzzySearch::new(component_function_names.iter().map(|s| s.as_str()));
match fuzzy_search.find(&normalized_function_name) {
Ok(matched) => {
// if we have a match, but it is non-exact _or_ we have a parsed function name, we customize the parsed function name and render it
// because it may have resource parameters
if parsed_function_name.is_some()
&& (!matched.exact_match
|| parsed_function_name
.iter()
.any(|f| f.function.is_indexed_resource()))
{
let mut parsed_function_name = parsed_function_name.unwrap();
let parsed_matched_function_name = ParsedFunctionName::parse(&matched.option)
.expect("The rendered component export names should always be parseable");

adjust_parsed_function_name(
&mut parsed_function_name,
parsed_matched_function_name,
normalized_function_name,
)?;

let rendered_altered_function_name = parsed_function_name.to_string();
Ok(Match {
option: rendered_altered_function_name,
pattern: matched.pattern,
exact_match: false,
})
} else {
// otherwise we just return the matched raw function name
Ok(normalized(matched))
match parsed_function_name {
// if we have a match, but it is non-exact _or_ we have a parsed function name, we customize the parsed function name and render it
// because it may have resource parameters
Some(mut parsed_function_name)
if !matched.exact_match
|| parsed_function_name.function.is_indexed_resource() =>
{
let parsed_matched_function_name = ParsedFunctionName::parse(&matched.option)
.expect("The rendered component export names should always be parseable");

adjust_parsed_function_name(
&mut parsed_function_name,
parsed_matched_function_name,
normalized_function_name,
)?;

let rendered_altered_function_name = parsed_function_name.to_string();
Ok(Match {
option: rendered_altered_function_name,
pattern: matched.pattern,
exact_match: false,
})
}
_ => Ok(normalized(matched)),
}
}
Err(Error::Ambiguous {
Expand Down
Loading