-
-
Notifications
You must be signed in to change notification settings - Fork 226
Improve support for source(…) feature in v4
#1083
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
Conversation
ed3cbaa to
a5daeec
Compare
5f2bc92 to
c1e51e0
Compare
12004bb to
c2f8357
Compare
We were booting the LSP no matter what which broke detection when CSS-files were created
c2f8357 to
6f6d988
Compare
6f6d988 to
3e8d3d4
Compare
|
@philipp-spiess @RobinMalfait I still want to do another pass on this for spelling / punctuation / etc… (can still point them out if you see them) but this should otherwise be ready for review. |
packages/tailwindcss-language-server/tests/diagnostics/source-diagnostics.test.js
Outdated
Show resolved
Hide resolved
packages/tailwindcss-language-server/tests/diagnostics/source-diagnostics.test.js
Outdated
Show resolved
Hide resolved
packages/tailwindcss-language-service/src/completions/file-paths.test.ts
Outdated
Show resolved
Hide resolved
packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts
Show resolved
Hide resolved
| } | ||
|
|
||
| if (!anyFolderNeedsLanguageServer(Workspace.workspaceFolders ?? [])) { | ||
| if (!await anyFolderNeedsLanguageServer(Workspace.workspaceFolders ?? [])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know 🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to rework the typescript configs across the whole project to catch these things, turn on strict mode, etc…
…diagnostics.test.js Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
…diagnostics.test.js Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
philipp-spiess
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!
packages/tailwindcss-language-service/src/diagnostics/getInvalidSourceDiagnostics.ts
Outdated
Show resolved
Hide resolved
packages/tailwindcss-language-service/src/util/language-blocks.ts
Outdated
Show resolved
Hide resolved
packages/tailwindcss-language-server/tests/document-links/document-links.test.js
Show resolved
Hide resolved
This is actually valid except for Vite
We still want to diagnose theme functions in the media query list of an import which we do here.
This PR mades a fair number of changes to improve the developer experience in v4. Most of it is related to
@sourceandsource(…)but there are some additional tweaks:@import "…" source(…)does not issue syntax warnings@import "…" theme(…)does not issue syntax warnings@import "…" prefix(…)does not issue syntax warnings@tailwind utilities source(…)isn't diagnosed as invalid@themeoptions@import "…" theme(…)optionssource(…)@source "…"@config,@plugin, and@source@source@import "…" source(…)properly@import "…" theme(…)properly@import "…" prefix(…)properly@tailwind utilities source(…)properlysource(none)explicitlysource("…")@source,@config, and@plugin@source noneis invalid@source noneas invalid (theme-dependent)source(…)is not passed anythingsource(none)is mispelled@tailwind baseor@tailwind components@sourceandsource(…)@tailwind baseis used in a v4 project@tailwind preflightis used in a v4 project@tailwind componentsis used in a v4 project@tailwind screensis used in a v4 project@tailwind variantsis used in a v4 projectI had some stretch goals but I don't think I'll get to them in this PR unless we think they're important enough to hold up the PR:
@sourceglobs@source@import "tailwindcss/tailwind"@import "tailwindcss/tailwind.css"@source "…"stringssource(none)when typingsource(…)