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

Textmate: fix Razor expression classification inside of HTML tags using injection #7055

Merged
merged 8 commits into from Apr 18, 2024

Conversation

jordi1215
Copy link
Member

@jordi1215 jordi1215 commented Apr 17, 2024

This fixes some problem created in #7051. In this new approach, we use the "injection" feature of the textmate grammar so that we don't have to change the grammar of html.

jordi1215 and others added 6 commits April 15, 2024 13:37
- added textmate grammar to both razor and html (test) files so that we can correctly label razor components that are within html tags. We will need to update the html grammar used in razor as well
- updated tests to reflect the desire behavior, note that we changed some of the classification from existing tests as they were not correctly labeling razor grammar in html tags either
- added textmate grammar to both razor and html (test) files so that we can correctly label razor components that are within html tags. We will need to update the html grammar used in razor as well
- updated tests to reflect the desire behavior, note that we changed some of the classification from existing tests as they were not correctly labeling razor grammar in html tags either
we updated the a textmate grammar clause name in razor to be more specific
- this commit explores a new way of injecting razor textmate grammar into the html textmate grammar. so that razor expressions can still be recognized inside html tags without having to directly change any of the html textmate
- we also updated some grammar tests to make the test cases more comprehensive regarding this matter
@jordi1215 jordi1215 requested review from a team as code owners April 17, 2024 21:00
@jordi1215 jordi1215 marked this pull request as draft April 17, 2024 21:02
- revert the changes made to html.tmlanguage.json so that it matches the one on the textmate repo
Copy link
Contributor

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

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

Amazing!

- removed a clause in the razor textmate that is not needed anymore
@jordi1215 jordi1215 marked this pull request as ready for review April 18, 2024 18:07
@jordi1215 jordi1215 merged commit 7aff247 into main Apr 18, 2024
13 checks passed
@jordi1215 jordi1215 deleted the dev/jordi1215/fix-html-textmate branch April 18, 2024 18:10
@GlacierFox
Copy link

Noticed a changed when writing code in Blazor and just popping in to say awesome job, works great 👍

@davidwengier
Copy link
Contributor

Thanks for confirming, and the kind words @GlacierFox

FYI @jordi1215 😄

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.

None yet

3 participants