From 5f4fb07631fbd0430745ffdc604879d6dc9714df Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Sat, 9 Apr 2022 00:24:11 +0100
Subject: [PATCH] fix(nvim): Tailwind completion in html.twig files

Whilst `twig` files are enabled by default, `html.twig` files aren't so
these need to be added as an additional filetype for LSP to work.

For completion, `html.twig` also needs to be added as a custom user
language, mapping to the `html` type.

Fixes: #25
---
 roles/neovim/files/lua/opdavies/lsp/init.lua | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/roles/neovim/files/lua/opdavies/lsp/init.lua b/roles/neovim/files/lua/opdavies/lsp/init.lua
index 279ce5ce..98159951 100644
--- a/roles/neovim/files/lua/opdavies/lsp/init.lua
+++ b/roles/neovim/files/lua/opdavies/lsp/init.lua
@@ -93,7 +93,26 @@ local servers = {
   },
 
   tailwindcss = {
-    filetypes = { "html", "html.twig" },
+    filetypes = {
+      -- html
+      "html",
+      "html.twig",
+      "php",
+      "twig",
+
+      -- js
+      "javascript",
+      "typescript",
+
+      -- mixed
+      "vue",
+    },
+
+    init_options = {
+      userLanguages = {
+        ["html.twig"] = "html",
+      },
+    },
   },
 
   -- tsserver = {