Sorry, Theodor. I should have added the code I am actually trying to make it work.

I just come from a different culture where a minimal example is preferred over a complete/longer code to show a bug/unexpected behavior. I will make sure to add the code next time.

But I believe Yuan spotted the issue. Now I need to figure out a way to proceed. (Please check my response to Yuan).

On Mon, Oct 24, 2022 at 12:23 AM Theodor Thornhill <theo@thornhill.no> wrote:
João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com> writes:

> I am getting a query error but I don't understand why.
>
> The following query is fine:
>
> (defvar sh-script--treesit-bash-keywords
>   '("case" "do" "done" "elif" "else" "esac" "export" "fi" "for"
>     "function" "if" "in" "unset" "while" "then"))
>
> (treesit-validate-query 'bash `([ ,@sh-script--treesit-bash-keywords ]
> @font-lock-keyword-face))
>
> However the following query is said INVALID by `treesit-validate-query':
> (treesit-validate-query 'bash `([ ,@(sh-feature sh-leading-keywords) ]
> @font-lock-keyword-face))
> Node type error at: 3
> ["*time"* "!" "do" "done" ...] @font-lock-keyword-face
>
> *time"* is highlighted in the *tree-sitter check query* buffer.
>
> Even though the forms below evaluate to equivalent forms:
> `([ ,@sh-script--treesit-bash-keywords] @font-lock-keyword-face)
> *evaluates to:*
> ([ "case" "do" "done" "elif" ... ] @font-lock-keyword-face)
>
> `([ ,@(sh-feature sh-leading-keywords) ] @font-lock-keyword-face)
> *evaluates to:*
> (["time" "!" "do" "done" ...] @font-lock-keyword-face)
>
>
> Any clues to what I am doing wrong?

Can you post the whole mode in its current state?  Then I can help you
debug it.  I've seen errors like this myself, but most of the time it
has been some sort of error, like a typo in one of the strings.

I feel there's too little to know exactly what is wrong from your mail,
so the whole source would be nice!

Thanks,
Theo


--
João Paulo L. de Carvalho
Ph.D Computer Science |  IC-UNICAMP | Campinas , SP - Brazil
Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - Canada
joao.carvalho@ic.unicamp.br
joao.carvalho@ualberta.ca