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

Tailwind CSS support #5830

Closed
1 task done
chloerei opened this issue Nov 29, 2022 · 64 comments
Closed
1 task done

Tailwind CSS support #5830

chloerei opened this issue Nov 29, 2022 · 64 comments
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors potential extension Functionality that could be implemented as an extension (consider moving to community extensions) unsupported language

Comments

@chloerei
Copy link

Check for existing issues

  • Completed

Language

Tailwind CSS

Tree Sitter parser link

No response

Language server link

https://github.com/tailwindlabs/tailwindcss-intellisense/tree/master/packages/tailwindcss-language-server

Misc notes

Hope to be like Tailwind's VS Code plugin: https://github.com/tailwindlabs/tailwindcss-intellisense

Feature:

  • Autocomplete ( with color preview and properties details)
  • Linting
  • Hover Preview
@chloerei chloerei added enhancement [core label] language An umbrella label for all programming languages syntax behaviors triage Maintainer needs to classify the issue labels Nov 29, 2022
@JosephTLyons JosephTLyons removed the triage Maintainer needs to classify the issue label Nov 30, 2022
@hovsater hovsater added the potential extension Functionality that could be implemented as an extension (consider moving to community extensions) label Apr 30, 2023
@caleb654
Copy link

This would be awesome. It is the only thing stopping me from using Zed for a lot of my front-end development work.

@bytemtek
Copy link

Is there TailwindCSS support?

@hovsater
Copy link
Contributor

There's no Tailwind CSS support yet.

@tonimasc
Copy link

tonimasc commented Jun 28, 2023

Is the only think stopping me from using Zed as my main code editor.

@rolanday
Copy link

rolanday commented Jul 1, 2023

+1. Buzz kill. Started using Zed, loved it. Then hit landmine -- no Tailwind intellisense. Stops me dead in my tracks. I'll stay subscribed and switch over after Tailwinds support added. Otherwise fantastic editor!!

@jesseb34r
Copy link

Would love to see this come to Zed. Definitely would make the switch easier

@aexvir
Copy link
Contributor

aexvir commented Jul 19, 2023

please be considerate and only write a comment if there's something meaningful to add
for showing interest is enough to react with a 👍🏻 to this issue, writing +1 comments won't make this development go faster
these comments don't add any value to the issue, and we don't want to have to lock the issue to avoid the noise

with that said, it is on our radar and it will be tackled when priorities allow it

@widersky
Copy link

widersky commented Sep 1, 2023

It would be good if Zed supported other locations of the tailwind.config file than project root - at the moment I have this file "buried" in several folders and autocomplete does not work at all 🤷‍♂️

@jezikk
Copy link

jezikk commented Sep 1, 2023

Or you can have a monorepo project with more different tailwind.config files.

@ForLoveOfCats
Copy link
Contributor

@widersky Our experimental Tailwind autocomplete support has not shipped yet, you can try it out in our next preview build this Wednesday or on stable next week 😄

@patrikengborg
Copy link

Just tried it, it works in .html files and in css selectors when using it with @apply. But not in svelte/vue files.

Can I fix this with a setting somehow?

@matthewmorek
Copy link

@widersky Our experimental Tailwind autocomplete support has not shipped yet, you can try it out in our next preview build this Wednesday or on stable next week 😄

I'm wondering if this will also work in JSX/TSX files, as opposed to just HTML/CSS?

@piyanggoon
Copy link

@widersky Our experimental Tailwind autocomplete support has not shipped yet, you can try it out in our next preview build this Wednesday or on stable next week 😄

I'm wondering if this will also work in JSX/TSX files, as opposed to just HTML/CSS?

I try on tsx it work fine.

@widersky
Copy link

widersky commented Sep 7, 2023

@ForLoveOfCats tried and didn't work when config file was inside another folder 🤷‍♂️

@JosephTLyons
Copy link
Collaborator

JosephTLyons commented Sep 7, 2023

Hey all, I'm going to close this issue since initial support is in preview now. We're bound to have some bugs; if you're running into anything, please open new issues so we can track those separately.

@jeppech
Copy link

jeppech commented Sep 13, 2023

@patrikengborg I've created a separate issue for Tailwind in Svelte components here #6294, so it can be tracked there.

@eiiot
Copy link

eiiot commented Nov 2, 2023

I've been using the preview for a few weeks now, and I still can't get tailwind autocomplete working. It simply doesn't appear in the list of language servers.

Using the default NextJS project config.

@tmns
Copy link

tmns commented Dec 18, 2023

Do we need to do something to enable the TW language server? So far in TSX files I'm not getting any completion / suggestions. Further, ~/Library/Application Support/zed/languages/tailwindcss-language-server is empty. I tried manually building it from source and adding the binary in that dir but it seems to get overwritten / emptied out on start up.

Update: looks like it was the same issue identified in #4628. Once I moved my ~/package.json, ~/package-lock.json, & ~/node_modules it began working.

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@salvinoto
Copy link

Does this not work for anyone in typescript files? It just doesnt autocomplete tailwind at all

@mrnugget
Copy link
Member

As for documentation missing: it seems like tailwindcss-language-server expects a _projectKey to be sent along in the data attribute of a completionItem/resolve request, otherwise it returns null.

https://github.com/tailwindlabs/tailwindcss-intellisense/blob/086ffff816feb3bb595f49cc38572ed1485012ff/packages/tailwindcss-language-server/src/tw.ts#L819-L823

That's where the error comes from.

We do get the data bag for some completion items and then send it along to resolve the item, but we don't get it for a lot of items, which is where the errors come from. Something's very off.

@nguyenyou
Copy link

@mrnugget Thank you very much for fixing this bug. May I ask in which version of zed I can try it?

@mrnugget
Copy link
Member

It's in v0.136.0-pre

osiewicz pushed a commit to RemcoSmitsDev/zed that referenced this issue May 18, 2024
This fixes the issue mentioned here:
zed-industries#5830 (comment)

In order for other languages to work, we need to pass the following
settings along to the Tailwind language server.

With the following Zed settings, it then also works for Scala:

```json
{
  "languages": {
    "Scala": {
      "language_servers": ["tailwindcss-language-server"]
    },
  },
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "includeLanguages": {
          "scala": "html"
        },
        "experimental": {
          "classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"]
        }
      }
    }
  }
}
```

Release Notes:

- Added ability to configure settings for `tailwindcss-language-server`,
namely the `includeLanguages` and `experimental` objects.

**NOTE**: I have only tested that the language server boots up for Scala
files and that the settings are forwarded correctly. I don't have a
Scala+Tailwind project with which to test that the actual completions
also work.

cc @nguyenyou
@Bishwas-py
Copy link

I hope this pre will also work on .heex templates.

@mrnugget
Copy link
Member

mrnugget commented Jul 1, 2024

I hope this pre will also work on .heex templates.

It should, yeah!

@vipexv
Copy link

vipexv commented Jul 2, 2024

Somehow the intellisense doesn't work for me.
Like nothing appears, not when pressing Left Control + Space and not by default.

I'm on Windows and i compiled the latest source code.

image

@mrnugget
Copy link
Member

mrnugget commented Jul 3, 2024

@vipexv can you create a separate ticket with the necessary logs? Use zed: open logs and debug: open language server logs to get to them.

@vipexv
Copy link

vipexv commented Jul 3, 2024

@vipexv can you create a separate ticket with the necessary logs? Use zed: open logs and debug: open language server logs to get to them.

#13786

@vipexv
Copy link

vipexv commented Jul 3, 2024

Turns out same thing happens for the LUA Language Server.

@jozefini
Copy link

jozefini commented Jul 6, 2024

Any way how to add this config (taken from VS Code)?

"tailwindCSS.classAttributes": [
    "class",
    "className",
    "ngClass",
 
    // add styles so will give intellisense to styles constant.
    "styles"
  ],

So i can use like this

const styles = {
  button: 'inline-flex items-center justify-center ...'
  input: 'inline-flex items-center border ...',
}

mrnugget added a commit that referenced this issue Jul 8, 2024
This addresses the question in [this
comment](#5830 (comment))
by adding support for `classAttributes` to the settings.

Meaning that the following Zed `settings.json` now works:

```json
{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "classAttributes": [
          "class",
          "className",
          "ngClass",

          // add styles so will give intellisense to styles constant.
          "styles"
        ]
        // Optional:
        // "includeLanguages": {
        //   "erb": "html",
        //   "ruby": "html"
        // },
        // "experimental": {
        //   "classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
        // }
      }
    }
  }
}
```
@mrnugget
Copy link
Member

mrnugget commented Jul 8, 2024

@jozefini that wasn't possible, but I'm adding it here: #13923

mrnugget added a commit that referenced this issue Jul 8, 2024
This addresses the question in [this

comment](#5830 (comment))
by adding support for `classAttributes` to the settings.

Meaning that the following Zed `settings.json` now works:

```jsonc
{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "classAttributes": [
          "class",
          "className",
          "ngClass",

          // add styles so will give intellisense to styles constant.
          "styles"
        ]
        // Optional:
        // "includeLanguages": {
        //   "erb": "html",
        //   "ruby": "html"
        // },
        // "experimental": {
        //   "classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
        // }
      }
    }
  }
}
```



Release Notes:

- Added support for setting `classAttributes` in the configuration for
`tailwindcss-language-server`. Example: `{ "lsp": {
"tailwindcss-language-server": { "settings": { "classAttributes": [
"class", "className", "ngClass", "styles" ] } } } }`
pull bot pushed a commit to RickHuijsmans/zed that referenced this issue Jul 8, 2024
…3923)

This addresses the question in [this

comment](zed-industries#5830 (comment))
by adding support for `classAttributes` to the settings.

Meaning that the following Zed `settings.json` now works:

```jsonc
{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "classAttributes": [
          "class",
          "className",
          "ngClass",

          // add styles so will give intellisense to styles constant.
          "styles"
        ]
        // Optional:
        // "includeLanguages": {
        //   "erb": "html",
        //   "ruby": "html"
        // },
        // "experimental": {
        //   "classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
        // }
      }
    }
  }
}
```



Release Notes:

- Added support for setting `classAttributes` in the configuration for
`tailwindcss-language-server`. Example: `{ "lsp": {
"tailwindcss-language-server": { "settings": { "classAttributes": [
"class", "className", "ngClass", "styles" ] } } } }`
@secondl1ght
Copy link

secondl1ght commented Jul 10, 2024

Just installed the new Linux release and Tailwind support also isn't working for me out of the box - is there anything else needed to be done to set it up properly?

image

☝🏼 This is all that appears, no Tailwind or TypeScript or anything else.

@mrnugget
Copy link
Member

@secondl1ght no, it should work out of the box, but maybe you're using a language for which it isn't enabled by default. Hard to tell without knowing what file type you're editing with which setup :)

@secondl1ght
Copy link

secondl1ght commented Jul 11, 2024

@mrnugget I am editing a .tsx file in a Next.js project. The Tailwind config file is at the root of the project.

@mrnugget
Copy link
Member

Is there anything in the logs? zed: open logs?

@secondl1ght
Copy link

@mrnugget this command doesn't seem to exist when I open the Command Palette:
image

@mrnugget
Copy link
Member

Sorry, it's zed: open log

screenshot-2024-07-12-17 10 27@2x

@secondl1ght
Copy link

@mrnugget

Caused by:
    No such file or directory (os error 2)
2024-07-12T08:28:34-06:00 [INFO] starting language server "eslint", path: "/home/mk/Desktop/CODE/amboss-banco", id: 21
2024-07-12T08:28:34-06:00 [INFO] starting language server. binary path: "/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/bin/node", working directory: "/home/mk/Desktop/CODE/amboss-banco", args: ["/home/mk/.local/share/zed/languages/eslint/vscode-eslint-release/vscode-eslint/server/out/eslintServer.js", "--stdio"]
2024-07-12T08:28:34-06:00 [ERROR] cannot read LSP message headers
2024-07-12T08:28:34-06:00 [ERROR] failed to start language server "eslint": oneshot canceled
2024-07-12T08:28:34-06:00 [ERROR] server stderr: Some("node:internal/modules/cjs/loader:1078\n  throw err;\n  ^\n\nError: Cannot find module '/home/mk/.local/share/zed/languages/eslint/vscode-eslint-release/vscode-eslint/server/out/eslintServer.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\n    at Module._load (node:internal/modules/cjs/loader:920:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n    at node:internal/main/run_main_module:23:47 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v18.15.0\n")
2024-07-12T08:28:34-06:00 [ERROR] Hit 4 reinstallation attempts for "eslint"
2024-07-12T08:28:34-06:00 [ERROR] Broken pipe (os error 32)
2024-07-12T08:28:34-06:00 [ERROR] server shut down

@secondl1ght
Copy link

@mrnugget here is one part mentioning Tailwind:

2024-07-10T21:46:00-06:00 [WARN] test binary check failed
2024-07-10T21:46:00-06:00 [INFO] beginning to reinstall server
2024-07-10T21:46:00-06:00 [INFO] deleting server container
2024-07-10T21:46:00-06:00 [INFO] starting language server "vtsls", path: "/home/mk/Desktop/CODE/amboss-banco", id: 13
2024-07-10T21:46:00-06:00 [INFO] fetching latest version of language server "vtsls"
2024-07-10T21:46:00-06:00 [INFO] Node runtime install_if_needed
2024-07-10T21:46:00-06:00 [ERROR] no cached binary
2024-07-10T21:46:00-06:00 [INFO] About to spawn test binary
2024-07-10T21:46:00-06:00 [WARN] test binary failed to launch
2024-07-10T21:46:00-06:00 [WARN] test binary check failed
2024-07-10T21:46:00-06:00 [INFO] beginning to reinstall server
2024-07-10T21:46:00-06:00 [INFO] deleting server container
2024-07-10T21:46:00-06:00 [INFO] starting language server "tailwindcss-language-server", path: "/home/mk/Desktop/CODE/amboss-banco", id: 14
2024-07-10T21:46:00-06:00 [INFO] fetching latest version of language server "tailwindcss-language-server"
2024-07-10T21:46:00-06:00 [INFO] Node runtime install_if_needed
2024-07-10T21:46:06-06:00 [ERROR] Failed to install default prettier: prettier & plugins install: fetching latest npm versions: fetching latest npm version for package prettier: failed to execute npm info subcommand:
stdout: "{\n  \"error\": {\n    \"code\": \"ECONNREFUSED\",\n    \"summary\": \"FetchError: request to https://registry.npmjs.org/prettier failed, reason: connect ECONNREFUSED 2606:4700::6810:1d22:443\",\n    \"detail\": \"\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly.  See: 'npm help config'\"\n  }\n}\n"
stderr: "npm ERR! code ECONNREFUSED\nnpm ERR! syscall connect\nnpm ERR! errno ECONNREFUSED\nnpm ERR! FetchError: request to https://registry.npmjs.org/prettier failed, reason: connect ECONNREFUSED 2606:4700::6810:1d22:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\nnpm ERR!  FetchError: request to https://registry.npmjs.org/prettier failed, reason: connect ECONNREFUSED 2606:4700::6810:1d22:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\nnpm ERR!   code: 'ECONNREFUSED',\nnpm ERR!   errno: 'ECONNREFUSED',\nnpm ERR!   syscall: 'connect',\nnpm ERR!   address: '2606:4700::6810:1d22',\nnpm ERR!   port: 443,\nnpm ERR!   type: 'system'\nnpm ERR! }\nnpm ERR! \nnpm ERR! If you are behind a proxy, please make sure that the\nnpm ERR! 'proxy' config is set properly.  See: 'npm help config'\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/cache/_logs/2024-07-11T03_45_56_753Z-debug-0.log\n"
2024-07-10T21:46:06-06:00 [INFO] Node runtime install_if_needed
2024-07-10T21:46:10-06:00 [ERROR] no cached binary
2024-07-10T21:46:10-06:00 [ERROR] failed to start language server "json-language-server": failed to execute npm info subcommand:
stdout: "{\n  \"error\": {\n    \"code\": \"ECONNREFUSED\",\n    \"summary\": \"FetchError: request to https://registry.npmjs.org/vscode-langservers-extracted failed, reason: connect ECONNREFUSED 2606:4700::6810:1b22:443\",\n    \"detail\": \"\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly.  See: 'npm help config'\"\n  }\n}\n"
stderr: "npm ERR! code ECONNREFUSED\nnpm ERR! syscall connect\nnpm ERR! errno ECONNREFUSED\nnpm ERR! FetchError: request to https://registry.npmjs.org/vscode-langservers-extracted failed, reason: connect ECONNREFUSED 2606:4700::6810:1b22:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\nnpm ERR!  FetchError: request to https://registry.npmjs.org/vscode-langservers-extracted failed, reason: connect ECONNREFUSED 2606:4700::6810:1b22:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\nnpm ERR!   code: 'ECONNREFUSED',\nnpm ERR!   errno: 'ECONNREFUSED',\nnpm ERR!   syscall: 'connect',\nnpm ERR!   address: '2606:4700::6810:1b22',\nnpm ERR!   port: 443,\nnpm ERR!   type: 'system'\nnpm ERR! }\nnpm ERR! \nnpm ERR! If you are behind a proxy, please make sure that the\nnpm ERR! 'proxy' config is set properly.  See: 'npm help config'\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/cache/_logs/2024-07-11T03_46_00_214Z-debug-0.log\n"
2024-07-10T21:46:10-06:00 [ERROR] server stderr: Some("")
2024-07-10T21:46:10-06:00 [INFO] retrying installation of language server "json-language-server" in 1s
2024-07-10T21:46:10-06:00 [ERROR] missing executable in directory "/home/mk/.local/share/zed/languages/vtsls"
2024-07-10T21:46:10-06:00 [ERROR] failed to start language server "vtsls": failed to execute npm info subcommand:
stdout: "{\n  \"error\": {\n    \"code\": \"ECONNREFUSED\",\n    \"summary\": \"FetchError: request to https://registry.npmjs.org/typescript failed, reason: connect ECONNREFUSED 2606:4700::6810:23:443\",\n    \"detail\": \"\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly.  See: 'npm help config'\"\n  }\n}\n"
stderr: "npm ERR! code ECONNREFUSED\nnpm ERR! syscall connect\nnpm ERR! errno ECONNREFUSED\nnpm ERR! FetchError: request to https://registry.npmjs.org/typescript failed, reason: connect ECONNREFUSED 2606:4700::6810:23:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\nnpm ERR!  FetchError: request to https://registry.npmjs.org/typescript failed, reason: connect ECONNREFUSED 2606:4700::6810:23:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\nnpm ERR!   code: 'ECONNREFUSED',\nnpm ERR!   errno: 'ECONNREFUSED',\nnpm ERR!   syscall: 'connect',\nnpm ERR!   address: '2606:4700::6810:23',\nnpm ERR!   port: 443,\nnpm ERR!   type: 'system'\nnpm ERR! }\nnpm ERR! \nnpm ERR! If you are behind a proxy, please make sure that the\nnpm ERR! 'proxy' config is set properly.  See: 'npm help config'\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/cache/_logs/2024-07-11T03_46_00_795Z-debug-0.log\n"
2024-07-10T21:46:10-06:00 [ERROR] server stderr: Some("")
2024-07-10T21:46:10-06:00 [INFO] retrying installation of language server "vtsls" in 1s
2024-07-10T21:46:11-06:00 [ERROR] no cached binary
2024-07-10T21:46:11-06:00 [ERROR] failed to start language server "tailwindcss-language-server": failed to execute npm info subcommand:
stdout: "{\n  \"error\": {\n    \"code\": \"ECONNREFUSED\",\n    \"summary\": \"FetchError: request to https://registry.npmjs.org/@tailwindcss%2flanguage-server failed, reason: connect ECONNREFUSED 2606:4700::6810:123:443\",\n    \"detail\": \"\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly.  See: 'npm help config'\"\n  }\n}\n"
stderr: "npm ERR! code ECONNREFUSED\nnpm ERR! syscall connect\nnpm ERR! errno ECONNREFUSED\nnpm ERR! FetchError: request to https://registry.npmjs.org/@tailwindcss%2flanguage-server failed, reason: connect ECONNREFUSED 2606:4700::6810:123:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\nnpm ERR!  FetchError: request to https://registry.npmjs.org/@tailwindcss%2flanguage-server failed, reason: connect ECONNREFUSED 2606:4700::6810:123:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\nnpm ERR!   code: 'ECONNREFUSED',\nnpm ERR!   errno: 'ECONNREFUSED',\nnpm ERR!   syscall: 'connect',\nnpm ERR!   address: '2606:4700::6810:123',\nnpm ERR!   port: 443,\nnpm ERR!   type: 'system'\nnpm ERR! }\nnpm ERR! \nnpm ERR! If you are behind a proxy, please make sure that the\nnpm ERR! 'proxy' config is set properly.  See: 'npm help config'\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/cache/_logs/2024-07-11T03_46_01_104Z-debug-0.log\n"
2024-07-10T21:46:11-06:00 [ERROR] server stderr: Some("")
2024-07-10T21:46:11-06:00 [INFO] retrying installation of language server "tailwindcss-language-server" in 1s

@mrnugget
Copy link
Member

Yeah, seems like it can't download it:

2024-07-10T21:46:11-06:00 [ERROR] failed to start language server "tailwindcss-language-server": failed to execute npm info subcommand:
stdout: "{\n  \"error\": {\n    \"code\": \"ECONNREFUSED\",\n    \"summary\": \"FetchError: request to https://registry.npmjs.org/@tailwindcss%2flanguage-server failed, reason: connect ECONNREFUSED 2606:4700::6810:123:443\",\n    \"detail\": \"\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly.  See: 'npm help config'\"\n  }\n}\n"
stderr: "npm ERR! code ECONNREFUSED\nnpm ERR! syscall connect\nnpm ERR! errno ECONNREFUSED\nnpm ERR! FetchError: request to https://registry.npmjs.org/@tailwindcss%2flanguage-server failed, reason: connect ECONNREFUSED 2606:4700::6810:123:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\nnpm ERR!  FetchError: request to https://registry.npmjs.org/@tailwindcss%2flanguage-server failed, reason: connect ECONNREFUSED 2606:4700::6810:123:443\nnpm ERR!     at ClientRequest.<anonymous> (/home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)\nnpm ERR!     at ClientRequest.emit (node:events:513:28)\nnpm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)\nnpm ERR!     at TLSSocket.emit (node:events:525:35)\nnpm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)\nnpm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)\nnpm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\nnpm ERR!   code: 'ECONNREFUSED',\nnpm ERR!   errno: 'ECONNREFUSED',\nnpm ERR!   syscall: 'connect',\nnpm ERR!   address: '2606:4700::6810:123',\nnpm ERR!   port: 443,\nnpm ERR!   type: 'system'\nnpm ERR! }\nnpm ERR! \nnpm ERR! If you are behind a proxy, please make sure that the\nnpm ERR! 'proxy' config is set properly.  See: 'npm help config'\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/mk/.local/share/zed/node/node-v18.15.0-linux-x64/cache/_logs/2024-07-11T03_46_01_104Z-debug-0.log\n"
2024-07-10T21:46:11-06:00 [ERROR] server stderr: Some("")
2024-07-10T21:46:11-06:00 [INFO] retrying installation of language server "tailwindcss-language-server" in 1s

@secondl1ght
Copy link

I turned off my VPN and restarted Zed and it appears that the language servers are running now:
image

I wonder why these servers are blocking VPNs... I think I can still use Zed with a VPN running once I have downloaded the updates though right? It seems to be working now even after re-enabling my VPN and restarting Zed again.

One suggestion is that there should be an error notification in the UI if the language servers cannot start - the logs are useful but it seems like something the user should be notified about right away, so that they know the editor is not functioning as expected.

@austin-karren
Copy link

It works for me unless I'm using CLSX. Vscode has a regex setting that makes this possible but I wish Zed could also do it

@mrnugget
Copy link
Member

mrnugget commented Dec 9, 2024

What's the regex? We do support classRegex, so it sounds like it would be possible. See this example configuration for Scala&Tailwind:

{
  "languages": {
    "Scala": {
      "language_servers": ["tailwindcss-language-server"]
    },
  },
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "includeLanguages": {
          "scala": "html"
        },
        "experimental": {
          "classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"]
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors potential extension Functionality that could be implemented as an extension (consider moving to community extensions) unsupported language
Projects
None yet
Development

No branches or pull requests