mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 08:40:14 +02:00
refactor(lsp): span fix made easy by bumping lsp-textdocument to 0.4.2 (#15287)
# Description The upstream crate fixed a bug of position calc, which made some extra checking in lsp unnecessary. Also moved some follow-up fixing of #15238 from #15270 here, as it has something to do with previous position calc bug. # User-Facing Changes # Tests + Formatting Adjusted # After Submitting
This commit is contained in:
@ -307,9 +307,8 @@ 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)
|
||||
span.start += 1;
|
||||
};
|
||||
suggestions.extend(self.command_completion_helper(
|
||||
working_set,
|
||||
|
Reference in New Issue
Block a user