Open MikkelPaulson opened 11 months ago
@alfonsomartinezs If you're interested, this might help to your understanding of the nuances of command parsing.
After some experimentation with this in the browser, I discovered that after creating an NPC named "Journal", you can actually call your journal if you've already used the command, by pressing up and then enter. It's typing "j" in the box that causes the panic.
Correct, the panic is in the autocomplete code, not the command parsing. Those are unfortunately two completely different code blocks that do effectively the same thing by way of incomplete vs. complete parsing (#104). Accessing it through the command history will bypass the autocomplete code altogether.
Steps to reproduce:
npc named journal
.j
.panicked at 'internal error: entered unreachable code', core/src/storage/command.rs:367:30
The
unreachable!()
code should actually be unreachable - the problem is that theparse_input
on line 352 is returning multiple results and theif let
block is choosing the canonicalStorageCommand::Journal
result rather than the fuzzyStorageCommand::Load { .. }
result, which is what we're actually concerned with at that point.