Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Allow including repository patterns from other grammars - #53

Merged
kevinsawicki merged 2 commits into
atom:masterfrom
hansonw:master
Aug 11, 2015
Merged

kevinsawicki merged 2 commits into
atom:masterfrom
hansonw:master

Conversation

@hansonw

@hansonw hansonw commented Jul 29, 2015

Copy link
Copy Markdown
Contributor

TextMate 2 supports the "grammarB#rule" syntax for including a pattern from grammarB's "repository" section. (e.g. https://github.com/textmate/bundle-development.tmbundle/blob/master/Syntaxes/Language%20Grammar.tmLanguage#L1631)

This adds similar functionality to first-mate.

@hansonw

hansonw commented Jul 31, 2015

Copy link
Copy Markdown
Contributor Author

cc @nathansobo, @kevinsawicki (forgive me if I got the wrong people :P)

Would you guys be OK with this? This makes it a lot easier to share features between complex grammars.

@kevinsawicki

Copy link
Copy Markdown
Contributor

Would you guys be OK with this? This makes it a lot easier to share features between complex grammars.

Yeah, this is pretty cool, and if TextMate supports it then it should be supported here.

Thanks for opening this up, I think we'll be able to review this next week.

Comment thread src/pattern.coffee Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it might be good to still call this line with the root scope name (the text before the #). This allows the tokenizer to re-run when a dependent grammar is loaded since grammars are loaded asynchronously.

@hansonw

hansonw commented Aug 6, 2015

Copy link
Copy Markdown
Contributor Author

Good point. Added a call to addIncludedGrammarScope with the referenced grammar.

@hansonw

hansonw commented Aug 11, 2015

Copy link
Copy Markdown
Contributor Author

@kevinsawicki any other comments? :)

kevinsawicki added a commit that referenced this pull request Aug 11, 2015
Allow including repository patterns from other grammars
@kevinsawicki
kevinsawicki merged commit 6ec49ea into atom:master Aug 11, 2015
@kevinsawicki

Copy link
Copy Markdown
Contributor

Nope, looks good, thanks for adding this.

@kevinsawicki

Copy link
Copy Markdown
Contributor

Published in 4.2.0, this will be included in the next release of Atom, 1.0.6

@nathansobo

Copy link
Copy Markdown
Contributor

🎆

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants