zed icon indicating copy to clipboard operation
zed copied to clipboard

Fix Tailwind completions in Rust

Open I-Info opened this issue 7 months ago • 7 comments

Closes #25670

After fixing: image

Release Notes:

  • Fixed broken Tailwind CSS auto completion in Rust.

I-Info avatar Apr 14 '25 05:04 I-Info

We require contributors to sign our Contributor License Agreement, and we don't have @I-Info on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

cla-bot[bot] avatar Apr 14 '25 05:04 cla-bot[bot]

@cla-bot check

I-Info avatar Apr 14 '25 05:04 I-Info

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Apr 14 '25 05:04 cla-bot[bot]

This issue does not only impact Rust. Any chance this can be done for Ruby / ERB templates as well? Tailwind support just seems broken for weeks now

  • https://github.com/zed-industries/zed/issues/27118
  • https://github.com/zed-industries/zed/issues/27842

drale2k avatar Apr 15 '25 14:04 drale2k

This issue does not only impact Rust. Any chance this can be done for Ruby / ERB templates as well? Tailwind support just seems broken for weeks now

I think this can be done much easier by modifying language configs of Ruby templates in the zed ruby ​​extension

However, I am not familiar with Ruby templates or ERB at all, so I can't give an exact solution. I'm thinking maybe there'd be faster progress on this bug if someone opened a new issue or PR there?

Edited: I also tried to fix tailwind completions in Ruby

  • zed-extensions/ruby#62

I-Info avatar Apr 15 '25 14:04 I-Info

During the several days waiting for the review of this PR. I think it would quite tedious to add overrides for every language which Tailwind might be used in. So, is it possible to set default query characters in Tailwind's (also any other languages') LspAdapter?

I-Info avatar Apr 23 '25 07:04 I-Info

Hello, I confirm having the same issue, do you think you could merge as soon as practical ? And thanks for this wonderful editor, I've just upgraded to Pro today, I haven't even tried Cursor or Windsurf as I just relish the Zed experience.

newbie33-git avatar May 13 '25 14:05 newbie33-git

Hey @I-Info, we don't currently have a way of having a child-parent relationship like you describe (i.e. tailwind -> Rust rather than the other way around), it's something I agree we should support, so that for example the Rust extension doesn't need to be concerned with every possible macro DSL.

Separately, I think this is better suited as a PR to https://github.com/zed-extensions/leptos as defining it in the rust language will have tailwind LSP run for all Rust projects, rather than just ones that are using rsx! like you are. If you're not using leptos, it's probably worth making an extension for whatever you're using based on the leptos extension and having this config there instead, so that the tailwind behavior is more opt-in.

For that reason, I'm going to close this for now, but I'm happy to re-open if given a reason why I'm misunderstanding or otherwise continue discussing. Thanks!

probably-neb avatar Jun 03 '25 10:06 probably-neb