Skip to content

Commit c91cbda

Browse files
committed
Remove related documents changes
1 parent 5e3c811 commit c91cbda

File tree

1 file changed

+7
-31
lines changed

1 file changed

+7
-31
lines changed

helix-term/src/handlers/diagnostics.rs

+7-31
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ fn handle_pull_diagnostics_response(
248248
uri: Uri,
249249
document_id: DocumentId,
250250
) {
251-
let related_documents = match result {
251+
match result {
252252
lsp::DocumentDiagnosticReportResult::Report(report) => {
253-
let (result_id, related_documents) = match report {
253+
let result_id = match report {
254254
lsp::DocumentDiagnosticReport::Full(report) => {
255255
editor.handle_lsp_diagnostics(
256256
&provider,
@@ -259,41 +259,17 @@ fn handle_pull_diagnostics_response(
259259
report.full_document_diagnostic_report.items,
260260
);
261261

262-
(
263-
report.full_document_diagnostic_report.result_id,
264-
report.related_documents,
265-
)
262+
report.full_document_diagnostic_report.result_id
263+
}
264+
lsp::DocumentDiagnosticReport::Unchanged(report) => {
265+
Some(report.unchanged_document_diagnostic_report.result_id)
266266
}
267-
lsp::DocumentDiagnosticReport::Unchanged(report) => (
268-
Some(report.unchanged_document_diagnostic_report.result_id),
269-
report.related_documents,
270-
),
271267
};
272268

273269
if let Some(doc) = editor.document_mut(document_id) {
274270
doc.previous_diagnostic_id = result_id;
275271
};
276-
277-
related_documents
278272
}
279-
lsp::DocumentDiagnosticReportResult::Partial(report) => report.related_documents,
273+
lsp::DocumentDiagnosticReportResult::Partial(_) => {}
280274
};
281-
282-
for (url, report) in related_documents.into_iter().flatten() {
283-
let result_id = match report {
284-
lsp::DocumentDiagnosticReportKind::Full(report) => {
285-
let Ok(uri) = Uri::try_from(&url) else {
286-
continue;
287-
};
288-
289-
editor.handle_lsp_diagnostics(&provider, uri, None, report.items);
290-
report.result_id
291-
}
292-
lsp::DocumentDiagnosticReportKind::Unchanged(report) => Some(report.result_id),
293-
};
294-
295-
if let Some(doc) = editor.document_by_path_mut(url.path()) {
296-
doc.previous_diagnostic_id = result_id;
297-
}
298-
}
299275
}

0 commit comments

Comments
 (0)