From 35b7787e02c1b544fd8cfb94551382543f69da11 Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 28 Aug 2023 11:56:44 -0400 Subject: [PATCH] Add Tailwind server to TSX --- 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(-) diff --git a/crates/zed/src/languages.rs b/crates/zed/src/languages.rs index 8aaa11e1cd..f0b8a1444a 100644 --- a/crates/zed/src/languages.rs +++ b/crates/zed/src/languages.rs @@ -104,6 +104,7 @@ pub fn init(languages: Arc, node_runtime: Arc) { 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, node_runtime: Arc) { 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( diff --git a/crates/zed/src/languages/tailwind.rs b/crates/zed/src/languages/tailwind.rs index d7c11f0c73..1b7c271d10 100644 --- a/crates/zed/src/languages/tailwind.rs +++ b/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(), ) diff --git a/crates/zed/src/languages/tsx/config.toml b/crates/zed/src/languages/tsx/config.toml index 234dc6b013..2f676f6710 100644 --- a/crates/zed/src/languages/tsx/config.toml +++ b/crates/zed/src/languages/tsx/config.toml @@ -16,3 +16,6 @@ brackets = [ [overrides.element] line_comment = { remove = true } block_comment = ["{/* ", " */}"] + +[overrides.string] +word_characters = ["-"]