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

support array and object schemas of configuration contribution point #6074

Closed
wants to merge 1 commit into from

Conversation

tom-shan
Copy link
Contributor

@tom-shan tom-shan commented Aug 30, 2019

What it does

Fixes #6072

The plugin system should support array and object schemas for configuration contribution points.

How to test

  1. start the application with the following tomcat vscode extension
  2. open the preferences using the menu item File > Settings > Open Preferences
  3. there should be a new category Tomcat with the preferences:
    3.1. tomcat.workspace
    3.2. tomcat.restart_when_http(s)_port_change

Review checklist

Reminder for reviewers

@tom-shan tom-shan requested a review from a team as a code owner August 30, 2019 14:51
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I was able to successfully test the PR using the tomcat extension, and I can now see the
Tomcat preference category with the new preferences:

Screen Shot 2019-08-30 at 11 01 46 AM

I'll give others a chance to try as well, nice work :)

contributions.configuration = config;
const config = rawPlugin.contributes.configuration;
if (config) {
contributions.configuration = this.readConfiguration(Array.isArray(config) ? config[0] : config, rawPlugin.packagePath);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's better to merge the config array if it contains more than one element.
I will update this PR.

fix eclipse-theia#6072
plugin system should support array and object schemas of configuration
contribution point

Signed-off-by: tom-shan <swt0008411@163.com>
@svenefftinge
Copy link
Contributor

svenefftinge commented Aug 31, 2019

Hey @tom-shan sorry I didn't see this PR earlier and worked on the same thing...
Happy to go with your PR, though. But I think we should pass the array|object type all the way and not merge the configuration. Because as long as we are talking about the PluginContribution it should be in sync with the original (vs code).
I mean like in #6078

Could you please update your PR (or close it and we go with #6078)?
Thanks!

@tom-shan
Copy link
Contributor Author

@svenefftinge That's all right. For your implementation is better, let's go with your PR.

@tom-shan tom-shan closed this Aug 31, 2019
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.

Fail to load the configuration contribution of vscode tomcat extension
3 participants