Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/diagnostic.rs')
-rw-r--r--helix-core/src/diagnostic.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/helix-core/src/diagnostic.rs b/helix-core/src/diagnostic.rs
index 333c9409..ba7df1b0 100644
--- a/helix-core/src/diagnostic.rs
+++ b/helix-core/src/diagnostic.rs
@@ -50,8 +50,20 @@ pub struct Diagnostic {
pub data: Option<serde_json::Value>,
}
-// TODO turn this into an enum + feature flag when lsp becomes optional
-pub type DiagnosticProvider = LanguageServerId;
+#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
+pub enum DiagnosticProvider {
+ Lsp { server_id: LanguageServerId },
+ // Future internal features can go here...
+}
+
+impl DiagnosticProvider {
+ pub fn language_server_id(&self) -> Option<LanguageServerId> {
+ match self {
+ Self::Lsp { server_id, .. } => Some(*server_id),
+ // _ => None,
+ }
+ }
+}
// while I would prefer having this in helix-lsp that necessitates a bunch of
// conversions I would rather not add. I think its fine since this just a very