mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 15:16:17 +02:00
fix(lsp): a panic caused by completion with decl_id out of range (#15576)
Fixes a bug caused by #15536 Sorry about that, @fdncred # Description I've made the panic reproducible in the test case. TLDR: completer will sometimes return new decl_ids outside of the range of the engine_state passed in. # User-Facing Changes bug fix # Tests + Formatting +1 # After Submitting
This commit is contained in:
@ -69,7 +69,8 @@ impl Completer for ExportableCompletion<'_> {
|
||||
wrapped_name(name),
|
||||
Some(cmd.description().to_string()),
|
||||
None,
|
||||
SuggestionKind::Command(cmd.command_type(), Some(*decl_id)),
|
||||
// `None` here avoids arguments being expanded by snippet edit style for lsp
|
||||
SuggestionKind::Command(cmd.command_type(), None),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user