Skip to content

Don't send bundled file watchers to client#3840

Open
xuanduc987 wants to merge 1 commit into
microsoft:mainfrom
xuanduc987:main
Open

Don't send bundled file watchers to client#3840
xuanduc987 wants to merge 1 commit into
microsoft:mainfrom
xuanduc987:main

Conversation

@xuanduc987
Copy link
Copy Markdown

The LSP server was requesting clients to watch embedded TypeScript library files using the pattern 'bundled:///libs/**/*'.

This PR filter out bundled watchers before sending them to the client in the updateWatch function to prevent this invalid request.

The LSP server was requesting clients to watch embedded TypeScript
library files using the pattern 'bundled:///libs/**/*'.

This commit filter out bundled watchers before sending them to the
client in the updateWatch function to prevent this invalid request.
Copilot AI review requested due to automatic review settings May 14, 2026 07:06
@jakebailey
Copy link
Copy Markdown
Member

I have never seen this happen. Do you have a test which shows this?

Note that we largely don't expect anyone to ever actually run the server with assets bundled.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents the language server from requesting client-side filesystem watches for embedded (“bundled:///…”) TypeScript library paths, which are not watchable by the client. It does this by filtering bundled watch globs before calling the LSP client registration API in updateWatch.

Changes:

  • Added internal/bundled dependency to session watch-updating logic.
  • Skipped registering FileSystemWatcher entries whose glob patterns are bundled:///… URIs to avoid invalid client watch requests.

Comment on lines +1159 to +1162
// Skip bundled paths - they are embedded so the client cannot watch them.
if bundled.IsBundled(fileSystemWatcherGlobString(watcher)) {
continue
}
@xuanduc987
Copy link
Copy Markdown
Author

I'm currently using the typescript-go package from nixpkgs https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/ty/typescript-go/package.nix
I believe it bundled all assets into a standalone executable

Note that we largely don't expect anyone to ever actually run the server with assets bundled.

Is this documented anywhere? If this is a intended constraint, I'll raise an issue over at nixpkgs

@jakebailey
Copy link
Copy Markdown
Member

No, but it's just hereby build which does all the work to build it, and the herebyfile contains more info about how we build the releases

@jakebailey
Copy link
Copy Markdown
Member

I don't think this PR is wrong, but we probably need a test that is conditional on whether or not embedding is enabled

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.

3 participants