-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 supplying a watchFactory
option that resolves the plugin and uses it for watching file or directory
#51074
Closed
Conversation
This file contains 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
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 |
sheetalkamat
added
Experiment
A fork with an experimental idea which might not make it into master
Experience Enhancement
Noncontroversial enhancements
labels
Oct 5, 2022
sheetalkamat
force-pushed
the
watchPlugins
branch
10 times, most recently
from
October 10, 2022 23:06
d1d7469
to
2e5534d
Compare
sheetalkamat
force-pushed
the
watchPlugins
branch
8 times, most recently
from
November 10, 2022 03:08
43a3958
to
83a0fa2
Compare
typescript-bot
added
Author: Team
For Uncommitted Bug
PR for untriaged, rejected, closed or missing bug
labels
Nov 10, 2022
sheetalkamat
changed the title
[WIP] Watch plugin
Support supplying Nov 10, 2022
watchFactory
option that resolves the plugin and uses it for watching file or directory
sheetalkamat
requested review from
jakebailey,
mjbvz,
andrewbranch,
rbuckton and
DanielRosenwasser
November 10, 2022 03:27
sheetalkamat
force-pushed
the
watchPlugins
branch
5 times, most recently
from
March 13, 2023 21:20
8bcf7de
to
18bf8ce
Compare
sheetalkamat
force-pushed
the
watchPlugins
branch
2 times, most recently
from
March 21, 2023 19:01
52da5a5
to
129896e
Compare
sheetalkamat
force-pushed
the
watchPlugins
branch
3 times, most recently
from
April 10, 2023 23:04
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
sheetalkamat
force-pushed
the
watchPlugins
branch
from
April 13, 2023 21:54
5d652ba
to
9031ac6
Compare
Close in favor of #54012 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
watchFactory
plugin either on command line or in editorFor plugin writers the plugin is expected to be module that returns the factory with methods to
watchFile
andwatchDirectory
This behaves similar to language service plugin as in user can have this set in
tsconfig.json
inwatchOptions
aswatchFactory
, pass it on command line during batch compilation or set in vscode's globalwatchOptions
watchFactory
option can either be module name to look for or it can bePluginImport
which is object literal with propertyname
that is resolved as name and the object literal is passed on to the factory.The sample
watchFactory
using@parcel/watcher
is athttps://github.com/sheetalkamat/typescript-parcel-watcher
The changes in PR include:
watchFactory
inwatchOptions
that takes in eitherstring
orobject literal
. The name of the factory needs to be package name to resolve (just like our LS plugins`watchFile
orwatchDirectory
we look for this resolved module and use the specific function if available.onConfigurationChanged
similar 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 build
Usage:
At this point you can pass
--watchFactory typescript-parcel-watcher
to tsc or set it inwatchOptions
of config file and/or vscode settings.