cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.09k stars 77 forks source link

parsed actions: Better error message on failed parse #2438

Open pokey opened 2 weeks ago

pokey commented 2 weeks ago

The error message when the user gives a malformed custom command is not very helpful. We should probably use the VSCode output channel to show them the error that comes from our parser:

Error: invalid syntax at line 1 col 22:

1  chuck block <target> and <target>
                        ^
Unexpected input (lexer error). I did not expect any more input. Here is the state of my parse table:

    mark → %placeholderMark ● 
    primitiveTarget → primitiveTarget$ebnf$2 mark ● 
    target → primitiveTarget ● 
    action → %simpleActionName target ● 
    main → action ● 

This seems like a good place to start