Skip to content

Commit f1d3054

Browse files
authored
Merge pull request #3021 from tomjakubowski/bugfix/replace_all_insert_text
Fix typo in docs for replace_all
2 parents 8bc3422 + 2175ba8 commit f1d3054

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

rust/perspective-client/src/rust/config/expressions.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ pub static COMPLETIONS: [CompletionItemSuggestion; 77] = [
641641
},
642642
CompletionItemSuggestion {
643643
label: "replace_all",
644-
insert_text: "replace(${1:string}, ${2:pattern}, ${3:replacer})",
644+
insert_text: "replace_all(${1:string}, ${2:pattern}, ${3:replacer})",
645645
documentation: "Replaces all non-overlapping matches of pattern in string with replacer, \
646646
or return the original string if no replaces were made.",
647647
},
@@ -661,3 +661,17 @@ pub static COMPLETIONS: [CompletionItemSuggestion; 77] = [
661661
documentation: "Looks up a value in another column by index",
662662
},
663663
];
664+
665+
#[test]
666+
fn test_completions_insert_text_matches_label() {
667+
for comp in COMPLETIONS {
668+
let label = comp.label;
669+
let insert_text = comp.insert_text;
670+
assert!(
671+
insert_text.starts_with(&label),
672+
"insert_text for label {label} does not start with {label}:\n {insert_text}",
673+
label = label,
674+
insert_text = insert_text
675+
);
676+
}
677+
}

0 commit comments

Comments
 (0)