Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add Tailwind server to TSX

Julia35b7787e02c1
diff --git a/crates/zed/src/languages.rs b/crates/zed/src/languages.rs
index 8aaa11e1cd9..f0b8a1444ac 100644
--- a/crates/zed/src/languages.rs
+++ b/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(
diff --git a/crates/zed/src/languages/tailwind.rs b/crates/zed/src/languages/tailwind.rs
index d7c11f0c739..1b7c271d105 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 234dc6b0132..2f676f67107 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 = ["-"]