AngularJS Plug-in is not installed by default for AngularJS Project#126
AngularJS Plug-in is not installed by default for AngularJS Project#126vrubezhny wants to merge 1 commit intoangelozerr:masterfrom
Conversation
Signed-off-by: vrubezhny <vrubezhny@exadel.com>
|
Angelo, please, review the fix. Probably AngularProject is not a best place to add plug-ins/defs. But ConvertProjectToAngularCommandHandler hadler is in UI, so I'm just repeated it's convert actions AngularProject in case it has no angular plug-in set up. Not sure it's correct way, but. |
|
@vrubezhny could you please try to use tern nature adapeters https://github.com/angelozerr/tern.java/wiki/Tern-IDE-Extension#ternnatureadapters (like you have done CordovaJS) instead of using angualr nature adapter. I think we can remove now this angular nature adapaters, since 0.7.0 check if there is exists .tern-project with angular plugin to know if it's an angular project. If it works, I will remove this angular nature adapter. Thank's! |
|
Yes, I'll try to do it in the way I did it for cordovajs. Perhaps, you're correct - configuration by an extension point should help. |
Yes it's normal. If you use tern nature adapters extension point, when it loads tern project, it check if plugins defined in the tern nature adapters exists in the .tern-project. If it doesn't exists, it add it and save the .tern-project before executing completion, hyperlink, etc I would like to remove angular nature adapter, so I hope tern nature adapter will be enough for your case. |
Does it mean that potentially any JavaScript (for the case when I'm adopter Tern to work with JSNature) project would be treated as Angular JS project automatically? Or it will depend on how it is /what modules are configured on .tern-project file? |
Yes, now a project has tern nature only if .tern-project exists. For angular case, the condition is the existing of .tern-project + angular plugins inside .tern-project So you could create at hand teh .tern-project in your project and it's enough. If you import a project from sublime text which uses angular, you must NOT configure to angular the project. |
|
When I have no .tern-project at start, I'm getting it with the following content: {"ide":{}} And I have a number of NPE exceptions in error log: !ENTRY org.eclipse.ui.workbench 4 2 2014-11-21 22:14:38.344 !ENTRY org.eclipse.core.jobs 4 2 2014-11-21 22:14:38.345 !ENTRY org.eclipse.angularjs.core 4 0 2014-11-21 22:14:39.578 |
|
This happens even when I added default modules like "cordova", "angular" and defs like "ecma5" and "browser" by extension point. |
|
Angelo, forget about those exceptions. |
|
So, it looks now that the defining 'angular' plug-in by the tern's nature adapter extension point helps. As for Angular's nature adapter, then yes. I think it should be removed, since it's not needed anymore. A proper Tern's configuration does all this work. |
|
I've closed the PR. Thanks! |
you are welcome! I will remove tha angular nature adapter. |
Previously, with having Tern/AngularJS Natures, the Tern Project was setup accordingly (required definitions and plugins were set up on the project). Now, for the adopted projects there is no such a 'convertation', so, as the result, for an angular project we have no angular plug-in set up in .tern-project file.
Signed-off-by: vrubezhny vrubezhny@exadel.com