Skip to content

Commit b435925

Browse files
committed
Fix errors thrown by detecting content files with oxide (#942)
1 parent d25652b commit b435925

File tree

3 files changed

+190
-3
lines changed

3 files changed

+190
-3
lines changed

package-lock.json

Lines changed: 182 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tailwindcss-language-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@tailwindcss/forms": "0.5.3",
4040
"@tailwindcss/language-service": "*",
4141
"@tailwindcss/line-clamp": "0.4.2",
42+
"@tailwindcss/oxide": "^4.0.0-alpha.11",
4243
"@tailwindcss/typography": "0.5.7",
4344
"@types/color-name": "^1.1.3",
4445
"@types/culori": "^2.1.0",

packages/tailwindcss-language-server/src/project-locator.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,18 @@ async function* detectContentFiles(base: string): AsyncIterable<string> {
455455

456456
// This isn't a v4 project
457457
const oxide = await import(oxidePath)
458-
if (!oxide.scanDir) {
458+
459+
function validateOxide(input: any): input is typeof import('@tailwindcss/oxide') {
460+
return !!oxide.scanDir
461+
}
462+
463+
if (!validateOxide(oxide)) {
459464
return
460465
}
461466

462-
let { files, globs } = await oxide.scanDir({ base, globs: true })
467+
let { files } = oxide.scanDir({ base, globs: true })
463468

464469
yield* files
465-
yield* globs
466470
} catch {
467471
//
468472
}

0 commit comments

Comments
 (0)