fix auto complete for circle (#2903)

crcle

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-07-03 18:05:24 -07:00
committed by GitHub
parent 24c7260327
commit 16e7ae38e3

View File

@ -69,6 +69,7 @@ impl StdLibFnArg {
|| self.type_ == "ExtrudeGroup"
|| self.type_ == "ExtrudeGroupSet"
|| self.type_ == "SketchSurface"
|| self.type_ == "SketchSurfaceOrGroup"
{
return Ok(Some((index, format!("${{{}:{}}}", index, "%"))));
} else if self.type_ == "TagDeclarator" && self.required {
@ -894,4 +895,11 @@ mod tests {
}, ${2:%})${}"#
);
}
#[test]
fn get_autocomplete_snippet_circle() {
let circle_fn: Box<dyn StdLibFn> = Box::new(crate::std::shapes::Circle);
let snippet = circle_fn.to_autocomplete_snippet().unwrap();
assert_eq!(snippet, r#"circle([${0:3.14}, ${1:3.14}], ${2:3.14}, ${3:%})${}"#);
}
}