Skip to content

Add variables to better customize plugin directories #2147

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

Merged
merged 6 commits into from
Oct 9, 2020
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Sep 30, 2020

  • Still loads all plugins from the plugins directory as before
    • But now PLUGIN_DIR will set that directory instead of being used to specify an individual plugin
    • This is the directory I envision being used for distributing code-server with plugins or where plugins would be placed for running instances of code-server in production by users
  • PLUGIN_DIRS can be used to set multiple individual plugins if you don't want to move them into a single directory
    • Really only intended for development

Lemme know if we wanna change this up, this is just based off the VS Code plugin structure (except they use command line flags and not environment variables).

Closes #2122.

@code-asher
Copy link
Member Author

code-asher commented Sep 30, 2020

Default plugin dir should actually use XDG I think. Thoughts? Having it inside code-server is weird, except maybe for built-in plugins. So maybe we should load both.

@code-asher
Copy link
Member Author

I went ahead and did that.

@code-asher
Copy link
Member Author

code-asher commented Oct 2, 2020

Should note this isn't backwards compatible with the previous method so maybe it would be better to maintain the old PLUGIN_DIR behavior and use different variables for the new stuff (or use command line flags instead). If this gets merged and released in time though I suppose it's all good.

Copy link
Contributor

@nhooyr nhooyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use CS_PLUGIN_PATH instead?

Where plugin path consists of colon separated directories in which plugins are loaded from.

And defaults to: $HOME/.config/code-server/plugins:/etc/code-server/plugins.

Only one was colon separated but now they both are.
@code-asher
Copy link
Member Author

CS_PLUGIN_PATH is a much better name.

@code-asher code-asher requested a review from nhooyr October 8, 2020 21:20
@code-asher code-asher merged commit c6c293d into master Oct 9, 2020
@code-asher code-asher deleted the multi-plugin branch October 9, 2020 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants