mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 10:56:19 +04:00
Lint
This commit is contained in:
parent
dbe870e4ec
commit
6c705f09e8
@ -210,7 +210,7 @@ pub fn point(pos: usize) -> Self {
|
|||||||
Self::single(pos, pos)
|
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];
|
let primary = ranges[primary_index];
|
||||||
ranges.sort_unstable_by_key(Range::from);
|
ranges.sort_unstable_by_key(Range::from);
|
||||||
primary_index = ranges.iter().position(|&range| range == primary).unwrap();
|
primary_index = ranges.iter().position(|&range| range == primary).unwrap();
|
||||||
@ -249,7 +249,7 @@ pub fn point(pos: usize) -> Self {
|
|||||||
result.push(range)
|
result.push(range)
|
||||||
}
|
}
|
||||||
|
|
||||||
Selection {
|
Self {
|
||||||
ranges: result,
|
ranges: result,
|
||||||
primary_index,
|
primary_index,
|
||||||
}
|
}
|
||||||
|
@ -140,20 +140,20 @@ pub fn parse(method: &str, params: jsonrpc::Params) -> Option<Notification> {
|
|||||||
.expect("Failed to parse PublishDiagnostics params");
|
.expect("Failed to parse PublishDiagnostics params");
|
||||||
|
|
||||||
// TODO: need to loop over diagnostics and distinguish them by URI
|
// TODO: need to loop over diagnostics and distinguish them by URI
|
||||||
Notification::PublishDiagnostics(params)
|
Self::PublishDiagnostics(params)
|
||||||
}
|
}
|
||||||
|
|
||||||
lsp::notification::ShowMessage::METHOD => {
|
lsp::notification::ShowMessage::METHOD => {
|
||||||
let params: lsp::ShowMessageParams =
|
let params: lsp::ShowMessageParams =
|
||||||
params.parse().expect("Failed to parse ShowMessage params");
|
params.parse().expect("Failed to parse ShowMessage params");
|
||||||
|
|
||||||
Notification::ShowMessage(params)
|
Self::ShowMessage(params)
|
||||||
}
|
}
|
||||||
lsp::notification::LogMessage::METHOD => {
|
lsp::notification::LogMessage::METHOD => {
|
||||||
let params: lsp::LogMessageParams =
|
let params: lsp::LogMessageParams =
|
||||||
params.parse().expect("Failed to parse ShowMessage params");
|
params.parse().expect("Failed to parse ShowMessage params");
|
||||||
|
|
||||||
Notification::LogMessage(params)
|
Self::LogMessage(params)
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
log::error!("unhandled LSP notification: {}", method);
|
log::error!("unhandled LSP notification: {}", method);
|
||||||
|
Loading…
Reference in New Issue
Block a user