-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Evaluation of CompletionStage and Uni Objects #832
Support for Evaluation of CompletionStage and Uni Objects #832
Conversation
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/commons/ResolvedJavaTypeInfo.java
Outdated
Show resolved
Hide resolved
2f4d67b
to
f6d3a63
Compare
I notice that there are some trouble when the expected items is not an iterable like:
We have a popup error when we try to hover name property, teh inlay hint shows String after item although it should not show the type. I need to investigate the problem. But I think the problem is the same in master. |
f6d3a63
to
1d8a316
Compare
@@ -31,6 +32,9 @@ public class ResolvedJavaTypeInfo extends JavaTypeInfo { | |||
|
|||
private static final String JAVA_LANG_ITERABLE_TYPE = "java.lang.Iterable"; | |||
|
|||
private static final List<String> WRAPPED_TYPES = Arrays.asList("java.util.concurrent.CompletionStage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WRAPPER_TYPES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the types that do the wrapping, so they should be called WRAPPER_TYPES
. The wrapped type is the type parameter eg. in Uni<List<String>>
, uni is wrapping List<String>
, List<String>
is wrapped by Uni
, Uni
is a wrapper type, List<String>
is a wrapped type.
ed8dbb3
to
7e6b26d
Compare
It should be fixed. |
663cfc9
to
42a3519
Compare
Ok the PR can be reviewed now. I have wrotten a lot of tests, so I'm more confident to integrate it in the release. @fbricon @datho7561 @JessicaJHee please play with my PR to check I have not broken something. |
@datho7561 is the sample #832 (comment) is working for you? |
Could you share your sample please. |
package org.acme;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import io.smallrye.mutiny.Uni;
public class CompletionStagePOJO {
public Uni<List<String>> getMyStrings() {
return Uni.createFrom().item(Arrays.asList("my string", "my other string"));
}
public CompletableFuture<List<String>> getOtherStrings() {
return CompletableFuture.completedFuture(Arrays.asList("my string", "my other string"));
}
}
{@org.acme.CompletionStagePOJO obj}
{#for stringElt in obj.myStrings}
{stringElt.codePointAt(0)}
{/for}
{obj.myStrings.add("sandwich")} |
42a3519
to
b790efb
Compare
It should working now, I didn't the cover of Java Type returned by a method. Thanks for haved testing this usecase. |
b790efb
to
55d9893
Compare
fa2b1d7
to
65b8ebf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is working well, I haven't run into any bugs. I added a few comments, but feel free to merge once you've addressed them.
@@ -31,6 +32,9 @@ public class ResolvedJavaTypeInfo extends JavaTypeInfo { | |||
|
|||
private static final String JAVA_LANG_ITERABLE_TYPE = "java.lang.Iterable"; | |||
|
|||
private static final List<String> WRAPPED_TYPES = Arrays.asList("java.util.concurrent.CompletionStage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the types that do the wrapping, so they should be called WRAPPER_TYPES
. The wrapped type is the type parameter eg. in Uni<List<String>>
, uni is wrapping List<String>
, List<String>
is wrapped by Uni
, Uni
is a wrapper type, List<String>
is a wrapped type.
qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/commons/ResolvedJavaTypeInfo.java
Show resolved
Hide resolved
qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/commons/ResolvedJavaTypeInfo.java
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/commons/ResolvedJavaTypeInfo.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDefinition.java
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/project/QuteProject.java
Outdated
Show resolved
Hide resolved
qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/project/QuteProject.java
Outdated
Show resolved
Hide resolved
65b8ebf
to
2f0c9a9
Compare
Fixes redhat-developer#826 Signed-off-by: azerr <azerr@redhat.com>
Support for Evaluation of CompletionStage and Uni Objects
Fixes #826