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
On 22 Sep 2015, at 14:53, Per Persson wrote:
[…] 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.
Currently the custom scope attributes (set via .tm_properties) are ignored for the purpose of injection.
This is because the grammar parsing is on a much lower level than the management of the .tm_properties read from disk, but it’s something I would very much like to see improved, so that one can rely on custom scope attributes for injection purposes.
OK, I see. Thanks for the information.
/Per
30 sep. 2015 kl. 05:40 skrev Allan Odgaard mailinglist@textmate.org:
On 22 Sep 2015, at 14:53, Per Persson wrote:
[…] 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.
Currently the custom scope attributes (set via .tm_properties) are ignored for the purpose of injection.
This is because the grammar parsing is on a much lower level than the management of the .tm_properties read from disk, but it’s something I would very much like to see improved, so that one can rely on custom scope attributes for injection purposes.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate