Apply schema associations without waiting for the file watcher - #427
Open
holodorum wants to merge 1 commit into
Open
Apply schema associations without waiting for the file watcher#427holodorum wants to merge 1 commit into
holodorum wants to merge 1 commit into
Conversation
The associate/remove schema commands write `.kson-schema.kson` from the server, but the server only reloaded its own `FileSystemSchemaProvider` once the client echoed that write back as `workspace`/`didChangeWatchedFiles`. On macOS that echo comes from `FSEvents`, so `build-macos-arm64` flaked in the VS Code "Status Bar Schema Association" tests: the config file was on disk, yet completions and hover kept reporting no schema. The server wrote the file, so it now picks the change up itself. `CommandExecutor.node` reloads the schema configuration and runs the same `refresh-and-notify` step the watcher handler uses; that step moves out of `startKsonServer` into core/schema/notifySchemaChange so every caller shares one implementation. The watcher path is unchanged -- it is still what catches edits made by the user or other tools -- and a watcher event arriving after a command simply repeats work already done. The tests drive ASSOCIATE_SCHEMA and REMOVE_SCHEMA against a real temp workspace and assert the open document resolves its schema (down to the enum completions it enables) with no didChangeWatchedFiles event in sight.
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.
The associate/remove schema commands write
.kson-schema.ksonfrom the server, but the server only reloaded its ownFileSystemSchemaProvideronce the client echoed that write back asworkspace/didChangeWatchedFiles. On macOS that echo comes fromFSEvents, sobuild-macos-arm64flaked in the VS Code "Status Bar Schema Association" tests: the config file was on disk, yet completions and hover kept reporting no schema.The server wrote the file, so it now picks the change up itself.
CommandExecutor.nodereloads the schema configuration and runs the samerefresh-and-notifystep the watcher handler uses; that step moves out ofstartKsonServerinto core/schema/notifySchemaChange so every caller shares one implementation. The watcher path is unchanged -- it is still what catches edits made by the user or other tools -- and a watcher event arriving after a command simply repeats work already done.The tests drive ASSOCIATE_SCHEMA and REMOVE_SCHEMA against a real temp workspace and assert the open document resolves its schema (down to the enum completions it enables) with no didChangeWatchedFiles event in sight.