sveltejs / sveltejs/language-tools
Each blocks without `as` clause highlight incorrectly
Open
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 252
- Avg merge
- 8d 13h
- Merged PRs (30d)
- 2
Description
Describe the bug
It's now possible to omit the as blah clause from an each block, but it results in incorrect highlighting
Reproduction
{#each x as _}-{/each}
{#each x as}-{/each}
Expected behaviour
The syntax highlighting should be the same in both cases (I guess it's noteworthy that GitHub syntax highlighting exhibits the same bug)
System Info
latest
Which package is the issue about?
No response
Additional Information, eg. Screenshots
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the highlighting difference with the two Svelte snippets in the issue. Trace the syntax-highlighting handling for each blocks, then verify that {#each x as _}-{/each} and {#each x as}-{/each} receive the same highlighting when the fix is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100