Skip to content

Neovim LSP should work with standalone CLI, not requiring npm install #972

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

Closed
andradei opened this issue May 25, 2024 · 5 comments
Closed

Comments

@andradei
Copy link

andradei commented May 25, 2024

What version of VS Code are you using?

Neovim 0.10.0

What version of Tailwind CSS IntelliSense are you using?

I think it's not applicable in neovim

What version of Tailwind CSS are you using?

v3.4.3

What package manager are you using?

npm - although this shouldn't be needed

What operating system are you using?

Linux (Arch-based)

Tailwind config

import type { Config } from "tailwindcss";
import forms from "@tailwindcss/forms";
import typography from "@tailwindcss/typography"

const config: Config = {
  content: ["./templates/**/*.html", "./public/**/*.js"],
  theme: {
    extend: {},
  },
  plugins: [forms, typography],
};

export default config;

VS Code settings

Not applicable, using neovim

Reproduction URL

Also not applicable

Describe your issue

I don't know if this should be a bug report or a feature request.

A standalone CLI tool is provided for projects that would use npm and have package.json only because of Tailwind.

(screenshot for reference)
image

But if I'm on neovim and want to use the tailwincss-language-server, looks like the only way to get it working is with npm i -D tailwindcss, which is contradictory to statement on the link above.

It would be great if the LSP server could optionally use the standalone CLI tailwindcss tool.

@andradei
Copy link
Author

andradei commented May 25, 2024

Might be related to some of the confusion with getting things working as mentioned in #815.
Specifically: This comment

@thecrypticace
Copy link
Contributor

thecrypticace commented May 26, 2024

Working with a specific version of the standalone CLI isn't really possible right now. This is because we rely on loading internals from the filesystem to actually perform the necessary operations. The Standalone CLI is really intended as just a CLI for building.

Having said that, you don't actually need to use the standalone CLI or an npm install to actually use the extension. We'll detect a Tailwind v3 project just fine — but you'll get the version of Tailwind that's bundled into the extension rather than whatever version is related to your CLI.

If that particular feature isn't working for you could you please provide a reproduction?

@thecrypticace
Copy link
Contributor

Having said that, I'd love to find some way to change this in v4. Possibly by building the language server (or some kind of other interface) into the CLI itself. I don't know what that'll look like though and I'm not sure if that'll happen for v4.0 (but perhaps a later 4.x release). It's also complicated by the fact that, right now, we still support Tailwind projects all the way back to v0.x.

@andradei
Copy link
Author

Having said that, you don't actually need to use the standalone CLI or an npm install to actually use the extension. We'll detect a Tailwind v3 project just fine — but you'll get the version of Tailwind that's bundled into the extension rather than whatever version is related to your CLI.

That's a great feature. I don't know why it doesn't work for me in neovim. Maybe there are extra settings I need to set on the LSP client. Other people were already working on JS projects and did npm i tailwindcss to have it work as well (didn't have to install the standalone CLI, obviously). So wish I could give more details.

I'll keep an eye on v4 in case it improve this specific experience.

@thecrypticace
Copy link
Contributor

We've tested this locally with Neovim and the fallback version is working in Neovim, VSCode, and Zed so it might be something specific to your setup. If you're able to provide a bit more detail (configuration, vim plugins, project structure, etc…) I'll look into it but I'm gonna close this one for now.

@andradei andradei changed the title Neovim LSP should work with standalone CLI, not requireing npm install Neovim LSP should work with standalone CLI, not requiring npm install Jul 11, 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

No branches or pull requests

2 participants