KCL: Fix autocomplete snippet for color (#7270)
Fixes https://github.com/KittyCAD/modeling-app/issues/7269 Tested both locally in the app, and via unit test.
This commit is contained in:
@ -834,7 +834,7 @@ impl ArgData {
|
||||
|
||||
Some("string") => {
|
||||
if self.name == "color" {
|
||||
Some((index, format!(r#"{label}${{{}:"ff0000"}}"#, index)))
|
||||
Some((index, format!(r"{label}${{{}:{}}}", index, "\"#ff0000\"")))
|
||||
} else {
|
||||
Some((index, format!(r#"{label}${{{}:"string"}}"#, index)))
|
||||
}
|
||||
|
@ -1079,7 +1079,7 @@ mod tests {
|
||||
panic!();
|
||||
};
|
||||
let snippet = helix_fn.to_autocomplete_snippet();
|
||||
assert_eq!(snippet, r#"appearance(color = ${0:"ff0000"})"#);
|
||||
assert_eq!(snippet, "appearance(color = ${0:\"#ff0000\"})");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user