Add Tailwind server to TSX

Julia created

Change summary

crates/zed/src/languages.rs              | 2 +-
crates/zed/src/languages/tailwind.rs     | 2 ++
crates/zed/src/languages/tsx/config.toml | 3 +++
3 files changed, 6 insertions(+), 1 deletion(-)

Detailed changes

crates/zed/src/languages.rs 🔗

@@ -104,6 +104,7 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: Arc<NodeRuntime>) {
         vec![
             Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())),
             Arc::new(typescript::EsLintLspAdapter::new(node_runtime.clone())),
+            Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone())),
         ],
     );
     language(
@@ -112,7 +113,6 @@ pub fn init(languages: Arc<LanguageRegistry>, node_runtime: Arc<NodeRuntime>) {
         vec![
             Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())),
             Arc::new(typescript::EsLintLspAdapter::new(node_runtime.clone())),
-            Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone())),
         ],
     );
     language(

crates/zed/src/languages/tailwind.rs 🔗

@@ -103,6 +103,7 @@ impl LspAdapter for TailwindLspAdapter {
                 "html": "html",
                 "css": "css",
                 "javascript": "javascript",
+                "typescriptreact": "typescriptreact",
             },
         }))
     }
@@ -122,6 +123,7 @@ impl LspAdapter for TailwindLspAdapter {
                 ("HTML".to_string(), "html".to_string()),
                 ("CSS".to_string(), "css".to_string()),
                 ("JavaScript".to_string(), "javascript".to_string()),
+                ("TSX".to_string(), "typescriptreact".to_string()),
             ]
             .into_iter(),
         )