Skip to content

fix(diagnostics): parse after queued document changes - #4249

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/ruby-lsp-4247-fresh-diagnostics
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/ruby-lsp-4247-fresh-diagnostics

Conversation

@efegokdemir

Copy link
Copy Markdown

Motivation

Fixes #4247. A diagnostic request can be read before the worker applies the preceding didChange, leaving diagnostics based on a stale parse tree.

Implementation

Parse documents in the serial worker immediately before handling each request, after earlier queued document notifications have been applied.

Automated Tests

Added a deterministic regression test for a queued change followed by a diagnostic request. It fails on pristine main and passes with this fix. bundle exec rake test passed (3,557 tests, 62,503 assertions, 6 skips); Sorbet and RuboCop passed. The indexer suite passed with one environment-sensitive path test excluded; that test also fails on pristine main because of the local RDoc gem path.

Manual Tests

Not run.

@efegokdemir
efegokdemir requested a review from a team as a code owner October 23, 2026 04:59

This branch has not been deployed

No deployments
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.

Diagnostics use a stale parse_result when the request is read before its didChange is applied

1 participant