Repository navigation
Conversation
Keep disk notifications separate from client document ownership. Invalidate closed-file contributions immediately and defer invalidation for open files until the last matching buffer closes. Guard analysis publication by document lifetime and version, and keep it outside the computation timeout so cancellation cannot strand document locks. Retain cancellation-before-close ordering and match paths before locking. Cover document ownership, cached contributions, URI aliases, malformed notifications, retired results and pending-query concurrency with regressions.
Publish analysis before optional disk verification. Reuse the existing cancellable scheduler to compare the accepted source text with its file, limiting comparison input and allocation to the analyzed text. Only file URIs can establish provenance, and positive results must still match the document lifetime, version and accepted contribution. Reuse close-time invalidation while provenance is unverified or a watched disk change has been observed. Preserve prior provenance on failed analysis and retain verified contributions after close. Closing before verification finishes can conservatively discard the cache. Cover unsaved edits, saved analysis, failed expansion, aliases, reopened lifetimes, bounded reads, Unicode, URI schemes, stalled disk access, query completion and cancellation. Alias contribution ownership remains separate.
Reuse the open-document registry, decoded-path matching and existing close-time invalidation. When another URI for the path remains open, replace the closed document's cached facts with surviving accepted contributions, reading and publishing under each document's lock. Remove cached facts when no survivor has accepted analysis. Keep verified final-close retention and watched-event behavior unchanged. No additional analysis, ownership state or scheduler changes are needed. Cover publication and closing orders, failed or absent analysis, clean retention, reopening, three aliases and concurrent publication. Check actual reference locations and preserve the current contribution on disk events while aliases remain open.
Invalidate cached facts for both the source and destination paths using the same file-URI validation and invalidation as watched-file events. Decode the complete batch before applying changes. Leave open buffers, versions and pending requests under the client's textDocument lifecycle. Its didOpen notification already schedules analysis at the new URI; synthesizing close/open here can overwrite an open destination and create a replacement with no analysis. Cover closed destination caches, client notification orderings, encoded aliases, pending requests, malformed batches and non-file URIs. Preserve accepted contributions while buffers remain open and retire them through the existing close-time rules.
Hold the document read lock through folder republication so an older snapshot cannot overwrite a newer accepted contribution. Restore alias contributions on close without treating the close as a disk event. Verify each new accepted analysis against disk, allowing cache retention to recover after a reported disk change while preserving invalidation for later events and failed or disk-mismatching analysis. Add controlled publication and cache-retention regressions, and describe closed-file reference retention.
The lifecycle fixtures use first at line 2, but selecting the first key of their reference hash can return require instead. Hash traversal order varies across runtimes, causing the tests to inspect unrelated locations. Use the existing document binding query at the fixture's source position. Keep the reference-count, location, cache-retention, and concurrency assertions unchanged.
Complete current analysis after errors and timeouts while preserving the last accepted contribution. Guard completion with the running record so obsolete same-version runs cannot publish or drain newer requests. Recheck readiness when registering pending queries and keep failure completion cancellable. Cover actual expansion failures, publication errors, timeout completion, cancellation, and replacement races.
Hold the fixture at a semaphore during macro expansion until both pending requests are registered. Keep the real expansion and publication failures, completion assertions, and existing response deadlines. Suspending the scheduler while it waits on an async channel can leave queued jobs dormant after resumption on Racket 8.17 BC. The fixture no longer suspends the scheduler or depends on its private thread binding.
Collaborator
|
Thanks for addressing this. But this goes beyond what I intended in #239 . My idea was to let Current implementation is over complex. It covers
and changes multiple modules who actually do not need to know about the disk files concepts, like SafeDoc. |
Collaborator
|
Thanks! |
6cdh
approved these changes
Sep 30, 2026
Collaborator
|
Let's wait for @dannypsnl review then merge. |
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.
Make
workspace/didChangeWatchedFilesa no-op so disk notifications cannot close or replace editor-owned documents. This follows the scope requested in review; the broader analysis, cache and rename changes have been removed from this PR.