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

fix: properly highlight svelte 5 <component.dot.notation /> #2552

Conversation

nielk
Copy link
Contributor

@nielk nielk commented Oct 31, 2024

Hi, there,

Regarding this issue, I made this Pull Request to correct the lack of support for component names with dots notation in VSCode Svelte syntax.

(as the Svelte 5 doc says, A capitalized tag or a tag that uses dot notation, such as <Widget> or <my.stuff>, indicates a component.).

Any ideas to make the regex simpler are welcome.

before:

Capture d’écran 2024-10-31 à 07 22 30

after:

Capture d’écran 2024-10-31 à 17 47 08

# Svelte (`svelte:<type>`) elements.
- match: '(svelte)(:)([a-z][\w0-9:-]*)'
# Svelte built-in elements (e.g., svelte:self, svelte:component).
- match: '(svelte)(:)([a-z][\w:-]*)'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[\w:-] is equivalent to [\w0-9:-] because \w already include 0-9

@nielk nielk marked this pull request as draft October 31, 2024 10:05
@nielk nielk marked this pull request as ready for review October 31, 2024 16:46
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@dummdidumm dummdidumm merged commit 8e7d7ef into sveltejs:master Oct 31, 2024
3 checks passed
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