mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
fix(completion): prefix_str
should be trimmed to element_expression (#15171)
# Description Hot fix of a newly introduced bug by #15086. Forgot to trim the line str according to the expression span, which will disable external command completions in many cases. Also adds the suggestion kind to external commands, for lsp visualization. # User-Facing Changes Before: <img width="246" alt="image" src="https://github.com/user-attachments/assets/c62904f6-0dd7-4368-8f0b-aacd6fe590f0" /> After: <img width="291" alt="image" src="https://github.com/user-attachments/assets/76316649-956f-4828-94cb-41f79d5f94f7" /> I find it better to visually distinguish externals from internals, so `function` for internals and `interface` for externals. But it's arguably not the best option. # Tests + Formatting test case adjusted # After Submitting
This commit is contained in:
@ -727,6 +727,7 @@ impl LanguageServer {
|
||||
SuggestionKind::Command(c) => match c {
|
||||
nu_protocol::engine::CommandType::Keyword => Some(CompletionItemKind::KEYWORD),
|
||||
nu_protocol::engine::CommandType::Builtin => Some(CompletionItemKind::FUNCTION),
|
||||
nu_protocol::engine::CommandType::External => Some(CompletionItemKind::INTERFACE),
|
||||
_ => None,
|
||||
},
|
||||
SuggestionKind::Module => Some(CompletionItemKind::MODULE),
|
||||
|
Reference in New Issue
Block a user