-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Support supplying a watchFactory option that resolves the plugin and uses it for watching file or directory
#51074
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
Closed
Conversation
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
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 |
d1d7469 to
2e5534d
Compare
43a3958 to
83a0fa2
Compare
watchFactory option that resolves the plugin and uses it for watching file or directory
8bcf7de to
18bf8ce
Compare
52da5a5 to
129896e
Compare
f660f6b to
5d652ba
Compare
It shows that some of the watches couldnt be overriden before project is created
… server which follows same locations as other Plugins
5d652ba to
9031ac6
Compare
Member
Author
|
Close in favor of #54012 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Author: Team
Experience Enhancement
Noncontroversial enhancements
Experiment
A fork with an experimental idea which might not make it into master
For Uncommitted Bug
PR for untriaged, rejected, closed or missing bug
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.
With this change we allow users to use custom
watchFactoryplugin either on command line or in editorFor plugin writers the plugin is expected to be module that returns the factory with methods to
watchFileandwatchDirectoryThis behaves similar to language service plugin as in user can have this set in
tsconfig.jsoninwatchOptionsaswatchFactory, pass it on command line during batch compilation or set in vscode's globalwatchOptionswatchFactoryoption can either be module name to look for or it can bePluginImportwhich is object literal with propertynamethat is resolved as name and the object literal is passed on to the factory.The sample
watchFactoryusing@parcel/watcheris athttps://github.com/sheetalkamat/typescript-parcel-watcherThe changes in PR include:
watchFactoryinwatchOptionsthat takes in eitherstringorobject literal. The name of the factory needs to be package name to resolve (just like our LS plugins`watchFileorwatchDirectorywe look for this resolved module and use the specific function if available.onConfigurationChangedsimilar to we call for LS plugins when editor uses protocol to do so.Eg plugin using parcel watcher is at https://github.com/sheetalkamat/typescript-parcel-watcher
Installing:
git clone https://github.com/sheetalkamat/typescript-parcel-watcher.git cd typescript-parcel-watcher npm i npm run buildUsage:
At this point you can pass
--watchFactory typescript-parcel-watcherto tsc or set it inwatchOptionsof config file and/or vscode settings.