-
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
NPE prevents Import > Install Tern Modules wizard initialization #321
Comments
@demonfiddler this module import is was just a POC. I will fix this bug, but if you wish to have this feature, we need to finalize ternjs/tern#424 |
Thanks for the (very) quick response @angelozerr. I'd seen the #195 thread, which is how I learnt of the wizard's existence. Then I found it in my installed tern-feature.feature.group_1.0.0.201508302102 and tried to use it. Actually, I'm writing an Eclipse plug-in to add support for a large (2.5 MB) custom library that is generated from XSDs. I found JSDT's content assist somewhat flakey and incomplete and wondered whether Tern Eclipse IDE could do a better job. So I was really looking for an Eclipse extension point by which my Eclipse plug-in could contribute a simple Tern plug-in that loads a JSON module definition (created by condense) - both would be packaged within my Eclipse plug-in. This would avoid requiring the user to configure their IDE manually by downloading the module using your wizard. [incidental] Anyhow, this all turns out to be largely academic since condense does not emit JSDoc-derived metadata for type members, which from an end-user's perspective is exactly the same limitation as suffered by native JSDT content assist (although for different reasons). See #321 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=333712 respectively. |
Today it doesn't exists this extension point. I would like to do that, please create an issue for that.
I understand. If you wish to test your JSON Type Definition inside tern.java, you have 2 choices :
I'm writing a JSDoc -> Tern generator that I'm using to generate Phaser. If you wish I could commit my work and explain you how it works, but it's not very clean for the moment. My future idea is to provide this generator inside tern.java. |
Thanks for your responses and kind offer to commit your generator. I won't trouble you to do this for now, as I need to consult with my management as to whether we'll be taking our efforts any further at this juncture - it's been quite time-consuming and we haven't achieved the results we'd hoped for. One further thought: the default tern repository currently enumerates Tern modules as children of the node_modules/tern folder within the ternjs Eclipse plug-in. A binary plug-in's installed image should be treated as a read-only location. Eclipse plug-ins have a writable 'state location' (see Plugin.getStateLocation() : IPath), which would be an appropriate place for maintaining user-downloaded modules. So it might be better to aim for a 'composed repository' that presents the contents of several repositories as if they were a single repository. That way, you could still read the built-in modules from the ternjs binary plug-in image, read downloaded custom modules from the plug-in state location, and read additional repositories contributed by 3rd party Eclipse plug-ins via the proposed extension point from within their contributing plug-ins. |
For me, the import wizard never actually gets displayed. The error log shows the following exception:
java.lang.NullPointerException
at tern.eclipse.ide.tools.internal.ui.wizards.repository.InstallTernModulesSelectionWizardPage.validate(InstallTernModulesSelectionWizardPage.java:286)
at tern.eclipse.ide.tools.internal.ui.wizards.TernWizardPage.dialogChanged(TernWizardPage.java:80)
at tern.eclipse.ide.tools.internal.ui.wizards.TernWizardPage.createControl(TernWizardPage.java:71)
at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:175)
at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:705)
at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1153)
at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1211)
It would appear that the preceding call at line 285 to InstallTernModulesSelectionWizardPage.modulesBlock.getCheckedModules() returns null as a consequence of having been called prematurely; that is to say, before any call to TernModulesBlock.setCheckedModules(Collection) has been made.
The text was updated successfully, but these errors were encountered: