BUG: <query> element for tree-sitter based Completion Sets when using injection.scm


I believe there is a bug with <query> inside the XML based completions

Consider the following:

tree-sitter cli parse result

  • I have the following code:

When you parse you will get the following:

(blade [0, 0] - [2, 6]
  (conditional [0, 0] - [2, 6]
    (directive_start [0, 0] - [0, 3])
    (parameter [0, 4] - [0, 13])
    (php [1, 4] - [2, 0])
    (directive_end [2, 0] - [2, 6])))


((php) @injection.content
    (#set! injection.combined)
    (#set! injection.language php))

<provider> element

    <provider name="blade.conditional">
        <exclude-selector>comment, attribute</exclude-selector>

                (directive_start) @provider.start
                (directive_end) @provider.end


The Bug :lady_beetle::

  1. :lady_beetle: To start with, let us say I write a wrong query that does not point to a correct node, or I made a mistake and there was an error. The expected outcome should be that the Completion Set NOT to show anywhere. Yet if there is a problem, Nova seem to just show the set anywhere in the document.

  2. :lady_beetle: If I comment out the injection.scm everything works as expected.

Things I have tried:

  • Removing (#set! injection.combined)
  • Using <query> (conditional) </query> (this is also correct and works when injection is turned off)
  • using @provider.subtree