Skip to content
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

Syntax highlighting for Component vs element tags in .svelte files #17310

Closed
1 task
AlbertMarashi opened this issue Sep 3, 2024 · 0 comments · Fixed by #17404 or #17529
Closed
1 task

Syntax highlighting for Component vs element tags in .svelte files #17310

AlbertMarashi opened this issue Sep 3, 2024 · 0 comments · Fixed by #17404 or #17529
Labels
enhancement [core label] svelte Svelte framework support

Comments

@AlbertMarashi
Copy link
Contributor

Check for existing issues

  • Completed

Describe the feature

.tsx files have support for distinguishing component syntax nodes from HTML elements

image

I would like this same sort of support for Svelte files

image

Currently, they are both styled the same way

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@AlbertMarashi AlbertMarashi added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Sep 3, 2024
@AlbertMarashi AlbertMarashi changed the title Syntax highlighting for Svelte Components Syntax highlighting for **component** vs **element** in .svelte files Sep 3, 2024
@AlbertMarashi AlbertMarashi changed the title Syntax highlighting for **component** vs **element** in .svelte files Syntax highlighting for Component vs element tags in .svelte files Sep 3, 2024
AlbertMarashi added a commit to AlbertMarashi/zed that referenced this issue Sep 5, 2024
maxdeviant pushed a commit that referenced this issue Sep 5, 2024
Closes: #17310

This PR #17364 broke my svelte
code, downgrading to the previous commit SHA
`b08d070e303d2a385d6d0ab3add500f8fa514443` fixes the issue.

Until the following issue is resolved, the commit SHA should not be
updated

- tree-sitter-svelte issue I filed:
Himujjal/tree-sitter-svelte#61

Release Notes:

- N/A
@notpeter notpeter added svelte Svelte framework support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Sep 5, 2024
maxdeviant added a commit that referenced this issue Sep 17, 2024
> [!NOTE]
> The https://github.com/tree-sitter-grammars/tree-sitter-svelte
repository seems to be more well maintained, with higher quality code,
and as per zed-extensions/svelte#1 it was
suggested that we swap to this repository for Svelte grammars

- Closes #17310
- Closes #10893
- Closes #12833
- Closes zed-extensions/svelte#1
- Closes #14943
- Closes zed-extensions/svelte#2

- Added: buffer/file symbol outlines for `.svelte` (`outlines.scm`)
- Improved: Attribute directives & modifiers in `.svelte` files can be
styled independently.
- Fixed: issue where svelte expression inside quotes failed parsing
- Improved: Svelte components in Markup are styled differently from
tags.
- Added: Support for Svelte 5 syntax (`{#snippet children()}`, `{@render
foo()`)
- Change: Svelte now using
[tree-sitter-grammars/tree-sitter-svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte)
for language highlighting
- Added: Support for typescript syntax in svelte expressions


![image](https://github.com/user-attachments/assets/49d199ee-7550-49a7-912d-070cf691b029)

![image](https://github.com/user-attachments/assets/848ac5b6-62da-4c42-8e24-b7023504f8af)

Release Notes:

- N/A

---

**tree-sitter-grammar things to improve**
- [ ] snippet functions aren't being treated as JS code
- [ ] we should be able to detect @component comments and treat them as
markdown
- [x] `foo:bar` style/class/prop directives
- [x] `--foo="..."` var fields
- [ ] snippet/if blocks's children may need to be indented a little
further

Will implement some of the rest of these in a separate PR

---------

Co-authored-by: Marshall Bowers <[email protected]>
maxdeviant pushed a commit to zed-extensions/svelte that referenced this issue Oct 18, 2024
Closes: zed-industries/zed#17310

This PR zed-industries/zed#17364 broke my svelte
code, downgrading to the previous commit SHA
`b08d070e303d2a385d6d0ab3add500f8fa514443` fixes the issue.

Until the following issue is resolved, the commit SHA should not be
updated

- tree-sitter-svelte issue I filed:
Himujjal/tree-sitter-svelte#61

Release Notes:

- N/A
maxdeviant added a commit to zed-extensions/svelte that referenced this issue Oct 18, 2024
…zed#17529)

> [!NOTE]
> The https://github.com/tree-sitter-grammars/tree-sitter-svelte
repository seems to be more well maintained, with higher quality code,
and as per #1 it was
suggested that we swap to this repository for Svelte grammars

- Closes zed-industries/zed#17310
- Closes zed-industries/zed#10893
- Closes zed-industries/zed#12833
- Closes #1
- Closes zed-industries/zed#14943
- Closes #2

- Added: buffer/file symbol outlines for `.svelte` (`outlines.scm`)
- Improved: Attribute directives & modifiers in `.svelte` files can be
styled independently.
- Fixed: issue where svelte expression inside quotes failed parsing
- Improved: Svelte components in Markup are styled differently from
tags.
- Added: Support for Svelte 5 syntax (`{#snippet children()}`, `{@render
foo()`)
- Change: Svelte now using
[tree-sitter-grammars/tree-sitter-svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte)
for language highlighting
- Added: Support for typescript syntax in svelte expressions


![image](https://github.com/user-attachments/assets/49d199ee-7550-49a7-912d-070cf691b029)

![image](https://github.com/user-attachments/assets/848ac5b6-62da-4c42-8e24-b7023504f8af)

Release Notes:

- N/A

---

**tree-sitter-grammar things to improve**
- [ ] snippet functions aren't being treated as JS code
- [ ] we should be able to detect @component comments and treat them as
markdown
- [x] `foo:bar` style/class/prop directives
- [x] `--foo="..."` var fields
- [ ] snippet/if blocks's children may need to be indented a little
further

Will implement some of the rest of these in a separate PR

---------

Co-authored-by: Marshall Bowers <[email protected]>
noaccOS pushed a commit to noaccOS/zed that referenced this issue Oct 19, 2024
…ustries#17529)

> [!NOTE]
> The https://github.com/tree-sitter-grammars/tree-sitter-svelte
repository seems to be more well maintained, with higher quality code,
and as per zed-extensions/svelte#1 it was
suggested that we swap to this repository for Svelte grammars

- Closes zed-industries#17310
- Closes zed-industries#10893
- Closes zed-industries#12833
- Closes zed-extensions/svelte#1
- Closes zed-industries#14943
- Closes zed-extensions/svelte#2

- Added: buffer/file symbol outlines for `.svelte` (`outlines.scm`)
- Improved: Attribute directives & modifiers in `.svelte` files can be
styled independently.
- Fixed: issue where svelte expression inside quotes failed parsing
- Improved: Svelte components in Markup are styled differently from
tags.
- Added: Support for Svelte 5 syntax (`{#snippet children()}`, `{@render
foo()`)
- Change: Svelte now using
[tree-sitter-grammars/tree-sitter-svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte)
for language highlighting
- Added: Support for typescript syntax in svelte expressions


![image](https://github.com/user-attachments/assets/49d199ee-7550-49a7-912d-070cf691b029)

![image](https://github.com/user-attachments/assets/848ac5b6-62da-4c42-8e24-b7023504f8af)

Release Notes:

- N/A

---

**tree-sitter-grammar things to improve**
- [ ] snippet functions aren't being treated as JS code
- [ ] we should be able to detect @component comments and treat them as
markdown
- [x] `foo:bar` style/class/prop directives
- [x] `--foo="..."` var fields
- [ ] snippet/if blocks's children may need to be indented a little
further

Will implement some of the rest of these in a separate PR

---------

Co-authored-by: Marshall Bowers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] svelte Svelte framework support
Projects
None yet
2 participants