Use StringMatchCandidate::new to construct candidates more conveniently
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
1e96fc98e7
commit
bd2527e691
4 changed files with 25 additions and 19 deletions
|
@ -39,6 +39,10 @@ pub trait ToPointUtf16 {
|
|||
fn to_point_utf16(self) -> PointUtf16;
|
||||
}
|
||||
|
||||
pub trait ToLspPosition {
|
||||
fn to_lsp_position(self) -> lsp::Position;
|
||||
}
|
||||
|
||||
pub trait DiagnosticProcessor: 'static + Send + Sync {
|
||||
fn process_diagnostics(&self, diagnostics: &mut lsp::PublishDiagnosticsParams);
|
||||
}
|
||||
|
@ -286,6 +290,12 @@ impl ToPointUtf16 for lsp::Position {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToLspPosition for PointUtf16 {
|
||||
fn to_lsp_position(self) -> lsp::Position {
|
||||
lsp::Position::new(self.row, self.column)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn range_from_lsp(range: lsp::Range) -> Range<PointUtf16> {
|
||||
let start = PointUtf16::new(range.start.line, range.start.character);
|
||||
let end = PointUtf16::new(range.end.line, range.end.character);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue