Hi,
I believe there is a bug with <query>
inside the XML
based completions
- Here is the link to the extension: Laravel Suite
(not up to date) - Here is the link to the Github which is the most up to date version
Consider the following:
tree-sitter cli parse result
- I have the following code:
@if(parameter)
@el
@endif
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])))
Injection.scm
((php) @injection.content
(#set! injection.combined)
(#set! injection.language php))
<provider>
element
<provider name="blade.conditional">
<syntax>blade</syntax>
<syntax>html</syntax>
<expression>@[a-zA-Z0-9-]*</expression>
<exclude-selector>comment, attribute</exclude-selector>
<trigger>@</trigger>
<query>
(conditional
(directive_start) @provider.start
(directive_end) @provider.end
)
</query>
<set>blade.conditional.keywords</set>
</provider>
The Bug :
-
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.
-
If I comment out the
injection.scm
everything works as expected.
-
If I turn on the
injection
things will go unexpected, the completion set (else|esleif
) will show everywhere in the document not even respecting the query written. -
Following is the inspectors result, as you can see the injected html is inside the
(conditional)
so my query should work?
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
Thanks
Emran