redhat-developer / redhat-developer/quarkus-ls

Adjust error range for Qute syntax validation.

Open
#770 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

qute validation
Dominant language
Java
Stars
50
Forks
18
Avg merge
22h 11m
Merged PRs (30d)
3

Description

Today we parse the Qute template with the real parser of Qute, but the error highlight is not very nice:

image

In this sample, #fragment should be highlighted as an error and we need to provide code actionwhich insert required id parameter.

Now we embed last version of Qute parser where @mkouba did some improvement to retrieve easily information of the error (error code, arguments, offset), we can support error range according an error code and arguments at https://github.com/redhat-developer/quarkus-ls/blob/906a34fa7cb85c8da5436019f087ab05d7a08cf0/qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/diagnostics/QuteDiagnosticsForSyntax.java#L70

BUT it will work only for the first error since Qute parser stops the parsing as soon as it find an error.

To avoid higlighting the first error with proper range, I mean highlight all errors correctly I suggest that we follow this strategy:

We need to use Qute error code
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/services/QuteDiagnostics.java around line 189 and compare it with diagnostics/QuteDiagnosticsForSyntax.java around line 70. Read the available Qute error codes, offsets, and arguments, then trace how syntax diagnostics and code actions are produced. Done means errors such as the #fragment case receive the correct range and the required id code action is provided without losing later errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.