Support per-document read lock - #147
Open
msujew wants to merge 1 commit into
Open
Conversation
msujew
force-pushed
the
msujew/refactor-read-lock
branch
from
August 26, 2026 14:53
836ce5c to
59cdf87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ReadAtmethod to theLockinterface, which allows to read documents at specific states.DocumentStateRequirementsinterface, 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 toRead.Removes the
downgradefunctionality from the lock, which has been replaced withReadAt.WriteandReadare now fully exclusive.Related to eclipse-langium/langium#2214.