Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for didChangeWatchedFiles workspace method #171

Closed
corneliusweig opened this issue Nov 18, 2020 · 2 comments
Closed

Support for didChangeWatchedFiles workspace method #171

corneliusweig opened this issue Nov 18, 2020 · 2 comments

Comments

@corneliusweig
Copy link

The language server protocol defines the didChangeWatchedFiles workspace method to notify the language server about changes in files that are part of the workspace, but not currently opened. It is encouraged to support this method, to reduce the number of processes that watch for files and thus unnecessarily use more system resources.

My understanding is that typescript-language-server currently uses the node file watching APIs of the underlying tsserver to watch for such file changes, which ignores this protocol method. Are there plans to support the didChangeWatchedFiles method in the future? Or are there fundamental obstacles that make this impossible?

@rchl
Copy link
Member

rchl commented Nov 13, 2021

As you said, currently tsserver does the file watching.

Typescript's code is massive and what it watches exactly and when is not documented anywhere so:

  • moving that logic to the typescript-language-server's side would be major undertaking
  • I don't believe there is an API to notify tsserver about unopened file being changed (though I haven't researched much)
  • I haven't even seen an option to disable tsserver's own file watching.

So I would say that the way it works now is "as designed" and it's not really viable to change that.

@rchl rchl closed this as completed Nov 13, 2021
@corneliusweig
Copy link
Author

Ok, thanks for the clarification.

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

No branches or pull requests

2 participants