These are chat archives for ceylon/ceylon-ide-eclipse

3rd
Feb 2016
Gavin King
@gavinking
Feb 03 2016 14:33
@davidfestal @bjansen I have a felling the quick assist to convert if/else statements to expressions is broken
David Festal
@davidfestal
Feb 03 2016 14:33
in master ?
Gavin King
@gavinking
Feb 03 2016 14:33
not sure about the one to convert switch statements to expressions
yeah
master
David Festal
@davidfestal
Feb 03 2016 14:33
@bjansen : do you think you could have a look ?
Bastien Jansen
@bjansen
Feb 03 2016 14:33
sure
David Festal
@davidfestal
Feb 03 2016 14:33
Thanks !
Gavin King
@gavinking
Feb 03 2016 14:34
sorry I would have looked myself but no time today
Also navigation to functional parameters in the doc hover is broken
though that might not be new
David Festal
@davidfestal
Feb 03 2016 14:34
could you open issues for those ?
Gavin King
@gavinking
Feb 03 2016 14:34
no time right now
David Festal
@davidfestal
Feb 03 2016 14:35
OK
Bastien Jansen
@bjansen
Feb 03 2016 14:35
@gavinking what's your use case for if/else quick assist?
this seems to work okay:
        Integer a;

        if (true) {
            a = 1;
        } else {
            a = 2;
        }
Gavin King
@gavinking
Feb 03 2016 14:35
well if you have a statement where each branch assigns or returns
Bastien Jansen
@bjansen
Feb 03 2016 14:36
converted to Integer a = if (true) then 1 else 2;
Gavin King
@gavinking
Feb 03 2016 14:36
yeah
or perhaps just
a  = if (true) then 1 else 2;
Bastien Jansen
@bjansen
Feb 03 2016 14:37
I mean the above example works correctly using the quick assist, what's not working on your side?
Gavin King
@gavinking
Feb 03 2016 14:43
hrm
i will have to dig further then
it was somewhere in the IDE source
Gavin King
@gavinking
Feb 03 2016 17:26
ah, so, @bjansen the issue is with else if
This doesn’t work:
    String s;
    if ("adfasd"=="") {
        s = "hello";
    }
    else if (1==2) {
        s = "";
    }
    else {
        s = "";
    }
perhaps it never did...
i think it should though
Bastien Jansen
@bjansen
Feb 03 2016 17:27
does it throw an exception?
Gavin King
@gavinking
Feb 03 2016 17:31
Naw, only errors I have in the log are these:
!MESSAGE Unhandled event loop exception
!STACK 0
ceylon.language.AssertionError "null value returned from native call not assignable to Object"
    at com.redhat.ceylon.compiler.java.Util.checkNull(Util.java:985)
    at com.redhat.ceylon.ide.common.doc.DocGenerator$impl.addContainerInfo$priv$(DocGenerator.ceylon:941)
    at com.redhat.ceylon.ide.common.doc.DocGenerator$impl.getDeclarationDoc$priv$(DocGenerator.ceylon:464)
    at com.redhat.ceylon.ide.common.doc.DocGenerator$impl.getDocumentationText(DocGenerator.ceylon:434)
    at com.redhat.ceylon.eclipse.code.hover.EclipseDocGenerator.getDocumentationText(EclipseDocGenerator.ceylon)
    at com.redhat.ceylon.eclipse.code.hover.CeylonLocationListener.handleLink(CeylonLocationListener.java:100)
    at com.redhat.ceylon.eclipse.code.hover.CeylonLocationListener.changing(CeylonLocationListener.java:42)
    at org.eclipse.swt.browser.WebKit.webView_decidePolicyForNavigationAction_request_frame_decisionListener(WebKit.java:1494)
which is something with doc hover
and navigation
aaaah ceylon/ceylon-ide-eclipse#1474
ceylon/ceylon-ide-eclipse#1475
never implemented this!
ok
Bastien Jansen
@bjansen
Feb 03 2016 17:34
i see
nothing to fix then ;)
Gavin King
@gavinking
Feb 03 2016 17:34
:)