On Dec 9, 2007, at 3:00 AM, Thomas Aylott - subtleGradient wrote:
CSS doesn't have a monopoly on CSS Selectors.
They're also used in almost all Javascript libraries.
They can get rather complex and it's certainly something that needs
to be DRY.
CSS Rules aren't unique to CSS either,
they're also used in various versions of HTML in the style attribute.
They are also used in a number of Ruby libraries for generating CSS.
I can relate to the fact that duplication is a bad thing, it's been
done very poorly in various HTML related bundles. However something
like CSS selectors isn't really a moving target, I think we can work
out a solid grammar for them and not have it change much. What I'd
recommend is a repository item that can be duplicated as needed, and
since it's a single 'item' it can be kept updated easily.
It's not a clean solution no, but I think we should attempt to hide
the imperfections from everyday use as much as possible. Keeping it
inside the grammars makes it only visible to the much smaller
percentage that try and change/extend the grammars.
As for the reasoning that having multiple "languages" in the list is
confusing to people, simply enable the option to hide languages as
you can currently do with all other bundle items. Most people don;t
bother selecting a language since the right thing is used when
embedded and is auto-matched to the filetype when opening files.
Might be nice but until that's possible it's a reason against, not
for. ;)
The alternative is to duplicate all the rules and selectors stuff in
all HTML langes, CSS, All Javascript Libraries, etc...
For the selectors I recommend the single repository item idea above,
for the rules I think it would be possible to have a top-level rule
that can tell we are in a css attribute and activate the rules
repository item. Should work for most cases.
_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev