Hi,
I am writing a blade language grammar for tree-sitter alongside a syntax extension for Nova.
I am having a bit of a problem getting the completions defined in the Completion/blade.xml
to work.
Here is my provider
<provider>
<syntax>blade</syntax>
<expression>@[a-zA-Z0-9-]*</expression>
<query>
(program)
</query>
<trigger>^@</trigger>
<set>blade.keywords</set>
<set>blade.keywords.parameters</set>
</provider>
The issue arises when I am trying to provide the completion at the root of the blank document.
In my tree-sitter grammar the (program)
is right at the top of the hierarchy.
Now if I open a blank document and type @
none of the keywords are suggested for completion…
If I do that in other sections such as (program (example))
the completions are provided.
Things I have tried…
- If I just have empty
<query>
nothing will be shown anywhere
<provider>
<syntax>blade</syntax>
<expression>@[a-zA-Z0-9-]*</expression>
<query></query>
<trigger>^@</trigger>
<set>blade.keywords</set>
<set>blade.keywords.parameters</set>
</provider>
- If I remove the
<query>
the completion is provided in any children of the(program)
such as(program (example))
node, but not in the root…
<provider>
<syntax>blade</syntax>
<expression>@[a-zA-Z0-9-]*</expression>
<trigger>^@</trigger>
<set>blade.keywords</set>
<set>blade.keywords.parameters</set>
</provider>
- Now I thought because the document is blank, so I typed a few words, and still no result.
Is there any ways to provide the completions anywhere in the document tree? including when it is blank, or at the root?
Thanks
Emran