Closed angelozerr closed 1 year ago
Here the file that I have used for test:
{@java.util.concurrent.CompletableFuture<java.util.List<String>> items}
{#for item in items}
{item.blank}
{/for}
and here a demo:
I notice that there are some trouble when the expected items is not an iterable like:
{@String items}
{#for item in items}
{item.blank}
{/for}
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.
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.
It should be fixed.
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.
Doesn't seem to be working for me:
Actually, the completion is working, the code lens for the {#if
is working, but the validation is not working. Another case where it's broken:
@datho7561 is the sample https://github.com/redhat-developer/quarkus-ls/pull/832#issuecomment-1487002171 is working for you?
Could you share your sample please.
CompletionStagePOJO.java
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"));
}
}
completion-stage-template.html
{@org.acme.CompletionStagePOJO obj}
{#for stringElt in obj.myStrings}
{stringElt.codePointAt(0)}
{/for}
{obj.myStrings.add("sandwich")}
Doesn't seem to be working for me:
It should working now, I didn't the cover of Java Type returned by a method. Thanks for haved testing this usecase.
Support for Evaluation of CompletionStage and Uni Objects
Fixes #826