pest-ide-tools
pest-ide-tools copied to clipboard
Crash in Language Server with invalid grammar
Describe the bug
Invalid (WIP) grammars can crash Pest Language Server
To Reproduce
- Type:
Statement = { ( | "a" ) } - Save.
- Watch language server crash 5 times.
I was in the middle of editing something. It was more complex than this, but basically was: Statement = { ( "b" | "a" ) } and I deleted the "b", but before I could type something new the lsp went kaput.
Log
thread 'main' panicked at 'Expected prefix or primary expression, found choice_operator(16, 17)', /Users/peter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pest-2.7.2/src/pratt_parser.rs:346:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior
LSP should never crash. Even on unexpected input.
Environment (please complete the following information):
- OS: MacOS Ventura 13.4.1 (a)
- Editor: vscode
- Server Version: v0.3.3