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:
Adam Chalmers
2025-05-29 09:15:28 -05:00
committed by GitHub
parent 55e1ec7dad
commit 5f6d810fbb
2 changed files with 2 additions and 2 deletions

View File

@ -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)))
}

View File

@ -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]