-
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
Added support for @TemplateGlobal
annotation
#636
Added support for @TemplateGlobal
annotation
#636
Conversation
@TemplateGlobal
annotation support@TemplateGlobal
annotation support
356f029
to
b91623e
Compare
@TemplateGlobal
annotation support@TemplateGlobal
annotation
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
b91623e
to
ae721a9
Compare
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
9204248
to
9259402
Compare
Template global example: package org.acme;
import io.quarkus.qute.TemplateGlobal;
enum Color { RED, GREEN, BLUE }
@TemplateGlobal
public class Globals {
static int age = 40;
static String name;
static Color[] myColors() {
return new Color[] { Color.RED, Color.BLUE };
}
@TemplateGlobal(name = "currentUser")
static String user() {
return "Mia";
}
} |
499075a
to
4a05eca
Compare
4a05eca
to
9699fd6
Compare
...ute.jdt.test/src/main/java/com/redhat/qute/jdt/template/TemplateGetDataModelProjectTest.java
Outdated
Show resolved
Hide resolved
...at.qute.jdt/src/main/java/com/redhat/qute/commons/datamodel/resolvers/ValueResolverInfo.java
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
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.
Works pretty well for me, but noticed a few things worth fixing.
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
2de62e5
to
2d910f9
Compare
There is compilation problem https://github.com/redhat-developer/quarkus-ls/runs/6632720210?check_suite_focus=true#step:8:142 you miss to define this method since you add globalVariable parameter (you define a new assertResolver by calling false for globalVariable). |
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
...in/java/com/redhat/qute/jdt/internal/template/datamodel/TemplateGlobalAnnotationSupport.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Alexander Chen <alchen@redhat.com>
2d910f9
to
a96de61
Compare
Great job @AlexXuChen ! |
Added support for
@TemplateGlobal
annotation.Fixes #605
Signed-off-by: Alexander Chen alchen@redhat.com