Use StringMatchCandidate::new to construct candidates more conveniently

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-31 19:11:13 +01:00
parent 1e96fc98e7
commit bd2527e691
4 changed files with 25 additions and 19 deletions

View file

@ -7,7 +7,7 @@ pub use crate::{
use crate::{
diagnostic_set::{DiagnosticEntry, DiagnosticGroup},
outline::OutlineItem,
range_from_lsp, Outline,
range_from_lsp, Outline, ToLspPosition,
};
use anyhow::{anyhow, Result};
use clock::ReplicaId;
@ -589,14 +589,8 @@ impl Buffer {
.collect();
lsp::TextDocumentContentChangeEvent {
range: Some(lsp::Range::new(
lsp::Position::new(
edit_start.row,
edit_start.column,
),
lsp::Position::new(
edit_end.row,
edit_end.column,
),
edit_start.to_lsp_position(),
edit_end.to_lsp_position(),
)),
range_length: None,
text: new_text,