Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tailwindcss language server #8442

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Add tailwindcss language server #8442

merged 1 commit into from
Oct 4, 2023

Conversation

David-Else
Copy link
Contributor

@David-Else David-Else commented Oct 2, 2023

EDIT I just saw #7080 .. arrghhh! Please could people still have a look at the questions I bring up here and we can get the other one merged! Also, we have started merging more language server definitions since multiple language servers arrived on the scene...

The following appears to work fine with this pull request, which is simply tailwindcss-ls = { command = "tailwindcss-language-server", args = ["--stdio"] }:

sudo npm install -g @tailwindcss/language-server@insiders
[[language]]
name = "html"
language-servers = [ "vscode-html-language-server", "tailwindcss-ls" ]

[[language]]
name = "css"
language-servers = [ "vscode-css-language-server", "tailwindcss-ls" ]

input.css

(tailwind message)
image
(vscode-css-language-server message)
image

index.html

(tailwind auto-completion)
image

I followed this thread,, and it seems to be full of very outdated, complex, and redundant information. Passing language ID? Is any of that needed any more?

I have marked this as draft until someone confirms I have not missed something. The order you add the language server makes a difference, the first one gets the hover information when you press space-k, but the tailwind server seems 100% functional other than that feature, and you can get at the info in the auto complete anyway.

@David-Else David-Else marked this pull request as draft October 2, 2023 15:27
@catdevnull
Copy link

This is what works for me in helix master, with what I believe to be without any of the legacy things that were previously required in the config:

[language-server.tailwindcss]
command = "tailwindcss-language-server"
args = ["--stdio"]

[language-server.vscode-json]
command = "vscode-json-language-server"
args = ["--stdio"]

[[language]]
name = "jsx"
language-servers = [ "tailwindcss", "typescript-language-server" ]

[[language]]
name = "tsx"
language-servers = [ "tailwindcss", "typescript-language-server" ]

[[language]]
name = "html"
language-servers = [ "tailwindcss", "vscode-html-language-server" ]

[[language]]
name = "json"
language-servers = ["vscode-json", "typescript-language-server"]

[[language]]
name = "svelte"
language-servers = [ "tailwindcss", "svelteserver" ]

Requires the insiders build as mentioned in OP.

@archseer
Copy link
Member

archseer commented Oct 4, 2023

I'd actually be inclined to merge this. While the user still needs to edit their language config to add the server to their language, this at least avoids having to add the server definition manually.

@David-Else David-Else marked this pull request as ready for review October 4, 2023 06:45
@David-Else
Copy link
Contributor Author

I'd actually be inclined to merge this. While the user still needs to edit their language config to add the server to their language, this at least avoids having to add the server definition manually.

Great! Please merge this.

@archseer archseer merged commit 68fce3e into helix-editor:master Oct 4, 2023
danillos pushed a commit to danillos/helix that referenced this pull request Nov 21, 2023
@pyrossh
Copy link

pyrossh commented Dec 17, 2023

I've added the instructions to the wiki now,
https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers#tailwindcss

@David-Else
Copy link
Contributor Author

@pyrossh Cheers! You don't actually need the insiders version any more, I checked with the latest stable @tailwindcss/[email protected] and it is all working :)

@pyrossh
Copy link

pyrossh commented Dec 18, 2023

Ahh nice will update it. Thanks.

dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants