-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add CodeActions to resolve syntax errors related to sections #838
Add CodeActions to resolve syntax errors related to sections #838
Conversation
.../src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForMismatchSectionTag.java
Outdated
Show resolved
Hide resolved
@JessicaJHee your PR looks very good. I would like to merge my PR #832 before yours and as I did some refactoring you will need to change your code (JavaDataModelCache has changed and now code action uses QuteProjectRegistry instead). The resolveJavaType is done with project and not with java data model cache. |
// {/if} | ||
codeActionForUnterminatedSection.doCodeActions(request, codeActionResolveFutures, codeActions); | ||
break; | ||
case SECTION_END_DOES_NOT_MATCH_START: |
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 think you could add case SECTION_BLOCK_END_DOES_NOT_MATCH_START
here (no tested)
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.
In this case I should correct the end tag to {/else}
or {/if}
?
It seems like the following case is allowed since I get no errors when I build Quarkus:
{#if true}
Hello
{#else}
Hi
{/else} // --> error is reported here - I have added a test case for this
{/if}
But at the moment we report error since we declare {#else}
, {#case}
, and {#is}
as empty sections here:
Line 352 in 0726aa5
return CaseSection.TAG.equals(tag) || ElseSection.TAG.equals(tag) || IsSection.TAG.equals(tag); |
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.
Ok thanks for your feedback. It is more complicated that I though. We can do that in a separate PR. Please create an issue for that.
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 have created an issue here: #844
94fd458
to
9e27460
Compare
@JessicaJHee please fix conflict |
9e27460
to
830605f
Compare
...src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForUnterminatedSection.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForMismatchSectionTag.java
Outdated
Show resolved
Hide resolved
830605f
to
37b4ae7
Compare
...src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForUnterminatedSection.java
Outdated
Show resolved
Hide resolved
37b4ae7
to
f9e614b
Compare
...src/main/java/com/redhat/qute/services/codeactions/QuteCodeActionForUnterminatedSection.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jessica He <jhe@redhat.com>
f9e614b
to
d23dd13
Compare
I love your work @JessicaJHee, thanks so much! |
Fixes #821