* handle Plane in get_autocomplete_snippet to fix missing default plane value for offsetPlane * adds test for offsetPlane default plane value * cleanup test * use XY instead of XZ for default plane * add rust test for offsetplane autocomplete * remove playwright test for offestPlane, as it has rust test now and there are autocomplete tests already
This commit is contained in:
@ -788,6 +788,7 @@ impl ArgData {
|
||||
Some("Axis2d | Edge") | Some("Axis3d | Edge") => Some((index, format!(r#"{label}${{{index}:X}}"#))),
|
||||
Some("Edge") => Some((index, format!(r#"{label}${{{index}:tag_or_edge_fn}}"#))),
|
||||
Some("[Edge; 1+]") => Some((index, format!(r#"{label}[${{{index}:tag_or_edge_fn}}]"#))),
|
||||
Some("Plane") => Some((index, format!(r#"{label}${{{}:XY}}"#, index))),
|
||||
|
||||
Some("string") => Some((index, format!(r#"{label}${{{}:"string"}}"#, index))),
|
||||
Some("bool") => Some((index, format!(r#"{label}${{{}:false}}"#, index))),
|
||||
|
@ -1167,6 +1167,16 @@ mod tests {
|
||||
assert_eq!(snippet, r#"clone(${0:part001})"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_autocomplete_snippet_offset_plane() {
|
||||
let data = kcl_doc::walk_prelude();
|
||||
let DocData::Fn(offset_plane_fn) = data.find_by_name("offsetPlane").unwrap() else {
|
||||
panic!();
|
||||
};
|
||||
let snippet = offset_plane_fn.to_autocomplete_snippet();
|
||||
assert_eq!(snippet, r#"offsetPlane(${0:XY}, offset = ${1:3.14})"#);
|
||||
}
|
||||
|
||||
// We want to test the snippets we compile at lsp start.
|
||||
#[test]
|
||||
fn get_all_stdlib_autocomplete_snippets() {
|
||||
|
Reference in New Issue
Block a user