Skip to content

Support per-document read lock - #147

Open
msujew wants to merge 1 commit into
mainfrom
msujew/refactor-read-lock
Open

Support per-document read lock#147
msujew wants to merge 1 commit into
mainfrom
msujew/refactor-read-lock

Conversation

@msujew

@msujew msujew commented Aug 26, 2026

Copy link
Copy Markdown
Member

This PR attempts to fix a similar problem as our implementation already does inside of Langium. Some services require only specific document states to be available. For example, a document symbol request can be immediately resolved, once the document has been succesfully parsed - without waiting for the build to finish, or even references to be linked.

This change adds two main features for this:

  1. Adds a ReadAt method to the Lock interface, which allows to read documents at specific states.
  2. Adds a DocumentStateRequirements interface, that LSP services can (optionally) implement to start reading at a specific workspace/document state. Any service that does not implement this interface falls back to Read.

Removes the downgrade functionality from the lock, which has been replaced with ReadAt. Write and Read are now fully exclusive.

Related to eclipse-langium/langium#2214.

@msujew
msujew requested a review from spoenemann August 26, 2026 14:48
@msujew
msujew force-pushed the msujew/refactor-read-lock branch from 836ce5c to 59cdf87 Compare August 26, 2026 14:53
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.

1 participant