Skip to content

Support parser/lexer cancellation - #156

Open
msujew wants to merge 4 commits into
mainfrom
msujew/parser-cancellation
Open

msujew wants to merge 4 commits into
mainfrom
msujew/parser-cancellation

Conversation

@msujew

@msujew msujew commented Oct 15, 2026

Copy link
Copy Markdown
Member

Closes #139

This is a relatively simple change that allows us to fix an issue that plagued us in Langium since its inception: Cancellation of in-progress lexer/parser runs. This ensures that we can immediately react to changes in the editors, instead of having to wait for lexer/parser runs to finish before doing that. In total, this means that every step of the builder is now 100% instantly cancellable.

@Lotes

Lotes commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

One possible bug that I had in mind was about the state after the cancellation in the middle of a parse call.

Claude helped to find such cases: REVIEW-parser-cancellation.md (1 high, 3 medium, 3 low findings).

@msujew

msujew commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

Some of the issues in there are already resolved by #147, which should be merged first.

@msujew
msujew force-pushed the msujew/parser-cancellation branch 2 times, most recently from 09c25c1 to ac108a8 Compare October 22, 2026 09:52
^ Conflicts:
^	examples/statemachine/benchmark_test.go
^	parser/parser.go
^	workspace/document_parser.go

^ Conflicts:
^	examples/arithmetics/completion_parser_gen.go
^	examples/statemachine/completion_parser_gen.go
^	internal/generator/parser_generator.go
^	internal/grammar/completion_parser_gen.go
^	internal/languages/completion/completion_parser_gen.go
^	internal/languages/lookahead/completion_parser_gen.go
^	internal/languages/token_groups/completion_parser_gen.go
^	internal/languages/token_modes/completion_parser_gen.go
^	parser/completion_parser.go
@msujew
msujew force-pushed the msujew/parser-cancellation branch from ac108a8 to 3db1c3a Compare October 22, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Parser] Abort in-progress parser

2 participants