Custom lsp commands for file system access - #66
Merged
Conversation
srivastava-diya
approved these changes
Aug 4, 2026
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 branch moves filesystem access out of the language server process and into the client by adding two custom LSP requests,
hyperjump/readFileandhyperjump/findFiles.The LSP has no standard way for a server to ask a client to read an arbitrary file or scan the files in the workspace. Currently, the server accesses the file system directly, but that won't work for all clients. For example, the Monaco Editor allows you to use a VSCode-like editor on a web page. There's no file system in a browser context, so our current solution wouldn't work. This allows the language server to work in those contexts by requiring that each client implement workspace file access however is appropriate for that client.
I updated the Hyperjump file URI plugin and the workspace scan to use these new functions so nothing is depending on filesystem access anymore. I also updated the typescript config so we can enable running the server without compiling using node's type stripping feature which is convenient for neovim configuration.
This also enables some other enhancements we can make later. Currently, schemas need to be saved before we can revalidate instances because Hyperjump can't see the state of open documents, only the saved state. We can now use the custom file URI handler to look in open
documentsfirst to get the editor state and only request the file if it's not open.A similar problem we will have in the future is that not all clients (including neovim) support notifications when files change. We can use a similar approach to enable that support in the neovim client.