mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 09:18:04 +02:00
fix(lsp): completion on command with following text (#15238)
# Description Fixes a bug introduced by #15188 # User-Facing Changes Before: <img width="216" alt="image" src="https://github.com/user-attachments/assets/5846a844-d88e-4d9f-b9e2-e2478c7acb37" /> And will crash the lsp server. After: <img width="454" alt="image" src="https://github.com/user-attachments/assets/85e727d6-fef5-426b-818c-e554d3c49c7d" /> # Tests + Formatting adjusted # After Submitting
This commit is contained in:
@ -307,6 +307,7 @@ impl NuCompleter {
|
||||
let need_externals = !prefix_str.contains(' ');
|
||||
let need_internals = !prefix_str.starts_with('^');
|
||||
let mut span = element_expression.span;
|
||||
span.end = std::cmp::min(span.end, pos + 1);
|
||||
if !need_internals {
|
||||
span = Span::new(span.start + 1, span.end)
|
||||
};
|
||||
|
Reference in New Issue
Block a user