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

How to unconfig a configed plugin by calling configurePlugin #106402

Closed
CGQAQ opened this issue Sep 10, 2020 · 4 comments
Closed

How to unconfig a configed plugin by calling configurePlugin #106402

CGQAQ opened this issue Sep 10, 2020 · 4 comments
Assignees
Labels
*dev-question VS Code Extension Development Question typescript Typescript support issues

Comments

@CGQAQ
Copy link

CGQAQ commented Sep 10, 2020

How to unconfig a configed plugin by calling configurePlugin(pluginId: string, configuration: ConfigurationField): void; from vscode.typescript-language-features

I tried restart the tsServer by doing this commands.executeCommand("typescript.restartTsServer");, but didn't work

Or how to communicate between the tssever plugin and the languageclient

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 10, 2020

What do you mean by unconfigure? Can you share an example

You can use configure to send a reset to your plugin message if that's what you are after

@CGQAQ
Copy link
Author

CGQAQ commented Sep 10, 2020

@mjbvz I mean just unload the tsserver plugin completely, here's the thing: I need to implement a feature so that the lsp run conditionally determined by both deno.enable and deno.include, I added a flag to the languageserver and client, but the tsserver plugin still configed and don't obay deno.enable and deno.include.
I was thinking just unload the tsserver plugin completely, it's more easily to implement, if not possible, how to send the message to tsserver plugin to let it know it should enable/disable now

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 10, 2020

There's no support for explicitly unloading a plugin. What you probably want to do is make it so that plugin itself can easily enable/disable itself based on a configuration value (or a configuration sent by configurePlugin)

configurePlugin essentially just lets you post messages to a plugin from a vs code extension. Again the specifics depend on your use case but all the tools you need should be there to enable/disable the plugin's functionality based on some configuration

@mjbvz mjbvz closed this as completed Sep 10, 2020
@mjbvz mjbvz added *dev-question VS Code Extension Development Question typescript Typescript support issues labels Sep 10, 2020
@CGQAQ
Copy link
Author

CGQAQ commented Sep 10, 2020

You can use configure to send a reset to your plugin message if that's what you are after

@mjbvz Could I reset it by letting it do nothing? What do you mean by reset? Rerun the tsserver plugin's create method?

@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*dev-question VS Code Extension Development Question typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

2 participants