Skip to content

Commit 9ea2900

Browse files
committed
fix: suggestion kind
1 parent b6d83f9 commit 9ea2900

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

crates/nu-cli/src/completions/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub struct SemanticSuggestion {
3131
pub enum SuggestionKind {
3232
Command(nu_protocol::engine::CommandType),
3333
Type(nu_protocol::Type),
34+
Module,
3435
}
3536

3637
impl From<Suggestion> for SemanticSuggestion {

crates/nu-cli/src/completions/dotnu_completions.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use nu_protocol::{
66
use reedline::Suggestion;
77
use std::path::{is_separator, PathBuf, MAIN_SEPARATOR as SEP, MAIN_SEPARATOR_STR};
88

9-
use super::SemanticSuggestion;
9+
use super::{SemanticSuggestion, SuggestionKind};
1010

1111
#[derive(Clone, Default)]
1212
pub struct DotNuCompletion {}
@@ -112,8 +112,7 @@ impl Completer for DotNuCompletion {
112112
append_whitespace,
113113
..Suggestion::default()
114114
},
115-
// TODO????
116-
kind: None,
115+
kind: Some(SuggestionKind::Module),
117116
}
118117
})
119118
.collect::<Vec<_>>()

crates/nu-lsp/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ impl LanguageServer {
668668
.map(|kind| match kind {
669669
SuggestionKind::Type(t) => t.to_string(),
670670
SuggestionKind::Command(cmd) => cmd.to_string(),
671+
SuggestionKind::Module => "".to_string(),
671672
})
672673
.map(|s| CompletionItemLabelDetails {
673674
detail: None,
@@ -715,6 +716,7 @@ impl LanguageServer {
715716
nu_protocol::engine::CommandType::Builtin => Some(CompletionItemKind::FUNCTION),
716717
_ => None,
717718
},
719+
SuggestionKind::Module => Some(CompletionItemKind::MODULE),
718720
})
719721
}
720722
}

0 commit comments

Comments
 (0)