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

Antlers tags get corrupted on save #54

Closed stefankempf closed 1 year ago

stefankempf commented 1 year ago

Describe the bug I have the following snippet on a old page of mine:

<title>
    {{ if ! segment_1 }} 
        {{ brand:company_nickname }} &middot; {{brand:company_byline }} 
    {{ elseif seo_title }}
        {{ seo_title }} &middot; {{ brand:company }}
    {{ else }}
        {{ title ?? brand:company_byline }} &middot; {{ brand:company }} 
    {{ /if }}
</title>

When I save my file, it gets automatically rewritten into:

<title>
    {{ if !segment_1 }} <Aa3gabdi3fxVe7aL4mpPNz3pJA
    /> {{ elseif seo_title }}
    {{ seo_title }} &middot; {{ brand:company }} {{ else }}
    {{ title ?? brand:company_byline }} &middot; {{ brand:company }}{{ /if }}
</title>

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

Versions and Other Plugins/Extensions Please include the product version you are reporting a bug for. If you are reporting a bug for products such as Antlers Toolbox for VS Code or the Antlers Prettier Plugin, please include a list of other configured extensions or plugins if you believe they are contributing to the problematic behavior.

this is my prettier config:

{
    "tabWidth": 4,
    "semi": false,
    "singleQuote": true,
    "arrowParens": "avoid",
    "bracketSameLine": true,

    "plugins": [
        "prettier-plugin-antlers",
        "prettier-plugin-tailwindcss"
    ],
    "pluginSearchDirs": false,
    "tailwindConfig": "tailwind.config.js",

    "overrides": [
        {
        "files": "*.antlers.html",
        "vscodeLanguageIds": ["antlers"],
        "options": {
            "parser": "antlers"
        }
        }
    ]
}
JohnathonKoster commented 1 year ago

Is the provided snippet the only thing in the document? I'm having trouble reproducing this in isolation. Any additional information context would be helpful. Thanks!

JohnathonKoster commented 1 year ago

Resolved in the following versions: