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

PluginModule.onConfigurationChanged not called when plugin config in tsconfig.json changes #28969

Open
ajafff opened this issue Dec 11, 2018 · 3 comments
Assignees
Labels
Domain: TSServer Issues related to the TSServer Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@ajafff
Copy link
Contributor

ajafff commented Dec 11, 2018

TypeScript Version: 3.3.0-dev.20181208

Search Terms:

plugin configuration change
onConfigurationChanged

Expected behavior:

PluginModule.onConfigurationChanged is called when the configuration of the plugin in tsconfig.json changes. The Project already watches the tsconfig.json and therefore knows when the config of a plugin changes.

Actual behavior:

PluginModule.onConfigurationChanged is only called when the client sends a ConfigurePlugin command.

Related Issues:
#15915 is basically the same issue from 1,5 years ago. Back then it was decided this is working as intended and a plugin is responsible for watching the config file.
In the meantime onConfigurationChanged was introduced in #28106. Since ConfigurePlugin command is supposed to override any config in tsconfig.json, a plugin that watches for config file changes would need special handling to account for that fact.

@weswigham weswigham added the Experience Enhancement Noncontroversial enhancements label Dec 11, 2018
@weswigham weswigham added the Domain: TSServer Issues related to the TSServer label Dec 11, 2018
@ajafff
Copy link
Contributor Author

ajafff commented Dec 12, 2018

Related note: since configurePlugin overrides plugin configuration from tsconfig.json, there is no way for a plugin to know if the initial config is actually from tsconfig.json or configurePlugin command.

@sheetalkamat
Copy link
Member

The design in #28106 was to override the globally configured plugin options all the time. So if the plugin is configured globally the local changes in the tsconfig file for plugin options have no effect.
@minestarks please let me know if this was not desired outcome. Thanks

@minestarks
Copy link
Member

I'm not aware of any way to specify a plugin configuration in tsconfig.json. Could someone point me to an example? I can't find in the source where tsserver might be reading such options. If plugins have the ability to parse out custom options from tsconfig.json, then I don't think tsserver is involved, so I'm not sure how we could be watching for changes.

I agree with Sheetal about the intention of #28106 - the server command configurePlugin overrides all plugin options, and at the time I thought that was pretty much the only way plugin configurations can be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: TSServer Issues related to the TSServer Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants