Skip to content

Conversation

@teemingc
Copy link

@teemingc teemingc commented Apr 5, 2024

The recommended VS code settings can be provided by default when the extension is installed using the configuration defaults contribution point in the extension package.json. This would mean less setup for users who install the extension and benefits people who may have missed reading the README first (sadly I was one of those people).

@teemingc teemingc changed the title add vs code configuration defaults feat: add VS Code configuration defaults Apr 5, 2024
thecrypticace added a commit that referenced this pull request Nov 11, 2024
)

This is an alternative design to part of #947. In that PR we'd be
setting a default for *all* CSS files whether they're in a Tailwind CSS
project or not. Instead we:

1. Detect that an opened CSS file is in a Tailwind CSS project and
switch the language to `tailwindcss`. If you manually set it back to the
CSS language we won't switch it back to `tailwindcss` again until you
reload VSCode.
2. Switch any documents after the language server has found a project.
This ensures that when starting a new project and you've created a CSS
file typing `@import "tailwindcss"` and saving it will then switch the
language to `tailwindcss`.
@thecrypticace
Copy link
Contributor

Hey! So, I've been thinking about this one for a while and I was worried that adding these defaults might cause a bit of surprise for people who have the extension installed but are not using Tailwind CSS in some of their projects. As a potential solution to this, I implemented an "auto-switch" functionality for CSS files in detected Tailwind CSS projects which automatically changed the language mode of CSS files over to "Tailwind CSS". Turns out though this was still quite unexpected for some users even when only operating within detected Tailwind CSS projects.

Given that I'm going to close this as I think it'll introduce the same problem but on a potentially larger scale. I'd prefer that the user's who need to make these changes to the config do so themselves. Thanks anyway for the suggestion! 🙏

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.

2 participants