When using code assist against a class coded in Java, the code assist selection window doesn't show argument names nor write the names when a method is selected from the list. Argument names are shown and written with the pattern x$1
If there is called ModelLocal and Model, the first one inside the same Scala project, the content assist work fine, but with the Model class from another Java project, using code assist to look for a setter methos like setName(String n), it doen't show or write the n argument name, instead x$1
Trying code assist on a Scala/Java library, for example a String, methods that come from the Java runtime don't show the argument name, for example charAt( x$1L Int), but at least the name is inserter correct when selecting the method. Something like stripMargin(marginChar: Char) works perfectly, a method from the Scala runtime library.
Running Eclipse 4.3.2, tried with both Scala runtimes just in case was a Scala version problem, but happens on both cases. It is not an awful bug per se, but this really slow productivity when working with complex multi project systems. This works fine on the stable Scala IDE
If there is called ModelLocal and Model, the first one inside the same Scala project, the content assist work fine, but with the Model class from another Java project, using code assist to look for a setter methos like setName(String n), it doen't show or write the n argument name, instead x$1
Trying code assist on a Scala/Java library, for example a String, methods that come from the Java runtime don't show the argument name, for example charAt( x$1L Int), but at least the name is inserter correct when selecting the method. Something like stripMargin(marginChar: Char) works perfectly, a method from the Scala runtime library.
Running Eclipse 4.3.2, tried with both Scala runtimes just in case was a Scala version problem, but happens on both cases. It is not an awful bug per se, but this really slow productivity when working with complex multi project systems. This works fine on the stable Scala IDE
Leave a comment
on 2014-11-05 20:31 *
By
Sorry for the spam, the version change was a keyboard mistake, it applies to the latest RC2
ok. This is not a regression, it is that the added feature which displays the name of the method parameters in the proposal label does not work fine in all cases.
For a Java method defined as:
The completion used to be displayed as
In 4.0, it is displayed as
The problem is that the computation for the 'real' names can be quite expensive. It is done when the completion is selected, to create the placeholder. But it not really possible to do it on the fly for all completion proposals.
Maybe we should put something prettier instead of the
For a Java method defined as:
public void g(int abbc) {}
The completion used to be displayed as
g(Int): Unit
in Scala IDE 3.0.x.In 4.0, it is displayed as
g(abbc: Int):Unit
, if the Java class is defined in the same project, and g(x$1: Int):Unit
if the class is defined in a different project.The problem is that the computation for the 'real' names can be quite expensive. It is done when the completion is selected, to create the placeholder. But it not really possible to do it on the fly for all completion proposals.
Maybe we should put something prettier instead of the
x$1
.
on 2014-12-02 14:32 *
By
"The problem is that the computation for the 'real' names can be quite expensive. It is done when the completion is selected, to create the placeholder" (no quote tag on Assembla, really :P)
Just for clarification, I don't see those computed placeholders added to the source file when the selection is done. On the list if there is no other way to do it fast, then the old
Just for clarification, I don't see those computed placeholders added to the source file when the selection is done. On the list if there is no other way to do it fast, then the old
g(Int): Unit
looks better
on 2014-12-03 17:16 *
By Iulian Dragos
In the original bug description you say " but at least the name is inserter correct when selecting the method". That matches my experience. Do you have attached sources to your Java libraries? For me it works both with Java jars and Java sources.
on 2014-12-03 21:08 *
By
All code is in source form inside Eclipse projects. If the Java class (.java source file) is inside the same project the arguments names are inserted. when the Java class (.java source file) is on another Eclipse Java project as a build dependency for the Scala project, the names are not inserted. This is what I tried to say with:
"If there is a class called ModelLocal and Model, the first one inside the same Scala project, the content assist work fine, but with the Model class from another Java project, using code assist to look for a setter method like setName(String n), it doesn't show or write the n argument name, instead x$1"
The text you quoted was talking about a Java method on the Java runtime library, not a Java class (with sources) on another project
"for example charAt( x$1L Int), but at least the name is inserted correctly when selecting the method. Something like stripMargin(marginChar: Char) works perfectly, a method from the Scala runtime library."
Edit: Some fixes to the previous comment quotes
"If there is a class called ModelLocal and Model, the first one inside the same Scala project, the content assist work fine, but with the Model class from another Java project, using code assist to look for a setter method like setName(String n), it doesn't show or write the n argument name, instead x$1"
The text you quoted was talking about a Java method on the Java runtime library, not a Java class (with sources) on another project
"for example charAt( x$1L Int), but at least the name is inserted correctly when selecting the method. Something like stripMargin(marginChar: Char) works perfectly, a method from the Scala runtime library."
Edit: Some fixes to the previous comment quotes
Ticket assignment reverted due to inactivity.
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|