From 4960c41f18d93e8b4c48a7c4e96f00d948cfad5f Mon Sep 17 00:00:00 2001 From: sigmaSd Date: Fri, 2 Dec 2022 02:18:45 +0100 Subject: feat(lsp): add support for lsp Diagnostic{}.data (#4935) --- helix-lsp/src/lib.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'helix-lsp') diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 5de76c6c..abc930f8 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -102,16 +102,17 @@ pub mod util { None }; - // TODO: add support for Diagnostic.data - lsp::Diagnostic::new( - range_to_lsp_range(doc, range, offset_encoding), + lsp::Diagnostic { + range: range_to_lsp_range(doc, range, offset_encoding), severity, code, - diag.source.clone(), - diag.message.to_owned(), - None, + source: diag.source.clone(), + message: diag.message.to_owned(), + related_information: None, tags, - ) + data: diag.data.to_owned(), + ..Default::default() + } } /// Converts [`lsp::Position`] to a position in the document. -- cgit v1.2.3-70-g09d2