vscode-textmate icon indicating copy to clipboard operation
vscode-textmate copied to clipboard

TextMate scope selectors: child combinator is not implemented

Open graceful-potato opened this issue 6 years ago • 6 comments

Selectors such as "scope1 > scope2" aren't working.

Expected behavior: it should select all scope2 elements that are the direct children of scope1

graceful-potato avatar Jan 31 '20 19:01 graceful-potato

It isn't mentioned explicitly, but I imagine it was intentionally left out in the same way the negation operator was. Which is a shame since both of them can be really useful.

There is a third kind of selector, one that involves excluding scopes, which we'll not discuss here. We didn't add support for this kind and we've noticed it is rarely used in the wild.

from https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations#_parent-selectors

jeff-hykin avatar Feb 01 '20 16:02 jeff-hykin

@jeff-hykin AFAIK > did not exist when we first wrote vscode-textmate. I cannot find any mention of it at https://macromates.com/manual/en/scope_selectors

However, with TextMate 2.0, it appears that they appear in the scope selector grammar at https://macromates.com/textmate/manual/references#scope-selector

alexdima avatar Feb 03 '20 12:02 alexdima

@alexdima To be honest i found out about this selector quite recently, but the changelog says it was introduced in 2012.

graceful-potato avatar Feb 03 '20 14:02 graceful-potato

I'd sure make use of it if it was documented and supported. Besides the changelog, there's really no documentation about it.

DerekZiemba avatar May 13 '20 03:05 DerekZiemba

Atom's first-mate helpers don't support it. Seeing as this module is more closely linked to Atom than Textmate, it will most likely remain on the backburner. There is an upstream issue at atom/first-mate#123 (opened by yours truly 😄)

ghost avatar Dec 30 '21 22:12 ghost