Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in Language Server with invalid grammar #36

Open
notpeter opened this issue Aug 30, 2023 · 0 comments
Open

Crash in Language Server with invalid grammar #36

notpeter opened this issue Aug 30, 2023 · 0 comments
Assignees
Labels
bug Something isn't working server

Comments

@notpeter
Copy link
Contributor

Describe the bug

Invalid (WIP) grammars can crash Pest Language Server

To Reproduce

  1. Type: Statement = { ( | "a" ) }
  2. Save.
  3. 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
@notpeter notpeter added the bug Something isn't working label Aug 30, 2023
@Jamalam360 Jamalam360 self-assigned this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server
Projects
None yet
Development

No branches or pull requests

2 participants