Skip to content

Conversation

@sandersn
Copy link
Member

@sandersn sandersn commented Mar 31, 2022

  1. I moved the virtual file system with watch code to a new project. The server now depends on this new project.
  2. The test of the new server message still needs to move to a separate file.

Edit: Remaining work

  1. Should the plugin system start providing a separate FileServerHost to plugins, or should it create a hybrid host that delegates to a fshost in case it's running in the browser?
  2. The ATA installer assumes that it can run npm install on a local disk. It'll have to be substantially rewritten.
  3. The message-based system won't scale very far -- I want to investigate @jakebailey 's idea for starting an in-browser server to let tsserver request files from vs code.

Partly fixes #47600 -- there is probably more work needed here and definitely in vs code.

@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary

@sandersn sandersn requested a review from sheetalkamat March 31, 2022 15:46
@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Mar 31, 2022
I'm not sure why this fails locally, I suspect I need to `npm ci`.
sandersn added 7 commits June 7, 2022 16:12
This removes fshost usage in most places except for construction of
objects.
Instead, pass in additional configuration from TestServerHost
1. Move VirtualServerHost code to correct vfs/harness location.
2. Serialise watch and timeout information.
3. Improve test by modifying an unopened file.
4. Test can run arbitrary actions in addition to commands.
};
}
return this.projectService.host;
return {
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed either ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I put this here to provide a ModuleResolutionHost which uses the projectService's [fs]host for fileExists, directoryExists, realpath, useCaseSensitiveFileNames instead of this.program.fileExists/directoryExists/realpath/useCaseSensitiveFileNames. Maybe it's not needed? I don't know.

1. Reimplement recursive deleting in VirtualServerHost.deleteFile
2. Save a private fshost, then all VirtualServerHost methods directly.
3. Switch from asserts to logs when fshost isn't a valid VirtualServerHost.
@sandersn
Copy link
Member Author

This is obsoleted by the virtual filesystem written by the vscode team, and the tsserver host that I wrote for vscode to use it.

@sandersn sandersn closed this Apr 11, 2023
@jimkyndemeyer
Copy link

This is obsoleted by the virtual filesystem written by the vscode team, and the tsserver host that I wrote for vscode to use it.

@sandersn can you provide links to both? Would be interesting to see how the solution was implemented. Thanks :)

@sandersn
Copy link
Member Author

The tsserver host is in vscode's repo at extensions/typescript-language-features/web/tsServer.ts
The initial PR is microsoft/vscode#169311 -- it adds some filesystem packages whose source you can look up on github.

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Virtual file system support in TSServer

7 participants