diff options
author | Erasin | 2022-07-26 01:26:50 +0000 |
---|---|---|
committer | GitHub | 2022-07-26 01:26:50 +0000 |
commit | 42115d02bc9236adf7d1aa81029ca6a12856a160 (patch) | |
tree | 5181c987d5e68c310d17827b9b1707c317073964 /helix-term | |
parent | 4f21f430e48fbeb88cd4296310d813d7affd19e6 (diff) |
Suport diagnostic code (#3096)
* add code for diagnostic.
This PR provides a solution to resolve #2994. missing Code Actions for lsp
* remote unused import
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/application.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 3ee5481f..737b1cad 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -2,6 +2,7 @@ use arc_swap::{access::Map, ArcSwap}; use futures_util::Stream; use helix_core::{ config::{default_syntax_loader, user_syntax_loader}, + diagnostic::NumberOrString, pos_at_coords, syntax, Selection, }; use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap}; @@ -556,12 +557,24 @@ impl Application { } }; + let code = match diagnostic.code.clone() { + Some(x) => match x { + lsp::NumberOrString::Number(x) => { + Some(NumberOrString::Number(x)) + } + lsp::NumberOrString::String(x) => { + Some(NumberOrString::String(x)) + } + }, + None => None, + }; + Some(Diagnostic { range: Range { start, end }, line: diagnostic.range.start.line as usize, message: diagnostic.message.clone(), severity, - // code + code, // source }) }) |