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

21st
Mar 2016
Gavin King
@gavinking
Mar 21 2016 11:05
Folks there are lots of great places for use of named arguments in the IDE!
Bastien Jansen
@bjansen
Mar 21 2016 11:10
would that be more readable than positional args?
Gavin King
@gavinking
Mar 21 2016 11:13
definitely
consider:
ExplicitType? node = nodes.findNode(blah blah blah);
return whatever(node, x, y, z, whatever);
compared to
return whatever {
    node = nodes.findNode(blah blah blah);
    x = x; y = y, z = x;
   something = whatever;
};
the second form is far, far better
in general, the antipttern of
ExplicitType? = javaCall();
should be avoided
Bastien Jansen
@bjansen
Mar 21 2016 11:16
why do you consider this an antipattern?
Gavin King
@gavinking
Mar 21 2016 11:16
since it’s really easy for the reader of the code to miss that they can’t jsut change ExplicitType? to value
Bastien Jansen
@bjansen
Mar 21 2016 11:16
ah
Gavin King
@gavinking
Mar 21 2016 11:16
plus it’s just nastily verbose
David Festal
@davidfestal
Mar 21 2016 11:16
true, it's write it's really better
Gavin King
@gavinking
Mar 21 2016 11:19
@davidfestal why is it that when I navigate from Java code in the IDE project to Ceylon code
it doesn’t open the Ceylon editor
?
David Festal
@davidfestal
Mar 21 2016 11:20
you should have a "Open Ceylon Declaration" option
at least of classes / methods of classes
the Open Declaration etc ... are the navigation links added by JDT
and those cannot (afaik) be changed to open a Ceylon Editor
that's why we added a Open in Ceylon Editor
an additional hyperlink detector
however, it might be necessary to also propose it for a method of an instance
I'mnot sure it's proposed then
I'm leaving to eat now
bbl
Gavin King
@gavinking
Mar 21 2016 11:23
I don't
not in the IDE project
I believe I do have them in other projects
Bastien Jansen
@bjansen
Mar 21 2016 11:23
does it open a .class file instead @gavinking?
Gavin King
@gavinking
Mar 21 2016 11:24
oh, wait — it seems I do have them in some cases
for classes it seems I have them
perhaps it’s toplevels I don’t have them for?
David Festal
@davidfestal
Mar 21 2016 11:24
@gavinking : could you open an issue with the detailed cases where you don't have the "Open Ceylon Declaration" navigation option ?
I'll fix them
for methods of instances it's missing afair
Gavin King
@gavinking
Mar 21 2016 11:25
yes, OK
it’s in Nodes.java
David Festal
@davidfestal
Mar 21 2016 11:25
open an issue with the missing cases and I'll fix them
Gavin King
@gavinking
Mar 21 2016 11:25
when I click on, e.g.
delegate.findArgument(cu, node)
David Festal
@davidfestal
Mar 21 2016 11:26
yeah, that's it then
I'm going now
Gavin King
@gavinking
Mar 21 2016 11:26
actually it works great in most other cases
David Festal
@davidfestal
Mar 21 2016 11:26
Cool
Gavin King
@gavinking
Mar 21 2016 11:26
just that’s the one I kept needing :)
David Festal
@davidfestal
Mar 21 2016 11:26
:-)
it's a pity that we cannot remove the JDT-added options
but...
Gavin King
@gavinking
Mar 21 2016 11:32
gawd, so y’know I was always surprised how little i used named args, and half-wondered whether that feature of the language was a semi-failure
until I started working in the IDE code :)
here, they are necessary
Bastien Jansen
@bjansen
Mar 21 2016 11:34
:)
Gavin King
@gavinking
Mar 21 2016 11:35
but we have a really long way to go before we’re really taking proper advantage of the language in ceylon-ide-common
Bastien Jansen
@bjansen
Mar 21 2016 11:37
I wouldn't be surprised if you told me that I'm writing Ceylon code the same way one writes Java code ;)
so it's nice to have your feedback
and see the correct ceylonic version of what I wrote
Gavin King
@gavinking
Mar 21 2016 11:40
well, yes, it’s full of java-isms
but that’s not surprising
since it’s a port of Java :)
for example, the thing I hate most
is declaring a local variable
just so that you can assign it multiple times in various branches of if
that’s awful
but of course the java code had a lot of that
Gavin King
@gavinking
Mar 21 2016 12:02
@bjansen i probably just broke some stuff in intellij
minor breakage
Bastien Jansen
@bjansen
Mar 21 2016 12:02
ok, I'm kinda used to that now ;)
Gavin King
@gavinking
Mar 21 2016 12:03
heh
I don't think that's working as expected
David Festal
@davidfestal
Mar 21 2016 20:33
it seems yes :-)
copy/paste error
maybe
Bastien Jansen
@bjansen
Mar 21 2016 20:34
I think it's missing a this.
David Festal
@davidfestal
Mar 21 2016 20:34
yes
Bastien Jansen
@bjansen
Mar 21 2016 20:36
fixed
Bastien Jansen
@bjansen
Mar 21 2016 21:18
@davidfestal
!MESSAGE An internal error occurred during: "Building workspace".
!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.model.IdeModule$23.$call$(IdeModule.ceylon:962)
    at com.redhat.ceylon.ide.common.model.IdeModule$10.$call$(IdeModule.ceylon:564)
    at com.redhat.ceylon.ide.common.util.synchronize_.synchronize(synchronize_.java:33)
    at com.redhat.ceylon.ide.common.model.IdeModule.doWithPhasedUnitsObject$priv$(IdeModule.ceylon:562)
    at com.redhat.ceylon.ide.common.model.IdeModule.refresh(IdeModule.ceylon:946)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder$7.call(CeylonBuilder.java:1719)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder$7.call(CeylonBuilder.java:1687)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.doWithSourceModel(CeylonBuilder.java:311)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.incrementalBuild(CeylonBuilder.java:1687)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.access$100(CeylonBuilder.java:211)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder$3.call(CeylonBuilder.java:1025)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder$3.call(CeylonBuilder.java:1022)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.doWithCeylonModelCaching(CeylonBuilder.java:261)
    at com.redhat.ceylon.eclipse.core.builder.CeylonBuilder.build(CeylonBuilder.java:1022)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:300)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
I'm not really sure what happened, but now every time I save a file I get this
David Festal
@davidfestal
Mar 21 2016 21:20
@bjansen : can you open an issue for this ? I cannot look into it now
Bastien Jansen
@bjansen
Mar 21 2016 21:21
ok
ceylon/ceylon-ide-eclipse#1748
David Festal
@davidfestal
Mar 21 2016 21:24
Thanks !
does clean-building your project fix the issue ?
Bastien Jansen
@bjansen
Mar 21 2016 21:26
It did fix the issue, but my current file still had a lot of errors that I was going to fix, so I called a quick fix to import a class and the issue reappeared :(
David Festal
@davidfestal
Mar 21 2016 21:27
it's a typical case when we use value to receive the result of a Java call that might return null
so you should be able to fix it by making the receiver type explicit and optional
I cannot right now (on a branch)
Bastien Jansen
@bjansen
Mar 21 2016 21:28
the line is if (u.relativePath == relativePathOfUnitToRemove) {
so apparently I have a unit with no relative path ?!
David Festal
@davidfestal
Mar 21 2016 21:29
strange
I would have understood if it had been the previous line
value u = d.unit;
Gavin King
@gavinking
Mar 21 2016 22:46
ceylon/ceylon-ide-common#40