I added support for fenced code blocks to the Markdown bundle as described in https://github.com/textmate/markdown.tmbundle/issues/15#issuecomment-1832196...
Then I added “meta.embedded_ruby” to the as injection scope selector to the Ruby grammar.
The result kind of works, but somehow the rule priority seems to get mixed up (see screenshot).
Any ideas how to fix this?
Thanks, Stefan.
Anybody?
Or maybe is there an other, better way to implement fenced code blocks in the Markdown bundle?
Thanks, Stefan
Am 09.07.15 um 13:30 schrieb Stefan Daschek:
I added support for fenced code blocks to the Markdown bundle as described in https://github.com/textmate/markdown.tmbundle/issues/15#issuecomment-1832196...
Then I added “meta.embedded_ruby” to the as injection scope selector to the Ruby grammar.
The result kind of works, but somehow the rule priority seems to get mixed up (see screenshot).
Any ideas how to fix this?
Thanks, Stefan.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 9 Jul 2015, at 13:30, Stefan Daschek wrote:
I added support for fenced code blocks to the Markdown bundle as described in https://github.com/textmate/markdown.tmbundle/issues/15#issuecomment-1832196...
Then I added “meta.embedded_ruby” to the as injection scope selector to the Ruby grammar.
The result kind of works, but somehow the rule priority seems to get mixed up (see screenshot).
Any ideas how to fix this?
The problem is that the ruby grammar is injected into your scope, this means that whenever the ruby grammar opens a new scope, the entire ruby grammar will also be injected into that scope, since the scope selector used for the injection still match.
I think you can inject into `meta.embedded_ruby $` and it will only inject into the root of this sub-scope (due to the `$`) — during injection, the attribute scopes are currently ignored, which is why the tail anchor works.
Am 07.09.15 um 21:59 schrieb Allan Odgaard:
On 9 Jul 2015, at 13:30, Stefan Daschek wrote:
I added support for fenced code blocks to the Markdown bundle as described in https://github.com/textmate/markdown.tmbundle/issues/15#issuecomment-1832196...
Then I added “meta.embedded_ruby” to the as injection scope selector to the Ruby grammar.
The result kind of works, but somehow the rule priority seems to get mixed up (see screenshot).
Any ideas how to fix this?
The problem is that the ruby grammar is injected into your scope, this means that whenever the ruby grammar opens a new scope, the entire ruby grammar will also be injected into that scope, since the scope selector used for the injection still match.
I think you can inject into `meta.embedded_ruby $` and it will only inject into the root of this sub-scope (due to the `$`) — during injection, the attribute scopes are currently ignored, which is why the tail anchor works.
Using `meta.embedded_ruby $` as injection grammar seems to work perfectly, thanks!
Would you accept a pull request for the markdown bundle to support fenced code blocks with embedded grammars?
The problem I see is that it would need to be accompanied by changes to other bundles (e.g. adding `meta.embedded_ruby $` as injection selector in the Ruby bundle, …).
Stefan.
Am 11.09.15 um 15:46 schrieb Stefan Daschek:
Would you accept a pull request for the markdown bundle to support fenced code blocks with embedded grammars?
The problem I see is that it would need to be accompanied by changes to other bundles (e.g. adding `meta.embedded_ruby $` as injection selector in the Ruby bundle, …).
Any news on this? (Maybe any standard emerging for those kind of embedded language scopes, so that they don't have to be added manually to all the bundles? :-)
Stefan
On 12 Oct 2015, at 18:04, Stefan Daschek wrote:
Am 11.09.15 um 15:46 schrieb Stefan Daschek:
Would you accept a pull request for the markdown bundle to support fenced code blocks with embedded grammars?
The problem I see is that it would need to be accompanied by changes to other bundles (e.g. adding `meta.embedded_ruby $` as injection selector in the Ruby bundle, …).
Any news on this? (Maybe any standard emerging for those kind of embedded language scopes, so that they don't have to be added manually to all the bundles? :-)
Sorry for the lack of response, it is indeed because we would like to have a standard for this.
Maybe just submit the PR for the markdown bundle, and we can do the discussion about scope naming conventions there (using your PR as basis/proposal).