From 19aba43f3ec83c7d897dc82a58af655767fd3305 Mon Sep 17 00:00:00 2001 From: Arjun Bajaj <732586+arjunbajaj@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:13:31 +0530 Subject: [PATCH] Add Tailwind CSS support for Gleam (#43968) Currently, Zed does not provide suggestions and validations for Gleam, as it is only available for languages specified in `tailwind.rs`. This pull-request adds Gleam to that list of languages. After this, if Tailwind is configured to work with Gleam, suggestions and validation appear correctly. Even after this change, Tailwind will not be able to detect and give suggestions in Gleam directly. Below is the config required for Tailwind classes to be detected in all Gleam strings.
Zed Config for Tailwind detection in Gleam

``` { "languages": { "Gleam": { "language_servers": [ "gleam", "tailwindcss-language-server" ] } }, "lsp": { "tailwindcss-language-server": { "settings": { "experimental": { "classRegex": [ "\"([^\"]*)\"" ] } } } } } ``` The `classRegex` will match all Gleam strings, making it work seamlessly with Lustre templates and plain string literals.

Release Notes: - Added support for Tailwind suggestions and validations for the [Gleam programming language](https://gleam.run/). --- crates/languages/src/tailwind.rs | 1 + docs/src/languages/tailwindcss.md | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/languages/src/tailwind.rs b/crates/languages/src/tailwind.rs index 1696924644332559ea4d18b33c5da4d5cd271ba3..b0b9132a9ac64ef963463885811e2c23f8e7b5f9 100644 --- a/crates/languages/src/tailwind.rs +++ b/crates/languages/src/tailwind.rs @@ -176,6 +176,7 @@ impl LspAdapter for TailwindLspAdapter { HashMap::from_iter([ (LanguageName::new("Astro"), "astro".to_string()), (LanguageName::new("HTML"), "html".to_string()), + (LanguageName::new("Gleam"), "html".to_string()), (LanguageName::new("CSS"), "css".to_string()), (LanguageName::new("JavaScript"), "javascript".to_string()), (LanguageName::new("TypeScript"), "typescript".to_string()), diff --git a/docs/src/languages/tailwindcss.md b/docs/src/languages/tailwindcss.md index ff20d097e45eb311d49f3c118ed642c11d73e19f..be9c9437d1382dfd356120663ebea2c1fe012684 100644 --- a/docs/src/languages/tailwindcss.md +++ b/docs/src/languages/tailwindcss.md @@ -28,6 +28,7 @@ Languages which can be used with Tailwind CSS in Zed: - [Astro](./astro.md) - [CSS](./css.md) - [ERB](./ruby.md) +- [Gleam](./gleam.md) - [HEEx](./elixir.md#heex) - [HTML](./html.md) - [TypeScript](./typescript.md)