On 6/4/2006, at 22:35, Daniel Käsmayr wrote:
- extract a listing of scopes from a bundle
I got a little carried away. Attached below is a Theme Builder bundle, it has one command which generates and switches to a random theme which will target all scopes of the current language (including languages which may be embedded in that).
[...] “if your theme does NOT know about meta.scope.obscure then please have it handled like meta.scope.common, as these are related or at least the style markup would indicate a similar importance.”
This is why the scopes are hierarchical.
So in this case, one would use meta.scope.common.obscure -- a theme can then target this specifically, or it can settle with styling meta.scope.common, and obscure will then get that setting.
An actual example of this is how URLs are scoped as markup.underline.link. So if the theme has no setting for that, it will just be underlined (assuming that there is a style for markup.underline).
Ideally a theme should only need to style the following scopes: comment, constant, entity, keyword, storage, string, support, and variable.
This is why I am actually against things like “extract all current scopes” (despite the attached bundle), because 90% of the time, the language should rather be “fixed” (in its use of scope names) rather than have the theme specifically address a given language.
It is however hard to try and find a common naming scheme when we support almost 100 languages, varying from markup, to procedural, to OO, to functional, to even things like emails.