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: multi-line import expression syntax highlighting #16

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

ccitro
Copy link
Contributor

@ccitro ccitro commented Oct 31, 2023

Changes Made

  • Updated the begin regular expression in import-expression by removing the end-of-line anchor ($). This allows the expression to match the opening { even if it's not on the same line as the @ symbol.
  • Updated the end regular expression in import-expression by removing the start-of-line anchor (^), whitespace matcher (\\s*), and the end-of-line anchor ($). This modification allows the expression to match the closing } regardless of its position on the line.

Testing

The fix has been tested with various single-line and multi-line import expressions to ensure syntax highlighting doesn't break later in the file. I might not be familiar with all use cases, so I'd recommend checking any expected patterns.

Copy link
Collaborator

@a-h a-h left a comment

Choose a reason for hiding this comment

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

Thanks for this, and sorry for the delay in reviewing and merging.

@a-h
Copy link
Collaborator

a-h commented Nov 14, 2023

I've tested it, looks good!

@a-h a-h merged commit 64226db into templ-go:main Nov 14, 2023
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