For instance, the entirety of a function (from def
to end
) might be enclosed in a meta.function
scope, and likewise for scopes like meta.class
, meta.if
, and so on. As long as every construct that uses end
were scoped that way, you could target an end
that terminates a function with the selector meta.function keyword.control.end
.
The only problem is #2152. Due to a bug in the selector scoring function, the wrong selector will win if the meta scopes are nested in certain ways. This bug was actually discovered because @borela was trying to do something similar with a color scheme. If this bug is fixed, the above technique would work right away in JavaScript and other languages that provide detailed meta scopes, and other languages like Ruby could offer them as well.