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

fix(vscode-tailwindcss): fix activation events #1131

Closed

Conversation

gperdomor
Copy link

@gperdomor gperdomor commented Jan 22, 2025

Currently the extension is activated always, even in not js/ts workspaces...

With this PR, the extension is activated when a tailwind config file is present in the workspace or when tailwindcss is inside node_modules/bin folder

Fix #1132

@gperdomor gperdomor mentioned this pull request Jan 23, 2025
@gperdomor
Copy link
Author

@thecrypticace please can you review this please? 🙏🏻

@thecrypticace
Copy link
Contributor

Hey, so this isn't correct for this extension unfortunately. There's a few reasons:

  • Tailwind v3 projects using Yarn PnP may not have a node_modules directory at all
  • Tailwind v4 projects may not have a tailwind config file in js/mjs/ts files (in fact, most will not)
  • Tailwind v4 projects will not have a CLI binary when using PostCSS or Vite unless the @tailwindcss/cli package is also installed.

Is there a problem you're seeing caused by it activating in non-Tailwind projects? It shouldn't launch the language server unless there's a possibility of it detecting a Tailwind project. In which case the language server will do some additional work and then bail if it's not detected.

@gperdomor
Copy link
Author

Ok I understand... Thanks for the explanation

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.

VSCode extension activation events issue
2 participants