Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--helix-core/src/completion.rs15
-rw-r--r--helix-term/src/handlers/completion/path.rs3
2 files changed, 16 insertions, 2 deletions
diff --git a/helix-core/src/completion.rs b/helix-core/src/completion.rs
index 0bd111eb..c13b440c 100644
--- a/helix-core/src/completion.rs
+++ b/helix-core/src/completion.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
-use crate::Transaction;
+use crate::{diagnostic::LanguageServerId, Transaction};
#[derive(Debug, PartialEq, Clone)]
pub struct CompletionItem {
@@ -9,4 +9,17 @@ pub struct CompletionItem {
pub kind: Cow<'static, str>,
/// Containing Markdown
pub documentation: String,
+ pub provider: CompletionProvider,
+}
+
+#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
+pub enum CompletionProvider {
+ Lsp(LanguageServerId),
+ Path,
+}
+
+impl From<LanguageServerId> for CompletionProvider {
+ fn from(id: LanguageServerId) -> Self {
+ CompletionProvider::Lsp(id)
+ }
}
diff --git a/helix-term/src/handlers/completion/path.rs b/helix-term/src/handlers/completion/path.rs
index 9fd24ac8..db04c456 100644
--- a/helix-term/src/handlers/completion/path.rs
+++ b/helix-term/src/handlers/completion/path.rs
@@ -6,7 +6,7 @@ use std::{
};
use futures_util::{future::BoxFuture, FutureExt as _};
-use helix_core::{self as core, Selection, Transaction};
+use helix_core::{self as core, completion::CompletionProvider, Selection, Transaction};
use helix_event::TaskHandle;
use helix_stdx::path::{self, canonicalize, fold_home_dir, get_path_suffix};
use helix_view::Document;
@@ -103,6 +103,7 @@ pub(crate) fn path_completion(
label: file_name.into(),
transaction,
documentation,
+ provider: CompletionProvider::Path,
}))
})
.collect::<Vec<_>>()