-
Notifications
You must be signed in to change notification settings - Fork 57
Conversation
@maxbrunsfeld Would you take a look here since you're the expert on the |
With Tree-sitter grammars, the |
@maxbrunsfeld Would it work if Atom pulled it out directly, and either stored it or added it to the constructed grammar? |
I'm not sure that this is going to translate correctly. Perhaps we should hold off on this for now? |
@maxbrunsfeld Would you state what changes are necessary here? |
Options I see:
|
@maxbrunsfeld I submitted a PR to Atom that will handle it as an Oniguruma regex. At first I was happily surprised it had a method named As noted there, it depends on this PR to add the |
@Aerijo @maxbrunsfeld Any thing preventing this from being merged? |
@ashthespy Don't think so, besides making sure the changes are coordinated and the tests pass on the other PR. |
Thanks very much! |
Published as |
Tree-sitter grammars appear to have a new property
contentRegex
. Support for this is already in Atom, all that's required for TextMate to benefit from it is to add in when constructing the grammar.In particular, this will help differentiate similar grammars such as LaTeX & LaTeX Beamer. In this case, both share the same file extension, and both can potentially not match the first line regex. It is difficult / impossible to influence the score in a way that works in all cases.
With the change, the solution is just add
contentRegex
to Beamer. If it matches, it gets a edge over LaTeX. If it fails, it gets a penalty and LaTeX consistently gets applied.Alternatively, Atom could be changed to give a penalty when the
firstLineMatch
fails, but this may have unwanted consequences.