Skip to content

Conversation

daivinhtran
Copy link
Contributor

@daivinhtran daivinhtran commented Sep 23, 2025

By default, it highlights code snippets as JavaScript. When language css is declared at the first line, it highlights the top-level code snippet as CSS.

There's a still a limitation for highlighting CSS code snippets as documented in injections.scm. I'll explore and propose changes to tree-sitter and tree-sitter-gritql to support all the scenarios.

The PR is implemented using guidance from https://zed.dev/docs/extensions/languages#code-injections.

Demos

Without code injection Screenshot 2025-09-23 at 10 06 54 PM
With code injection Screenshot 2025-09-23 at 10 01 41 PM

@ematipico ematipico merged commit 3ca1d77 into biomejs:main Sep 24, 2025
4 checks passed
@daivinhtran daivinhtran deleted the add-code-injection branch September 24, 2025 15:06
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