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

27th
Apr 2016
Stéphane Épardaud
@FroMage
Apr 27 2016 08:48
@davidfestal yt?
David Festal
@davidfestal
Apr 27 2016 08:48
yes
Stéphane Épardaud
@FroMage
Apr 27 2016 08:49
I'm trying to reproduce the issues mentioned on ceylon-users with java/ceylon projiects in the IDE
I created a Ceylon project and a Java project
I made the Java project depend on the Ceylon one
then I tried to use one of the Ceylon types from my java project
David Festal
@davidfestal
Apr 27 2016 08:49
yes, Isaw that
Stéphane Épardaud
@FroMage
Apr 27 2016 08:49
but got nothing
I seem to be able to import the Ceylon package
but none of its members are visible to the Java class
Eclipse says they don't exist
is this something that is supposed to work?
or is it a known limitation
Stéphane Épardaud
@FroMage
Apr 27 2016 09:01
it works if I import the module's car as a jar dependency, though, but not the project
which, indeed, makes clicking on the type show the bytecode and not the source
FTR I tried the "ceylon-aware java launcher"
and it failed as much as the normal one :(
Caused by: java.lang.ClassNotFoundException: com.redhat.ceylon.compiler.java.runtime.model.ReifiedType
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
David Festal
@davidfestal
Apr 27 2016 09:09
could you open an issue about this one ?
Stéphane Épardaud
@FroMage
Apr 27 2016 09:09
the CNFE?
or the first issue
David Festal
@davidfestal
Apr 27 2016 09:09
yes please, the CNFE
Stéphane Épardaud
@FroMage
Apr 27 2016 09:10
ok
David Festal
@davidfestal
Apr 27 2016 09:10
as for the first issue, the classpath containers in the Ceylon project should be exported in the Java build path
simply
it's not by default
it should fix it
Stéphane Épardaud
@FroMage
Apr 27 2016 09:11
is this a setting of the java or ceylon project?
David Festal
@davidfestal
Apr 27 2016 09:11
of the ceylon project you are using from a Java project
Stéphane Épardaud
@FroMage
Apr 27 2016 09:11
ok
David Festal
@davidfestal
Apr 27 2016 09:11
but the ceylon project is also a Java project
Stéphane Épardaud
@FroMage
Apr 27 2016 09:11
lemme try
David Festal
@davidfestal
Apr 27 2016 09:12
and it's in the Java build path
Stéphane Épardaud
@FroMage
Apr 27 2016 09:12
ok
ceylon/ceylon-ide-eclipse#1775
OK I confirm that with this setting, the build of my java project works
when it imports the cyelon project
but, when I click on my ceylon type from my java project I still get to the bytecode
and not the source file
is this normal, or is it a bug, or a missing feature?
David Festal
@davidfestal
Apr 27 2016 09:17
it's simply that the Java project is not aware of Ceylon at all
Stéphane Épardaud
@FroMage
Apr 27 2016 09:18
ok
but there's no way to make this work?
David Festal
@davidfestal
Apr 27 2016 09:18
but we could maybe add the hyperlink participant to Java project also
that might be possible yes
Stéphane Épardaud
@FroMage
Apr 27 2016 09:18
ok, so it'd be a new feature then
lemme file an issue
David Festal
@davidfestal
Apr 27 2016 09:19
I have to look into it but I should be able to know quite quickly it it's feasible or not
Stéphane Épardaud
@FroMage
Apr 27 2016 09:19
ceylon/ceylon-ide-eclipse#1776
thanks
David Festal
@davidfestal
Apr 27 2016 09:20
Thanks to you for the issue :-)
Gavin King
@gavinking
Apr 27 2016 10:34

@davidfestal

the classpath containers in the Ceylon project should be exported in the Java build path

OK, so even I didn’t know about this thing, and it’s incredibly non-obvious. We need to do something much better here!

And even after I do that, I get this error when I try to run the code:
David Festal
@davidfestal
Apr 27 2016 10:34
yes, I agree
detect when a Java project depends on it and add it automatically
Gavin King
@gavinking
Apr 27 2016 10:34
An internal error occurred during: "Launching Clz".
Module conflict error prevented classpath generation: try running "ceylon info --print-overrides nodetest/1.0.0" to display an override file you can use with "ceylon classpath --overrides override.xml nodetest/1.0.0" or try with "ceylon classpath --force nodetest/1.0.0" to select the latest versions
David Festal
@davidfestal
Apr 27 2016 10:35
or emit an error with a quick fix
Gavin King
@gavinking
Apr 27 2016 10:35
@davidfestal why can’t it just always be exported by default?
why do we need to detect anything?
David Festal
@davidfestal
Apr 27 2016 10:35
I was bringing problems with the Android integration at the time we developed it
but things have changed now
maybe it would be possible
at this time the Android Development tools were treating exporting entries specifically
without any way to change this behavior
and was adding the exported content to the dex process
which resulted in duplicate entries in the dex process and a build failure
afair
that's why we should do it on an opt-in way IMO
Gavin King
@gavinking
Apr 27 2016 10:37
ceylon/ceylon-ide-eclipse#1777
David Festal
@davidfestal
Apr 27 2016 10:37
because some other plugin may automatically do specific stuff on exported entries that we wouldn't want to trigger
without at least knowing it
Gavin King
@gavinking
Apr 27 2016 10:38
@davidfestal I suspect that we may as well simply drop that whole Android plugin thingy
since nobody uses it, nor will they ever use it, AFAICT
David Festal
@davidfestal
Apr 27 2016 10:38
well, not really
it was restarted under another name
a new official project
that contains a fork of the old ADT tooling
so that what we had could probably be partly reused
Gavin King
@gavinking
Apr 27 2016 10:39
@FroMage can you try again with the linking-from-java-to-ceylon thing — because it works for me
I think you just clicked too fast
you have to select from the menu that pops up
Bastien Jansen
@bjansen
Apr 27 2016 10:44
it would be nice if we didn't have to use that popup, and navigate to the Ceylon declaration by default
and use the popup if we want to navigate to the bytecode
Gavin King
@gavinking
Apr 27 2016 10:44
@bjansen well, duh, obviously
and if we knew how to do that, we certainly would, of course
Bastien Jansen
@bjansen
Apr 27 2016 10:45
then find out how to do that ;p
Gavin King
@gavinking
Apr 27 2016 10:45
but it’s unlikely that there exists any way to do it w/o hacking Eclipse itself
Bastien Jansen
@bjansen
Apr 27 2016 10:45
oh
there's no way to sort the results and make the Ceylon declaration go on top of the list?
Gavin King
@gavinking
Apr 27 2016 10:47
no way, AFAIK
these are all just plugins contributed in the XML file
the ordering depends on the order in which the plugins are loaded by Eclipse, I assume
Gavin King
@gavinking
Apr 27 2016 10:53
ceylon/ceylon-ide-eclipse#1778
Stéphane Épardaud
@FroMage
Apr 27 2016 11:02
I don't get any popup at all
when I do Ctrl-Click on a Ceylon type from a Java project
Gavin King
@gavinking
Apr 27 2016 11:19
@FroMage very strange
like I said it works just perfectly for me
you might have to debug JavaToCeylonHyperlinkDetector
@FroMage it’s not in the default package, right?
this is something in a module, I assume?
Gavin King
@gavinking
Apr 27 2016 11:26
@davidfestal @FroMage question: does the IDE’s “Use a flat classpath” also affect the launcher, and not just the compiler?
Stéphane Épardaud
@FroMage
Apr 27 2016 13:56
@gavinking I've answered in the issues
and actually flat classpath only affects run-time IIRC
has anyone ever wondered how we can support a Ceylon project which depends on a Java project?
because the Java project knows nothing about modules
and so just depending on the project doesn't make any of its types visible in the Ceylon project
David Festal
@davidfestal
Apr 27 2016 15:07
It's not supported. Just add the Ceylon nature to the Java project, and depend on this project should be OK.
Stéphane Épardaud
@FroMage
Apr 27 2016 15:38
if I add the ceylon nature to it, that does not give me a module to import, though, right?
David Festal
@davidfestal
Apr 27 2016 15:45
default, no ?
which might be sufficient from the POV of the Java project
Stéphane Épardaud
@FroMage
Apr 27 2016 15:46
default, but we can't import default modules
so it'd still be invisible
I wonder how Eclipse models Gradle/Maven projects, if it actually knows about those modules or not
I bet Intellij would
David Festal
@davidfestal
Apr 27 2016 15:47
Ah, yes, sorry, I spoke too quickly
the best is just to add a module descriptor
to the Java project
cleaner anyway, and not too intrusive
this could even be made a quick assist or menu option
gtg
Stéphane Épardaud
@FroMage
Apr 27 2016 15:49
bye
well, we could find a way to support Maven/Gradle modules
from both the CLI and IDE