-
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 Qute Type-safe Message Bundles #845
Conversation
The support for Qute Type-safe Message Bundles starts working with Java interfaces (but not with properties file). See the following demo: @mkouba @FroMage I have started the support for Qute Type-safe Message Bundles which works only with Java interface. I need to support properties file. Any feedback are welcome if you need some feature. |
@mkouba I have tried to play with @MessageBundle and I have several questions:
|
I have improved the support and now you can see message content as inlay hint in the template: @mkouba @FroMage @fbricon @datho7561 @JessicaJHee for now I display as inlay hint the message but I wonder if it should be better to display the evaluaded message . For instance:
If yes what about when name comes from a variable like
Should we display:
|
I think that we should display the message template and not the evaluaded message. Mainly because we are not always able to evaluate the message template and then it might become confusing... (the |
Ok thanks for your feedback @mkouba ! |
I need to clean my code and write tests. This PR provides the first support for Qute messages but it need to be improved with:
I will need that in separate PRs to avoid having a big PR. @datho7561 @JessicaJHee you can start to play with this PR. Once tests and code will be cleaned I will notice you. |
d93caab
to
aadb3a2
Compare
To play with Qute messages, I suggest that you use the qute-messages that I will use for Qute JDT tests. |
Please note that I have encountered 2 bugs in Qute messages support: |
I don't know. I was going to answer the other way, and display the text substituted. At a point (in the view) where we don't know what |
573c5c6
to
af9bddc
Compare
It was my original idea by @mkouba think we should not evaluate the message #845 (comment) |
0f9304b
to
b3cf09d
Compare
@datho7561 @JessicaJHee the PR can be reviewed now, code is clean and tests exists now. |
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.
I played around and looks great! I just noticed some very minor things.
I think this feature you mentioned would be very nice to have in a future PR:
- support as inlay hint message when it is defined in a msg.properties file.
...main/java/com/redhat/qute/jdt/internal/template/datamodel/TypeSafeMessageBundlesSupport.java
Outdated
Show resolved
Hide resolved
...main/java/com/redhat/qute/jdt/internal/template/datamodel/TypeSafeMessageBundlesSupport.java
Outdated
Show resolved
Hide resolved
....qute.ls/src/main/java/com/redhat/qute/project/datamodel/resolvers/MessageValueResolver.java
Outdated
Show resolved
Hide resolved
Thanks!
It is in my plan, but this PR is already big, so I prefer providing message support in separate PRs to have easier review. |
@JessicaJHee I have improved inlay hint and now you click on it to edit the Java message by going to the java method. It requires to improve it to set the location to the @message annotation content and not the Java method but we can do that in a separate PR (if you are interested you could work on it). Once message properties support will be available #847 my idea is to provide the capability to open the msg.properties file. |
Fixes redhat-developer#800 Signed-off-by: azerr <azerr@redhat.com>
@datho7561 @JessicaJHee can we merge this PR? |
I haven't had a chance to look at it yet, but I know that Jessica reviewed it. Do you think it's ready to merge, Jessica? |
Support for Qute Type-safe Message Bundles
Fixes #800