-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #427 Signed-off-by: azerr <azerr@redhat.com>
- Loading branch information
1 parent
562ffb4
commit ca94e69
Showing
19 changed files
with
131 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Qute Java support | ||
|
||
Qute support provides `validation`, `documentation link`, `codelens` inside Java files, to manage binding with Qute templates: | ||
|
||
![Qute Java support](images/QuteJava.gif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Qute support | ||
|
||
[Qute](https://quarkus.io/guides/qute-reference) is a template engine used in Quarkus applications. | ||
|
||
[vscode-quarkus](https://github.com/redhat-developer/vscode-quarkus) provides `Qute` support in: | ||
|
||
* [templates files](TemplateSupport.md#template) : completion, validation etc. for Qute template. | ||
* [Java files](JavaSupport.md#java-file) : completion, validation etc. for Qute integration within Quarkus applications. | ||
|
||
## Settings | ||
|
||
* `qute.trace.server`: Trace the communication between VS Code and the Qute language server in the Output view. Default is `off`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Qute Template support | ||
|
||
Qute support provides `completions`, `validation`, `hover`, `definition`, `highlight`, `linked editing` in Qute template. | ||
|
||
To benefit with this support, we recommend your template files to follow the `*.qute.*` naming pattern (ex: `items.qute.html`, `items.qute.txt`, `items.qute.yaml`, etc.). | ||
|
||
## Parameter declaration support | ||
|
||
A `parameter declaration` is used to declare the expected model in a Qute template: | ||
|
||
``` | ||
{@java.util.List<org.acme.qute.Item> items} | ||
``` | ||
|
||
The Qute support helps to easily write this declaration with the completion, hover and definition support. | ||
|
||
### Completion for Java types | ||
|
||
The Qute support provides completion to easily write parameter declaration: | ||
|
||
![Completion for Java types](images/QuteTemplateParameterDeclarationCompletion.gif) | ||
|
||
### Validate Java type | ||
|
||
The Qute support validates Java types: | ||
|
||
![Validate Java type](images/QuteTemplateParameterDeclarationValidation.png) | ||
|
||
### Jump to Java type definition | ||
|
||
You can jump to the proper Java type: | ||
|
||
![Jump to Java type definition](images/QuteTemplateParameterDeclarationDefinition.gif) | ||
|
||
## Section support | ||
|
||
### Completion for Qute section | ||
|
||
Qute support provides snippets to quickly generate `Qute` sections. Here is a sample for the `#for` section: | ||
|
||
![Completion for Qute section](images/QuteTemplateSectionSnippetCompletion.gif) | ||
|
||
### Linked editing | ||
|
||
Linked editing is supported, allowing for simultaneous renaming of a parameter expression. | ||
|
||
To enable this feature, the setting `editor.linkedEditing` must be set to `true` in your `settings.json`. | ||
|
||
![Linked EditingRange](images/QuteTemplateLinkedEditingRange.gif) | ||
|
||
## Tag Name Highlighting | ||
|
||
When placing the cursor on a Qute section tag, the corresponding opening/closing tag will be highlighted with their nested block: | ||
|
||
![Highlight Corresponding Tag](images/QuteTemplateSectionHighlighting.gif) | ||
|
||
## Expression support | ||
|
||
A Qute expression is declared inside `{|}` or inside a section (ex : `{#for item in |}`). | ||
|
||
### Completion for Java data model | ||
|
||
Completion is available for allowed Java `fields`, `methods` and `virtual methods` (coming from the Qute core like `orEmpty` or coming from @TemplateExtension): | ||
|
||
![Completion for Java data model](images/QuteTemplateCompletionForJavaDataModel.gif) | ||
|
||
### Validation for Java data model | ||
|
||
Validation highlights unknown Java fields or methods as an error: | ||
|
||
![Validation for Java data model](images/QuteTemplateValidationForJavaDataModel.png) | ||
|
||
### Hover for Java data model | ||
|
||
When you hover over an object, property or method or virtual method (for `@TemplateExtension`), you can see the Java type: | ||
|
||
![Hover for Java data model](images/QuteTemplateHoverForJavaDataModel.gif) | ||
|
||
When you hover over a [Built-in Resolvers](https://quarkus.io/guides/qute-reference#built-in-resolvers) you can see the relevant documentation, with a link to the [Qute reference guide](https://quarkus.io/guides/qute-reference): | ||
|
||
![Hover for Built-in Resolvers](images/QuteTemplateHoverForBuildInResolver.png) | ||
|
||
### Jump to Java field, method definition | ||
|
||
`Ctrl+Click` on a property or method to jump to the definition of the matching Java field, method or virtual method (for `@TemplateExtension`): | ||
|
||
![Definition for Java data model](images/QuteTemplateDefinitionForJavaDataModel.gif) | ||
|
||
### Jump to the declared object | ||
|
||
A variable can be declared inside a Qute template (with parameter declaration, or #let section) or declared from the Java side. | ||
|
||
`Ctrl+Click` on an object part jumps to the declared object in the Qute template (with parameter declaration, or #let section) or to the Java code (method parameter or data method invocation): | ||
|
||
![Definition for Java data model](images/QuteTemplateDefinitionForObject.gif) | ||
|
||
## Quarkus integration for Qute | ||
|
||
When the template is used in a Quarkus application and it is bound with a Java Template field or a method annotated with `@CheckedTemplate`, you can see the expected model as CodeLens: | ||
|
||
![CodeLens for Java data model](images/QuteTemplateCodeLensJavaDataModel.png) | ||
|
||
In this case, you don't need to declare parameter declaration to benefit from Qute completion, validation, etc. of the Java data model. | ||
|
||
CodeLens are clickable to jump to the proper Java type, method or field. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.