-
Notifications
You must be signed in to change notification settings - Fork 52
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
Make Tern.java to be able to treat a custom project nature as Tern nature #38
Make Tern.java to be able to treat a custom project nature as Tern nature #38
Conversation
…ture. This will allow Tern.java to be seamlessly integrated to other products. Signed-off-by: vrubezhny <vrubezhny@exadel.com>
Victor,it seems very cool! I tell me why you don't use your extension point for JSDT in the project tern.eclipse.ide.jsdt which is a glue between JSDT and Tern? |
Not sure it's required in JSDT. If we'll add that definition into your plug-in, it will make Tern to work for JSDT's JavaScript nature for any product that includes tern.eclipse.ide.jsdt plug-in, which is probably is not what Product owners may want to have by default. So, IMHO, it shouldn't be defined there by default. |
Make Tern.java to be able to treat a custom project nature as Tern nature
OK I understand. thank's for your clarification. |
Will this patch also make it possible to remove the tern configure action which adds the tern nature ? The goal here is to avoid putting unnecessary metadata into users projects and clean/remove unnecessary UI. |
If user project contains that 'replacer' nature that is configured to act instead of Tern's own nature, then yes, no "Convert to Tern project" action should appear. |
@vrubezhny I have created a wiki page for tern ide extensions. See https://github.com/angelozerr/tern.java/wiki/Tern-IDE---Extension Don't hesitate to complete it, thank's! |
Which nature will "Convert to tern project" install in this case ? the tern one i guess....since no real way to know which of the others are relevant...not optimal but I guess shuold work. |
Yes, if we have a replacing nature configured by the extension point there will be no "Convert to Tern project" menu item shown. Otherwise, if we have no such a 'replacer' configured, "Convert..." action will add Tern's own nature. We can add (or change existing) action handler in order to add that contributed replacing nature to a project, but there could be few additional problems to solve:
I had two choices when started to develop the extension point: 1) to inject a handler class that checks a project for required natures, or 2) to inject just a nature name and have Tern's code to make all the work. First way is more flexible and we can provide a method to add the required nature(-s) on a project, but this way requires a contributing product to have a dependency on Tern (since we have to implement some of Tern's interfaces for that purpose). The second one doesn't require to maintain any additional dependencies. |
This will allow Tern.java to be seamlessly integrated to other products.
Other products may declare a custom project nature to be treated as a Tern nature by adding the following extension into some plugin.xml:
Signed-off-by: vrubezhny vrubezhny@exadel.com