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

Add functionalities to enable, disable and remove plugins #880

Merged
merged 1 commit into from Jul 28, 2022

Conversation

bbrabbitt
Copy link
Contributor

This PR adds a basic functionality to make wasm plugins able to be enabled, disabled or removed. When disabling a plugin, if the wasm plugin provides a stop function, it will be called. Otherwise, the added code will try to find the LSP started by the plugin and stop it. The PR adds a context menu to the plugin panel to provide enable/disable and remove options. It also fixes the loading problem mentioned in #848 by adding a enum to keep track of the plugin loading status.
Screen Shot 2022-07-27 at 2 53 59 AM
.

@dzhou121
Copy link
Collaborator

A slight improvement is to change the Installed button to a cog icon or something to indicate there's some menu here now.

@bbrabbitt
Copy link
Contributor Author

A slight improvement is to change the Installed button to a or something to indicate there's some menu here now.

Sure I'll add it tomorrow

@MinusGix MinusGix added C-feature Category: New feature or request A-plugins Area: plugin system labels Jul 27, 2022
@MinusGix
Copy link
Member

MinusGix commented Jul 27, 2022

I think it would be better to instead have a single plugins.toml file (in the config folder?) that has a list of what plugins are enabled (or it could be a setting in settings.toml?), rather than a field on each plugins.toml file. This would also extend more naturally to workspace-specific configuration when we add that.

@bbrabbitt
Copy link
Contributor Author

I think it would be better to instead have a single plugins.toml file (in the config folder?) that has a list of what plugins are enabled (or it could be a setting in settings.toml?), rather than a field on each plugins.toml file. This would also extend more naturally to workspace-specific configuration when we add that.

Sure, but I'll store disabled plugins since I just have a HashMap storing disabled plugins.

@bbrabbitt
Copy link
Contributor Author

bbrabbitt commented Jul 28, 2022

I've made the changes accordingly, but there are conflicts to resolve.
Forgot to rebase interactively, my bad.

add plugins.toml to record disabled plugins

revert change to Cargo.toml

fix clippy
@dzhou121 dzhou121 merged commit d6df9c0 into lapce:master Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-plugins Area: plugin system C-feature Category: New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants