zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.06k stars 3.07k forks source link

Tailwind CSS support in HEEX components or ~H snippets in Elixir files #6306

Closed Raees678 closed 1 year ago

Raees678 commented 1 year ago

Check for existing issues

Describe the bug / provide steps to reproduce it

TailwindCSS autocomplete does not show up in .heex components or ~H sigil snippets in Elixir files.

Environment

Zed: v0.103.1 (stable) OS: macOS 13.5.2 Memory: 64 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

https://github.com/zed-industries/community/assets/10237081/4e56d3ea-8018-4750-8d1b-cb281b3840ba

https://github.com/zed-industries/community/assets/10237081/959bd3af-3d4b-4f11-806e-4a49bf52409b

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

Started ElixirLS v0.16.0
Running in /Users/raeesrajwani/scratch-projects/elixir/steno
ElixirLS built with elixir "1.15.4" on OTP "26"
Running on elixir "1.15.4 (compiled with Erlang/OTP 26)" on OTP "26"
Protocols are not consolidated
Elixir sources not found (checking in /private/tmp/elixir-20230718-6628-xri3lg/elixir-1.15.4). Code navigation to Elixir modules disabled.
Cannot get client configuration: {:ok, [nil]}
Registering for workspace/didChangeConfiguration notifications
client/registerCapability succeeded
Registering for workspace/didChangeWatchedFiles notifications
client/registerCapability succeeded
Received workspace/didChangeConfiguration
Loaded DETS databases in 74ms
Starting build with MIX_ENV: test MIX_TARGET: host
Compile took 128 milliseconds
[ElixirLS WorkspaceSymbols] Indexing...
[ElixirLS WorkspaceSymbols] Module discovery complete
[ElixirLS Dialyzer] Checking for stale beam files
[ElixirLS WorkspaceSymbols] 29 callbacks added to index
[ElixirLS WorkspaceSymbols] 241 modules added to index
[ElixirLS WorkspaceSymbols] 444 types added to index
[ElixirLS Dialyzer] Found 0 changed files in 177 milliseconds
[ElixirLS Dialyzer] Analyzing 0 modules: []
[ElixirLS Dialyzer] Analysis finished in 18 milliseconds
[ElixirLS WorkspaceSymbols] 4967 functions added to index
Dialyzer analysis is up to date
[ElixirLS Dialyzer] Writing manifest...
[ElixirLS Dialyzer] Done writing manifest in 696 milliseconds.
Starting build with MIX_ENV: test MIX_TARGET: host
Compiling 1 file (.ex)
Compile took 697 milliseconds
[ElixirLS WorkspaceSymbols] Updating index...
[ElixirLS Dialyzer] Checking for stale beam files
[ElixirLS WorkspaceSymbols] 1 modules need reindexing
[ElixirLS WorkspaceSymbols] 0 callbacks added to index
[ElixirLS WorkspaceSymbols] 1 modules added to index
[ElixirLS WorkspaceSymbols] 0 types added to index
[ElixirLS WorkspaceSymbols] 10 functions added to index
[ElixirLS Dialyzer] Found 1 changed files in 30 milliseconds
[ElixirLS Dialyzer] Analyzing 1 modules: [StenoWeb.DashboardLive]
[ElixirLS Dialyzer] Analysis finished in 198 milliseconds
Dialyzer analysis is up to date
[ElixirLS Dialyzer] Writing manifest...
[ElixirLS Dialyzer] Done writing manifest in 683 milliseconds.
Starting build with MIX_ENV: test MIX_TARGET: host
Compiling 1 file (.ex)
Compile took 618 milliseconds
[ElixirLS WorkspaceSymbols] Updating index...
[ElixirLS Dialyzer] Checking for stale beam files
[ElixirLS WorkspaceSymbols] 1 modules need reindexing
[ElixirLS WorkspaceSymbols] 0 callbacks added to index
[ElixirLS WorkspaceSymbols] 1 modules added to index
[ElixirLS WorkspaceSymbols] 0 types added to index
[ElixirLS WorkspaceSymbols] 10 functions added to index
[ElixirLS Dialyzer] Found 1 changed files in 34 milliseconds
[ElixirLS Dialyzer] Analyzing 1 modules: [StenoWeb.DashboardLive]
[ElixirLS Dialyzer] Analysis finished in 197 milliseconds
Dialyzer analysis is up to date
[ElixirLS Dialyzer] Writing manifest...
[ElixirLS Dialyzer] Done writing manifest in 688 milliseconds.
JosephTLyons commented 1 year ago

@ForLoveOfCats, @SomeoneToIgnore

ArthurMmn commented 1 year ago

I want to add that not all elixir project use tailwind, so I think if it is implemented, there should be a project configurations to enable / disable tailwind support.

Probably this kind of settings will eventually be needed anyway because the same thing will happen for tailwind in other templating languages (like erb files for ruby I guess ?) or for other "languages" embedded in HTML like alpine or htmx.

willcosgrove commented 1 year ago

I agree with the project configuration to enable or disable support. I have been primarily writing views using a Ruby gem called Phlex, which defines all markup in Ruby code. So I'm writing tailwind classes inside of .rb files. It would be amazing if there was some way to enable Tailwind autocomplete there. Maybe by reading the tailwind.config.js which defines those file paths as being scanned for the Tailwind JIT 🤷‍♂️

enstyled commented 1 year ago

Just want to share my interest in this. Is there anything we can do to contribute?

Zed + Elixir + Tailwind = 💖

JosephTLyons commented 1 year ago

This is available in today's preview release - v0.110.0.

noozo commented 1 year ago

Can we have the same for ~F?

nesokad commented 6 months ago

Tailwind Intellisense not working again inside Phoenix ~H sigil Elixir files.

Zed: 0.134.4

:phoenix, "1.7.11" :phoenix_live_view, "0.20.2"

JonGretar commented 6 months ago

Might the move of the elixir support to an extension have messed this up in some way?