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

vscode: HTML attribute conditionals do not have proper syntax highlighting #533

Closed
alehechka opened this issue Feb 17, 2024 · 3 comments · Fixed by templ-go/templ-vscode#33

Comments

@alehechka
Copy link
Contributor

Overview

I noticed that the conditional attribute statements in HTML elements do not receive proper syntax highlighting as other conditional statements do. When looking at the token inspector in VSCode, it appears that they always receive the normal HTML attribute syntax.

htm-attr-conditionals-broken

Going to work on this myself and will follow up with a link to the PR when it's ready.

@alehechka
Copy link
Contributor Author

Opened a PR: templ-go/templ-vscode#33.

@alehechka
Copy link
Contributor Author

While putting this together, I also quickly tested a switch statement within HTML attributes and it seems that the LSP does not currently support that. Are there any plans to support HTML attribute switch statements? If so, I would be more than happy to add syntax highlighting support for it to the VSCode extension.

@a-h
Copy link
Owner

a-h commented Feb 18, 2024

There's no current plan for switch statements in attributes. If there's popular support for it, I wouldn't mind adding it though.

Thanks for your work on the syntax highlighting. It looks great.

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 a pull request may close this issue.

2 participants