ssi-schaefer / lcdsl

Eclipse Launch Configuration DSL (Xtext based)
Eclipse Public License 1.0
23 stars 12 forks source link

Invalid product id #22

Closed Hanksha closed 5 years ago

Hanksha commented 5 years ago

Hi,

I tried to use lcdsl for our RCP application but I encountered an issue.

I this config launch.lc:

eclipse configuration Coder_Studio {
    product io.toro.coder.branding.io.toro.coder.product;

    feature io.toro.coder.feature;
    feature io.toro.coder.gloop.feature;
    feature io.toro.coder.flux.feature;
}

Once the corresponding launch configuration is generated I check it and the select product is invalid. image

If I do it manually it would be: image

The plugin.xml in io.toro.coder.branding looks like this:

<plugin>
    <extension
            id="io.toro.coder.product"
            point="org.eclipse.core.runtime.products">
        <product
                description="Coder Studio"
                application="org.eclipse.ui.ide.workbench"
                name="TORO Coder Studio">
        <!-- ... -->
        </product>
    </extension>
</plugin>

Am I doing something wrong or is it an issue on lcdsl side?

Hanksha commented 5 years ago

This is the launch config generated by lcdsl:

Coder_Studio.txt

mduft commented 5 years ago

This seems to be a bug in LcDsl indeed. I can reproduce it with /some/ products, but others work.

From what I can tell until now there seems to be some shortcut logic that IF the product name contains dots (?), the bundle name is not prefixed to the product name, otherwise it should be prefixed with the bundle name :|

You could verify this by renaming your product to just 'product' - it should then be correctly identified both by eclipse and LcDsl as io.toro.coder.branding.product If you can confirm this, I can create a fix.

Hanksha commented 5 years ago

Yes I confirm, if the product id is just product then the generated config with io.toro.coder.branding.product has no warning.

Hanksha commented 5 years ago

By the way, not sure if it's related but, if I have an invalid .lc file like this: image

And run it from the Launch Configurations view I get an NPE:

java.lang.NullPointerException
    at org.eclipse.debug.ui.launchview.launcher.StandaloneLaunchConfigExecutor$StandaloneLauncherJob.<init>(StandaloneLaunchConfigExecutor.java:192)
    at org.eclipse.debug.ui.launchview.launcher.StandaloneLaunchConfigExecutor.launchProcess(StandaloneLaunchConfigExecutor.java:53)
    at com.wamas.ide.launching.ui.launchview.LcDslLaunchObject.launch(LcDslLaunchObject.java:96)
    at org.eclipse.debug.ui.launchview.internal.view.LaunchAction.run(LaunchAction.java:78)
    at org.eclipse.debug.ui.launchview.internal.view.LaunchViewImpl.lambda$1(LaunchViewImpl.java:130)
    at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:831)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
    at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:828)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1459)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1258)
    at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)
    at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:247)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:306)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4258)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4082)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3699)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
mduft commented 5 years ago

An updated version is available from the update site (caches could take a few minutes). Could you please update and try it? Fixed version is 0.1.2.N201811231318

Hanksha commented 5 years ago

It's working now, the config is valid and I can launch it. But I noticed that I have no more content assist/auto completion for the product names.

Also, but it's really a minor thing, it didn't detect automatically that the product used for the launch config needed a feature containing the org.eclipse.ui.ide.workbench application as per my plugin.xml defining the product.