Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/lowercase-style-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro-vscode': patch
---

Fix syntax highlighting for lowercase component tags that start with "style" or "script".
18 changes: 6 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ Note: Edits to source files take effect after rebuilding the package via `pnpm b

# Running Tests

- Run `pnpm test` in workspace root or package directory to run full test suite (can be slow!)
- Integration tests live in special `packages/integrations` folders.
- Example: `pnpm -C <package-directory> astro-scripts test` - Run a single package test suite
- Example: `pnpm -C <package-directory> astro-scripts test "test/actions.test.js"` - Run a single test file
- Example: `pnpm -C <package-directory> astro-scripts test "test/**/*.test.js" --match "CSS"` - Run specific tests matching a string or regex patterns
- Example: `pnpm -C <package-directory> astro-scripts test "test/{actions,css,middleware}.test.js"` - Run multiple test files
- Key flags:
- `--match` / `-m`: Filter tests by name pattern (regex)
- `--only` / `-o`: Run only tests marked with `.only`
- `--parallel` / `-p`: Run tests in parallel (default is sequential)
- `--timeout` / `-t`: Set timeout in milliseconds
- `--watch` / `-w`: Watch mode
- Run `pnpm test` in the workspace root to run the full suite (slow).
- Run `pnpm -C <package-directory> test` to run a package’s tests (example: `pnpm -C packages/astro test`, `pnpm -C packages/integrations/react test`).
- Run an individual test file with `node path/to/test.js` (non-E2E).
- For focused Astro package runs: `pnpm -C packages/astro test:unit`, `pnpm -C packages/astro test:integration`, `pnpm -C packages/astro test:cli`, `pnpm -C packages/astro test:types`.
- For matching a subset by test name in Astro: `pnpm -C packages/astro test:match -- "<pattern>"`.
- For E2E: `pnpm test:e2e` or `pnpm test:e2e:match -- "<pattern>"`.

# Astro Quick Reference

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
]
},
"tags-lang": {
"begin": "<(script|style)",
"begin": "<(script|style)(?=\\s|/?>)",
"end": "</\\1\\s*>|/>",
"beginCaptures": {
"0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ repository:

# Language tags - they are handled differently for the purposes of language injection.
tags-lang:
begin: <(script|style)
begin: <(script|style)(?=\s|/?>)
end: </\1\s*>|/>
beginCaptures: { 0: { patterns: [include: '#tags-start-node'] } }
endCaptures: { 0: { patterns: [include: '#tags-end-node'] } }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
const label = "Click Me";
---

<styled.button>{label}</styled.button>
<div>After</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
>---
#^^^ source.astro comment
>const label = "Click Me";
#^^^^^^^^^^^^^^^^^^^^^^^^^^ source.astro meta.embedded.block.astro source.ts
>---
#^^^ source.astro comment
>
><styled.button>{label}</styled.button>
#^ source.astro meta.scope.tag.styled.button.astro meta.tag.start.astro punctuation.definition.tag.begin.astro
# ^^^^^^ source.astro meta.scope.tag.styled.button.astro meta.tag.start.astro entity.name.tag.astro
# ^ source.astro meta.scope.tag.styled.button.astro meta.tag.start.astro
# ^^^^^^ source.astro meta.scope.tag.styled.button.astro meta.tag.start.astro entity.name.tag.astro
# ^ source.astro meta.scope.tag.styled.button.astro meta.tag.start.astro punctuation.definition.tag.end.astro
# ^ source.astro punctuation.section.embedded.begin.astro
# ^^^^^ source.astro meta.embedded.expression.astro source.tsx
# ^ source.astro punctuation.section.embedded.end.astro
# ^^ source.astro meta.scope.tag.styled.button.astro meta.tag.end.astro punctuation.definition.tag.begin.astro
# ^^^^^^ source.astro meta.scope.tag.styled.button.astro meta.tag.end.astro entity.name.tag.astro
# ^ source.astro meta.scope.tag.styled.button.astro meta.tag.end.astro
# ^^^^^^ source.astro meta.scope.tag.styled.button.astro meta.tag.end.astro entity.name.tag.astro
# ^ source.astro meta.scope.tag.styled.button.astro meta.tag.end.astro punctuation.definition.tag.end.astro
><div>After</div>
#^ source.astro meta.scope.tag.div.astro meta.tag.start.astro punctuation.definition.tag.begin.astro
# ^^^ source.astro meta.scope.tag.div.astro meta.tag.start.astro entity.name.tag.astro
# ^ source.astro meta.scope.tag.div.astro meta.tag.start.astro punctuation.definition.tag.end.astro
# ^^^^^ source.astro text.astro
# ^^ source.astro meta.scope.tag.div.astro meta.tag.end.astro punctuation.definition.tag.begin.astro
# ^^^ source.astro meta.scope.tag.div.astro meta.tag.end.astro entity.name.tag.astro
# ^ source.astro meta.scope.tag.div.astro meta.tag.end.astro punctuation.definition.tag.end.astro
>
Loading