redhat-developer / redhat-developer/quarkus-ls

Should we show `ifTruthy` in completion?

Open
#534 2 comments 0 reactions 1 assignee View on GitHub

@AlexXuChen is already working on this.

Since Mar 16, 2022.

completion qute
Dominant language
Java
Stars
50
Forks
18
Avg merge
22h 11m
Merged PRs (30d)
3

Description

ifTruthy is a virual method.

According the doc https://quarkus.io/guides/qute-reference#built-in-resolvers

In fact, the operators are implemented as "virtual methods" that consume one parameter and can be used with infix notation. For example {person.name or 'John'} is translated to {person.name.or('John')} and {item.isActive ? item.name : 'Inactive item'} is translated to {item.isActive.ifTruthy(item.name).or('Inactive item')}

and according to the ValueResolvers class https://github.com/quarkusio/quarkus/blob/5819320de2f738d0f1091350254e9addfba5d27b/independent-projects/qute/core/src/main/java/io/quarkus/qute/ValueResolvers.java#L148

We support ifTruthy in hover, validation , etc and too in completion:

{item.isActive.|}

here we provide ifTruthy as completion, but should we promote this ifTruthy virtual method?

@mkouba could you give us our opinion? is it annoying if we show ifTruthy in the completion result?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.