redhat-developer / quarkus-ls

Language server for Quarkus tooling
Eclipse Public License 2.0
44 stars 15 forks source link

Support for Evaluation of CompletionStage and Uni Objects #826

Closed gastaldi closed 1 year ago

gastaldi commented 1 year ago

Describe the bug

When adding a CompletableFuture data item to a qute template, eclipse shows an error:

For example: I am adding a CompletableFuture here:

Screenshot 2023-03-24 at 09 16 25

In eclipse Qute editor, I see this error :

Screenshot 2023-03-24 at 09 18 07

If I complete the future in the java code:

Screenshot 2023-03-24 at 09 18 59

The warning goes away, though the code is no longer reactive....

Screenshot 2023-03-24 at 09 19 50

Expected behavior

Use of completablefuture should work the same as just passing data objects.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

eclipse

Additional information

Doesn't actually prevent anything from working as it should. Just an annoying eclipse error.

Using eclipse plugin "Quarkus Tools 4.26.0.Final'

Reported by @TonyWeston in https://github.com/quarkusio/quarkus/issues/32103

jeffmaury commented 1 year ago

Adding @angelozerr

fbricon commented 1 year ago

@TonyWeston can you provide a small sample project reproducing this issue please?

angelozerr commented 1 year ago

We need to support https://quarkus.io/guides/qute-reference#evaluation-of-completionstage-and-uni-objects

angelozerr commented 1 year ago

@mkouba in the sample https://quarkus.io/guides/qute-reference#evaluation-of-completionstage-and-uni-objects you speak about object part which can be a CompletionStage, but is it possible to use property or method part with CompletionStage?

mkouba commented 1 year ago

@mkouba in the sample https://quarkus.io/guides/qute-reference#evaluation-of-completionstage-and-uni-objects you speak about object part which can be a CompletionStage, but is it possible to use property or method part with CompletionStage?

Yes. This sentence is crucial: "If a part of an expression resolves to a CompletionStage, the resolution continues once this stage is completed and the next part of the expression (if any) is evaluated against the result of the completed stage."

angelozerr commented 1 year ago

Yes. This sentence is crucial: "If a part of an expression resolves to a CompletionStage, the resolution continues once this stage is completed and the next part of the expression (if any) is evaluated against the result of the completed stage."

Ooops sorry I have not seen that. Thanks for your answer, I covered this usecase too.