zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.46k stars 2.76k forks source link

TailwindCSS support in twig files #16548

Open countfak opened 1 month ago

countfak commented 1 month ago

Check for existing issues

Describe the feature

Would be nice to have Tailwind support for Twig files too. I tried to follow suggestions from #16371 with no luck.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

highjeans commented 4 weeks ago

@countfak I assume you something like this in your settings.json:

 "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "includeLanguages": {
          "twig": "html",
          "*.twig": "html"
        },
        "experimental": {
          "classRegex": [
            "class=\"([^\"]*)",
            "class={\"([^\"}]*)",
            "class=format!({\"([^\"}]*)"
          ]
        }
      }
    },

You will also need the following setting:

  "languages": {
    "Twig": {
      "language_servers": ["tailwindcss-language-server", "Twig Language Server"]
    }
  }
countfak commented 4 weeks ago

@highjeans I confirm it works if I add those to settings.json

thank you!