Tweak structure of Project::on_lsp_progress so it can be auto-formatted
Previously, rustfmt seems to have given up on formatting this method.
This commit is contained in:
parent
f9e1b4de96
commit
8f38ac8270
1 changed files with 68 additions and 77 deletions
|
@ -1633,17 +1633,17 @@ impl Project {
|
|||
return;
|
||||
}
|
||||
};
|
||||
|
||||
match progress.value {
|
||||
lsp::ProgressParamsValue::WorkDone(progress) => match progress {
|
||||
lsp::WorkDoneProgress::Begin(_) => {
|
||||
let progress = match progress.value {
|
||||
lsp::ProgressParamsValue::WorkDone(value) => value,
|
||||
};
|
||||
let language_server_status =
|
||||
if let Some(status) = self.language_server_statuses.get_mut(&server_id) {
|
||||
status
|
||||
} else {
|
||||
return;
|
||||
};
|
||||
|
||||
match progress {
|
||||
lsp::WorkDoneProgress::Begin(_) => {
|
||||
if Some(token.as_str()) == disk_based_diagnostics_progress_token {
|
||||
language_server_status.pending_diagnostic_updates += 1;
|
||||
if language_server_status.pending_diagnostic_updates == 1 {
|
||||
|
@ -1659,9 +1659,9 @@ impl Project {
|
|||
self.on_lsp_work_start(server_id, token.clone(), cx);
|
||||
self.broadcast_language_server_update(
|
||||
server_id,
|
||||
proto::update_language_server::Variant::WorkStart(
|
||||
proto::LspWorkStart { token },
|
||||
),
|
||||
proto::update_language_server::Variant::WorkStart(proto::LspWorkStart {
|
||||
token,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1691,14 +1691,6 @@ impl Project {
|
|||
}
|
||||
lsp::WorkDoneProgress::End(_) => {
|
||||
if Some(token.as_str()) == disk_based_diagnostics_progress_token {
|
||||
let language_server_status = if let Some(status) =
|
||||
self.language_server_statuses.get_mut(&server_id)
|
||||
{
|
||||
status
|
||||
} else {
|
||||
return;
|
||||
};
|
||||
|
||||
language_server_status.pending_diagnostic_updates -= 1;
|
||||
if language_server_status.pending_diagnostic_updates == 0 {
|
||||
self.disk_based_diagnostics_finished(cx);
|
||||
|
@ -1719,7 +1711,6 @@ impl Project {
|
|||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue