redhat-developer / quarkus-ls

Language server for Quarkus tooling
Eclipse Public License 2.0
43 stars 15 forks source link

Don't show snippets for user tags with spaces in name #787

Open datho7561 opened 1 year ago

datho7561 commented 1 year ago

If you have a user tag with spaces in it's name, like:

src/main/resources/templates/tags/my tag.html

Then a snippet for my tag appears. When you apply the snippet, qute-ls reports that the generated code is an error.

It's not clear from the Qute documentation what should be done in this case, however accepting the snippet and trying to render the template results in an error. Also, trying variations on the name like my-tag, mytag, myTag still results in the template failing to render. I think we should avoid suggesting completions for any user tags with spaces in their name.

angelozerr commented 2 months ago

@mkouba @ia3andy what is the rule when HTML file name contains space and it is hosted in tags folder? Should we ignore this user tag in completion?

mkouba commented 1 month ago

@mkouba @ia3andy what is the rule when HTML file name contains space and it is hosted in tags folder? Should we ignore this user tag in completion?

Indeed, this is undefined. And I think that we should ignore these template files completely, not only in qute-ls but also in the quarkus-qute extension.

The only question is how strict to be. A reasonable approach is IMO to accept a sequence of non-whitespace characters (we use the same rule for identifiers).