Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
36 stars 3 forks source link

"Missing required parameter" on the closing tag of partials #84

Closed isaackearl closed 5 months ago

isaackearl commented 5 months ago

Describe the bug When using partials in antlers, I'm getting "Missing required parameter: antlers(ANTLR_517)" on all my closing tags. Take a look at screenshot.

image

And when I hover over the red line

image

Impacted Products Which Antlers Toolbox products does this bug apply to?

Versions and Other Plugins/Extensions I only have the Antlers toolbox installed. Prettier is disabled for this project and I don't have the formatter or anything like that. It is simply Antlers Toolbox.

To Reproduce Here is my partial, as you can see the param for variant has a *, which marks it as required.

`{{# @name Text @desc A reusable text component to keep consistency. @param* variant titleXL, titleLG, titleMD, titleSM, bodyLG, bodyMD, bodySM @param align left, center, right - default left

}}

<{{ as or 'p' }} class=" {{ switch( (variant == 'titleXXXL') => 'text-6xl text-white font-bold', (variant == 'titleXXL') => 'text-4xl text-white font-bold', (variant == 'titleXL') => 'text-2xl text-white font-bold', (variant == 'titleLG') => 'text-2xl text-primary font-bold', (variant == 'titleMD') => 'text-xl text-primary font-bold', (variant == 'titleSM') => 'text-lg text-primary font-bold', (variant == 'bodyLG') => 'text-lg text-black', (variant == 'bodyMD') => 'text-md text-black', (variant == 'bodySM') => 'text-sm text-black', () => 'text-md' )}}

{{ switch(
    (align == 'right') => 'text-right',
    (align == 'center') => 'text-center',
    () => 'text-left'
)}}

{{ class }}

"> {{ slot }} </{{ as or 'p' }}>

`

Expected behavior it only tells me I'm missing a required parameter when I'm on the opening tag of my partial

JohnathonKoster commented 5 months ago

Thanks for the report! I'll take a look and work on an update sometime early this week :)

JohnathonKoster commented 5 months ago

Resolved in the following versions: