summaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorErasin2022-07-26 01:26:50 +0000
committerGitHub2022-07-26 01:26:50 +0000
commit42115d02bc9236adf7d1aa81029ca6a12856a160 (patch)
tree5181c987d5e68c310d17827b9b1707c317073964 /helix-core/src
parent4f21f430e48fbeb88cd4296310d813d7affd19e6 (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-core/src')
-rw-r--r--helix-core/src/diagnostic.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-core/src/diagnostic.rs b/helix-core/src/diagnostic.rs
index 210ad639..48a68dc0 100644
--- a/helix-core/src/diagnostic.rs
+++ b/helix-core/src/diagnostic.rs
@@ -23,6 +23,12 @@ pub struct Range {
pub end: usize,
}
+#[derive(Debug, Eq, Hash, PartialEq, Clone, Deserialize, Serialize)]
+pub enum NumberOrString {
+ Number(i32),
+ String(String),
+}
+
/// Corresponds to [`lsp_types::Diagnostic`](https://docs.rs/lsp-types/0.91.0/lsp_types/struct.Diagnostic.html)
#[derive(Debug, Clone)]
pub struct Diagnostic {
@@ -30,4 +36,5 @@ pub struct Diagnostic {
pub line: usize,
pub message: String,
pub severity: Option<Severity>,
+ pub code: Option<NumberOrString>,
}