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

Use correct scope for Razor-plus grammar #4322

Merged
merged 1 commit into from Nov 12, 2018
Merged

Conversation

lildude
Copy link
Member

@lildude lildude commented Nov 12, 2018

Description

Whilst generating and testing the upcoming v7.1.0 release I noticed that the cshtml/razor change in #4314 introduced the wrong scope for the grammar and this is picked up by the grammar compiler:

- [ ] repository `vendor/grammars/razor-plus` (from https://github.com/austincummings/razor-plus) (2 errors)
    - [ ] Unexpected scope in repository: `text.html.cshtml` declared in `text.html.cshtml` (in `syntaxes/cshtml.tmLanguage.json`) was not listed in grammars.yml
    - [ ] Missing scope in repository: `text.html.razor` is listed in grammars.yml but cannot be found

The correct scope is text.html.cshtml as the error reports and can be confirmed by checking the grammar itself. This PR corrects the scope as using the wrong scope results in no syntax highlighting at all.

This would have been picked up by the script/add-grammar script that should have been used to replace the grammar. I suspect it wasn't, hence this slipped through.

Checklist:

  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.

A quick review on this would be ✨ so I can get the release back into testing today.

/cc @worldbeater FYI as the author of #4314

@Alhadis
Copy link
Collaborator

Alhadis commented Nov 12, 2018

We should really have a test which catches this...

@lildude
Copy link
Member Author

lildude commented Nov 12, 2018

We should really have a test which catches this...

Yeah, though we really need to address all of the outstanding issues in #3924 first, or maybe whitelist those outstanding grammars in the mean time.

@lildude lildude merged commit 3b57cea into master Nov 12, 2018
@lildude lildude deleted the lildude/fix-razor-scope branch November 12, 2018 10:21
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

2 participants