[TxMt] Custom scopeAttributes and injection selectors

Per Persson persquare at mac.com
Tue Sep 22 07:53:52 UTC 2015


Hi,

I'm trying to inject a custom grammar to syntax highlight test scripts inlined in python single quoted block strings (i.e.. ''' <script here>''').
This works well:

    grammar : source.calvin.embedded
    injection selector : string.quoted.single.block.python
    definition : { patterns = ( { include = 'source.calvin'; } ); }

but when I add a scopeAttribute in .tm_properties

    [ tests/*.py ]
    scopeAttributes = 'attr.test.calvin'

in order to prevent the injection from happening everywhere it no longer works.

I was under the impression that the injection selector

    string.quoted.single.block.python attr.test.calvin

should do just that, but nothing seems to work (no syntax highlighting).
I've tried adding '&', grouping in () etc. but no luck.

Could anyone share some insight into this?

/Per
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20150922/e90f493f/attachment.html>


More information about the textmate mailing list