Add test for common_prefix_at and rewrite it to be more readable and

pass the new test cases
This commit is contained in:
Keith Simmons 2022-03-31 00:55:55 -07:00
parent 263e3d8176
commit 9385690b98
3 changed files with 34 additions and 7 deletions

View file

@ -2364,7 +2364,7 @@ impl Project {
(range_from_lsp(edit.range), edit.new_text.clone())
}
None => (
this.common_prefix_at_position(position, &lsp_completion.label),
this.common_prefix_at(position, &lsp_completion.label),
lsp_completion.label.clone(),
),
Some(lsp::CompletionTextEdit::InsertAndReplace(_)) => {