Closed fbricon closed 1 year ago
@datho7561 , could we solve this by adding something like
literalJavaType != null || object.getPartName().isEmpty()
at https://github.com/redhat-developer/quarkus-ls/blob/c0fc3388a170e0f709df88a625ec85d3c89460cd/qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDiagnostics.java#L710-L714 ?
It doesn't make sense to emit UndefinedObject
when we can't define it because it isn't a valid identifier.
It doesn't make sense to emit UndefinedObject when we can't define it because it isn't a valid identifier.
@rgrunber indeed it was the idea, but !
can be used as object part if it is not an #if
section.
Here the result:
Here we don't report error as UndefinedObject
. Please note that the error should highlight the !
and note the {
, but this error comes from the real Qute parser which is not fault tolerant, so it means if you write:
{#if !}
{/if}
{#if !}
{/if}
you will have just one error of the first {
and teh offset is not correct.
To fix those 2 problems we should manage this error with our QuteDiagnostics which uses our fault tolerant parser. I had started to manage an error to adjust correctly the error (I ignore the error from the Qute real parser and I manage itin QuteDiagnostics), but I'm waiting for the decision about the Qute parser (managed with Antlr?)
//cc @mkouba @JessicaJHee @datho7561
In a qute template, the following will trigger a ClassCastException:
See:
Tested with the latest vscode-quarkus pre-release (v1.13.2023031404)