Skip to content

Handle postcss throwing when parsing more complex files #1043

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

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions packages/tailwindcss-language-server/src/project-locator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,17 +615,21 @@ class FileEntry {
}

async resolveSourceDirectives() {
if (this.sources.length > 0) {
return
}
try {
if (this.sources.length > 0) {
return
}

// Note: This should eventually use the DesignSystem to extract the same
// sources also discovered by tailwind. Since we don't have everything yet
// to initialize the design system though, we set up a simple postcss at
// rule exporter instead for now.
await postcss([extractSourceDirectives(this.sources)]).process(this.content, {
from: this.realpath,
})
// Note: This should eventually use the DesignSystem to extract the same
// sources also discovered by tailwind. Since we don't have everything yet
// to initialize the design system though, we set up a simple postcss at
// rule exporter instead for now.
await postcss([extractSourceDirectives(this.sources)]).process(this.content, {
from: this.realpath,
})
} catch (err) {
//
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-tailwindcss/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerelease

- Nothing yet!
- Fix an issue that caused the language server for any project with a non-standard CSS file to crash ([#1030](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1030))

## 0.12.7

Expand Down