[SVN] Scope name
Allan Odgaard
allan at macromates.com
Sat Apr 16 07:00:40 UTC 2005
Currently all syntax files have a root level name which is really a
display name (e.g. “HTML (Basic)”).
I have introduced a new key named 'scopeName' which gives the syntax a
name that fits the new scope system better. For now it should be either
text.<language> (e.g. “text.html”) or source.<language> (e.g.
“source.objc”). Basically everything that is mainly text with control
codes should be text.<something> and everything else should be
source.<something> -- the reason for these names are so that one can
easily generalize settings across file types, so whether it's really a
script, byte-code or similar is unimportant, as long as the “settings”
are the same (where text and source do differ more with regard to
settings, e.g. soft wrap, spell checking etc.).
The old “mode” key is redundant (and has been since beta 2 actually! :)
).
Furthermore, the current syntax files like e.g. HTML.plist uses names
starting with “embedded” for embedded languages. This should instead be
“source”, e.g. “source.php.embedded.html”. The reason is that otherwise
all settings applied to just “source” would need to be also applied to
“embedded” if these settings were to be active for embedded languages.
I do realize that when doing: { include = source.php; } it may
intuitively say that the scope is source.php, but it doesn't, because
we could e.g. have a rule (in HTML) like this:
{ begin = "<%"; end = "%>"; patterns = (
{ include = source.ruby; },
{ include = source.asp; }
);
name = "source.ruby-or-asp.embedded.html";
}
Here we allow for both ruby and asp code inside <% ... %>, so while the
caret is inside this block, it'll need to rely on the name of the rule
which does the includes.
Btw: the above probably would clash too much in real life to be useful!
;)
P.S. This email is just meant to be informative, I do not expect anyone
to update anything to beta 6 before it's actually released! :)
More information about the textmate-dev
mailing list