1
0
mirror of https://github.com/helix-editor/helix synced 2024-09-21 00:34:57 +02:00
This commit is contained in:
Blaž Hrastnik 2021-05-09 17:13:59 +09:00
parent dbe870e4ec
commit 6c705f09e8
2 changed files with 5 additions and 5 deletions

View File

@ -210,7 +210,7 @@ impl Selection {
Self::single(pos, pos)
}
fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Selection {
fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Self {
let primary = ranges[primary_index];
ranges.sort_unstable_by_key(Range::from);
primary_index = ranges.iter().position(|&range| range == primary).unwrap();
@ -249,7 +249,7 @@ impl Selection {
result.push(range)
}
Selection {
Self {
ranges: result,
primary_index,
}

View File

@ -140,20 +140,20 @@ impl Notification {
.expect("Failed to parse PublishDiagnostics params");
// TODO: need to loop over diagnostics and distinguish them by URI
Notification::PublishDiagnostics(params)
Self::PublishDiagnostics(params)
}
lsp::notification::ShowMessage::METHOD => {
let params: lsp::ShowMessageParams =
params.parse().expect("Failed to parse ShowMessage params");
Notification::ShowMessage(params)
Self::ShowMessage(params)
}
lsp::notification::LogMessage::METHOD => {
let params: lsp::LogMessageParams =
params.parse().expect("Failed to parse ShowMessage params");
Notification::LogMessage(params)
Self::LogMessage(params)
}
_ => {
log::error!("unhandled LSP notification: {}", method);