This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
Support contentRegex for TextMate grammar #18499
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements for Adding, Changing, or Removing a Feature
Issue or RFC Endorsed by Atom's Maintainers
atom/first-mate#109
Description of the Change
NOTE: Requires update on
first-mate
dependency to make thecontentRegex
property be picked up in the first place.Adds support for the
contentRegex
property existing on TextMate grammars. Treats it as an Oniguruma regex, so that the TextMate grammar is consistent with itself.Alternate Designs
Could make the
contentRegex
a regular JS regex, but then it would be the only regex like that for a TextMate grammar.Possible Drawbacks
Currently it looks at the whole file, which is potentially dangerous for performace. The use case in the linked issue would be fine with 20 lines or less. Declaring how many lines it wants would require more design choices though.
Verification Process
Manually
Release Notes
contentRegex
on TextMate grammars