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

Grammar attempts to include non-existant 'source.regexp.python.renpy' scope #16

Open
2 tasks
lildude opened this issue Jun 4, 2019 · 3 comments
Open
2 tasks

Comments

@lildude
Copy link

lildude commented Jun 4, 2019

👋 I'm the primary GitHub maintainer for Linguist which is used for syntax highlighting on GitHub.com.

As part of this syntax highlighting, Linguist and thus GitHub.com, uses this grammar for highlighting Ren'Py files.

Our grammar validator has detected an error with this grammar:

  • repository vendor/grammars/language-renpy (from https://github.com/williamd1k0/language-renpy.git) (1 errors)
    • Missing include in grammar: source.renpy (in grammars/renpy.cson) attempts to include source.regexp.python.renpy but the scope cannot be found

This is caused by:

'regular_expressions':
'comment': 'Changed disabled to 1 to turn off syntax highlighting in “r” strings.'
'disabled': 0
'patterns': [
{
'include': 'source.regexp.python.renpy'
}
]

This section needs to be redefined, removed or the scope added to the grammar.

@williamd1k0
Copy link
Member

Sorry for the delay.
This was introduced in 9ac1da3

@lildude Does changing it to source.regexp.python solve the problem?
Or I need to include a copy of regular expressions (python).cson from atom/language-python?

@lildude
Copy link
Author

lildude commented Aug 7, 2019

Does changing it to source.regexp.python solve the problem?

Yes as Linguist will include the file from the Python grammar that we ship.

Or I need to include a copy of regular expressions (python).cson from atom/language-python?

This would also work, but you'd need to change the scope within it to match source.regexp.python.renpy at https://github.com/atom/language-python/blob/master/grammars/regular%20expressions%20(python).cson#L2

Of the two, I'd recommend the former. That way you don't need to keep maintaining a copy and Renpy will continue to gain from the enhancements to that grammar as it evolves within the upstream grammar. I'd only recommend the latter if you plan to implement renpy-specific changes to it.

@williamd1k0
Copy link
Member

Does changing it to source.regexp.python solve the problem?

Yes as Linguist will include the file from the Python grammar that we ship.

I believe Ren'Py won't need an alternative regex scope, so I just renamed it to source.regexp.python in c5c1777.

Thanks for helping! 👋

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

No branches or pull requests

2 participants