Skip to content

Update graph on edits - #4032

Merged
vinistock merged 1 commit into
rubydex_adoption_feature_branchfrom
vs_handle_incremental_edits
Mar 30, 2026
Merged

vinistock merged 1 commit into
rubydex_adoption_feature_branchfrom
vs_handle_incremental_edits

Conversation

@vinistock

Copy link
Copy Markdown
Member

Motivation

Start updating the graph when incremental edits happen. This PR handles both in-memory modifications (textDocument/didChange) and changes committed to disk (workspace/didChangeWatchedFiles).

Implementation

Some key decisions:

  1. Incremental indexing and resolution now happens immediately for in-memory edits. We received feedback from several users that not every editor fires all feature requests and so attaching indexing to them is not adequate (Improve indexing behaviour (for editors other than VS Code, e.g. Zed) #3384). Additionally, Rubydex incremental indexing and resolution should be fast enough that we can do it every time
  2. I removed Store#push_edits. That method didn't add much and I needed the document instance to access the source after modifications
  3. Watched file notifications always send a string URI for the change[:uri], so I ensured all of our tests accurately reflected that

@vinistock
vinistock requested review from alexcrocha and st0012 March 26, 2026 19:24
@vinistock vinistock self-assigned this Mar 26, 2026
@vinistock
vinistock requested a review from a team as a code owner March 26, 2026 19:24
@vinistock vinistock added server This pull request should be included in the server gem's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Mar 26, 2026
@vinistock vinistock mentioned this pull request Mar 26, 2026
16 of 19 tasks
Comment thread lib/ruby_lsp/server.rb Outdated
Comment thread test/server_test.rb Outdated
@vinistock
vinistock force-pushed the vs_handle_incremental_edits branch from 4fabf04 to 904019d Compare March 30, 2026 13:15
Comment thread lib/ruby_lsp/server.rb
Comment thread lib/ruby_lsp/server.rb
@vinistock
vinistock merged commit 4a0f2a1 into rubydex_adoption_feature_branch Mar 30, 2026
40 checks passed
@vinistock
vinistock deleted the vs_handle_incremental_edits branch March 30, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

other Changes that aren't bugfixes, enhancements or breaking changes server This pull request should be included in the server gem's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants