Handle subscopes differently/better?
See original GitHub issueJust saw that you’re flattening scopes… why not preserve them?
IE: title.function becomes just “title” and “function” separately, which isn’t really the same thing at all.
It seems like you’re purposely losing data… and I’m not sure the benefit since you don’t have to care about CSS or anything…
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
6.0版本下Mac进行docker-compose报错了 - Thinkcmf/Thinkcmf
Handle subscopes differently/better ? 14, 2022-03-12 ; A Sustainable Approach to Developing Software in Well Understood Domains, 8, 2021-10-04 ; Resolve ...
Read more >lowlight from wooorm - Giter VIP
Handle subscopes differently/better ? Just saw that you're flattening scopes... why not preserve them? IE: title.function becomes just "title" and "function" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Since 3rd party grammars can technically use whatever scope names they desire it seems more than theoretical and I didn’t want a disclaimer explaining that you can’t have both
a.b.candc.b.awithout things breaking badly. We also already have real conflicts with 3rd party themes (or custom themes) that use the old stylefunctionandclassscopes vs the newertitle.functionandtitle.class… these are not always even semantically the same things.Sometimes
classandfunctionwere used to refer to the entire class definition or entire function body… applying theclassscope coloring totitle.classwould be entirely incorrect in those cases. Hence needing a way to differentiate top-levelclassfrom the more nuanced (and potentially entirely different semantic)title.class.This is also partly related to semantic versioning and my desiring to solve this problem completely the first time rather than find out in the middle of the v11 cycle that there are cases where it breaks badly and then needing a breaking change to fix things properly. As you know it’s also fairly simple for someone to hack into the parser if they TRULY need a simpler output and are confident that the CSS scope overlapping problem is one they are -guaranteed- to be safe from.
That said, I haven’t heard from anyone having any real issues with this system at all since it’s release. 😃
As I think I mentioned not a great example… sub-scopes are meant to be hierarchal (exactly like TextMate scopes) and hence in the abstract
a.b.cis NOT at all the same scope (at all) asc.b.a- and possibly should be highlighted entirely differently… so the system was designed to correctly preserve this hierarchal nature even down into the CSS layer.No one’s reported any real issues with the approach yet, other than that it’s perhaps a bit unfamiliar looking. 😃
Glad you got it fixed though!