Bug 494153 - "Run as.." actions are not available from the Project Explorer when installed from "Eclipse IDE for JavaScript and Web Developers"
Summary: "Run as.." actions are not available from the Project Explorer when installed...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.7.1   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 3.8 RC2   Edit
Assignee: Project Inbox CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard: RHT PMC_Approved
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-20 08:45 EDT by Ilya Buziuk CLA
Modified: 2016-05-23 16:51 EDT (History)
4 users (show)

See Also:
ibuziuk: pmc_approved? (vrubezhny)
cbridgha: pmc_approved+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Buziuk CLA 2016-05-20 08:45:49 EDT
Steps to reproduce:
1. Install latest build of "Eclipse IDE for JavaScript and Web Developers"
2. Create project with bower.json / package.json / gulpfile.js etc.
3. Right-Click on one of the file from "Project Explorer" view
4. Error -> Run As actions are not available

Run As actions are available from Project Explorer when installed via "Eclipse IDE for Java EE Developers". Also, they are available if right-click on the file directly from the Editor.
Comment 1 Ilya Buziuk CLA 2016-05-20 08:57:13 EDT
Mickael, have you got any ideas why this can happen ?
Comment 2 Mickael Istria CLA 2016-05-20 12:55:57 EDT
Are the necessary feature part of the EPP package? Shouln't main JSDT feature include them?
Comment 3 Ilya Buziuk CLA 2016-05-20 13:07:41 EDT
@Mickael it should. The weird thing is that "Run As" available when right-clicking from the editor, but not from the Project Explorer
Comment 4 Mickael Istria CLA 2016-05-20 13:23:22 EDT
The bundle that contributes the "run as" menu may be missing. I cannot check more right now.
Comment 5 Mickael Istria CLA 2016-05-21 04:56:47 EDT
Probably related: http://insights.sigasi.com/tech/run-menu-item-strangely-disappearing-context-menu.html . I'm still investigating the track of a missing bundle JSDT should add as a dependency.
Comment 6 Mickael Istria CLA 2016-05-21 07:02:25 EDT
The "magic" adopter factory that's missing in the JS package is contributed by org.eclipse.ant.ui.
In order to have JSDT work properly without the org.eclipse.ant.ui bundle, it has to provide and adapter for the types it's able to run (JS projects, js files, bower files...).
Comment 7 Mickael Istria CLA 2016-05-21 07:06:54 EDT
(In reply to Mickael Istria from comment #6)
> The "magic" adopter factory that's missing in the JS package is contributed
> by org.eclipse.ant.ui.
> In order to have JSDT work properly without the org.eclipse.ant.ui bundle,
> it has to provide and adapter for the types it's able to run (JS projects,
> js files, bower files...).

More precisely: http://git.eclipse.org/c/platform/eclipse.platform.git/tree/ant/org.eclipse.ant.ui/plugin.xml#n436
Comment 8 Eclipse Genie CLA 2016-05-22 19:47:37 EDT
New Gerrit change created: https://git.eclipse.org/r/73364
Comment 9 Ilya Buziuk CLA 2016-05-22 19:55:11 EDT
@Mickael great investigation. Can we treat the gerrit change above as a relevant hot-fix (tagging all Resources as Launchable) ?
Comment 10 Sarika Sinha CLA 2016-05-23 01:16:38 EDT
(In reply to Mickael Istria from comment #7)
> (In reply to Mickael Istria from comment #6)
> > The "magic" adopter factory that's missing in the JS package is contributed
> > by org.eclipse.ant.ui.
> > In order to have JSDT work properly without the org.eclipse.ant.ui bundle,
> > it has to provide and adapter for the types it's able to run (JS projects,
> > js files, bower files...).
> 
> More precisely:
> http://git.eclipse.org/c/platform/eclipse.platform.git/tree/ant/org.eclipse.
> ant.ui/plugin.xml#n436

Plugin.xml in jdt.debug.ui  has
 <factory 
            class="" 
            adaptableType="org.eclipse.core.resources.IResource">
            <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
  </factory>

That doesn't help ?
Comment 11 Sarika Sinha CLA 2016-05-23 01:46:37 EDT
Oh!! I see now, this package doesn't have JDT.
Comment 12 Mickael Istria CLA 2016-05-23 04:25:47 EDT
(In reply to Ilya Buziuk from comment #9)
> @Mickael great investigation. Can we treat the gerrit change above as a
> relevant hot-fix (tagging all Resources as Launchable) ?

Yes, I believe this should get into next RC of JSDT.
I'm doubtful about this approach in general for the IDE (see bug 494229), but since ant and jdt use it, there is no reason JSDT couldn't.
Comment 13 Ilya Buziuk CLA 2016-05-23 09:56:25 EDT
PMC Defect Candidate info:

1. The bug was found just after eclipse may newsletter was published and reported via twitter[1]. Basically, the bug ruins usability of JSDT Node.js Tools (bower, npm, Node.js) when installed via "Eclipse IDE for JavaScript and Web Developers"

2. Workaround is using "Run As" launch shortcuts via Editor instead of Project Explorer. The workaround is insufficient due to the fact usability is still broken and end-user can not use Project Explorer for tools launch.

3. The fix was tested via building local JSDT update site and installing JSDT features on top of "eclipse-javascript-neon-M7-linux-gtk-x86_64".

4. No risk associated with the fix. 

[1] https://twitter.com/jperiodlangley/status/733499183823478784?cn=cmVwbHk%3D&refsrc=email
Comment 14 Chuck Bridgham CLA 2016-05-23 15:28:43 EDT
approved - thanks for the patch