Hi all-
Is there a way to dump the current scopes out? I'm thinking like the "Show keyboard shortcuts" in the TextMate bundle? Or is there something that documents the relationship between the various scopes, and the syntax colors?
For example, there's an appearance attribute named "Preprocessor Directive", but what scope would lead to something being colored with that attribute?
I think also I've noticed some conflicting documentation: Is it <comment.block.documentation> -or- <comment.documentation>?
Thanks as always, Charles
On Fri, 29 Aug 2008 13:32:05 -0700, Daniel Stockman wrote:
With the "Bundle Development" bundle installed, it's ⌃⇧P to show the scope of the caret in a tooltip, ⌃⇧⌘C to copy that scope.
Thanks, that will show me the current scope for things that have already been defined. If I'm writing a language grammar, I'd love a "scope hierarchy browser" a la Smalltalk that would show me what the entire scope tree is. Then I could make decisions how to organized my language scope and easily learn from other language grammars.
Barring that, ;-) I'd be satisfied with a document, or a way to generate a list...
Best, Charles
On Aug 29, 2008, at 1:44 PM, Charles Turner wrote:
If I'm writing a language grammar, I'd love a "scope hierarchy browser" a la Smalltalk that would show me what the entire scope tree is. Then I could make decisions how to organized my language scope and easily learn from other language grammars.
Ah, sorry, misinterpreted your request.
[1]: http://wiki.macromates.com/Bundles/StyleGuide [2]: http://blog.macromates.com/2005/introduction-to-scopes/ [3]: http://manual.macromates.com/en/language_grammars.html#naming_conventions
The closest it seems the available documentation comes to your request is this snippet in the StyleGuide[1]:
To make it a bit easier, there is a validate_bundle.rb script inSupport/bin. This is called with a bundle as argument, and will tell you if any of the scope names are not conforming, for example:
cd ~/Library/Application\ Support/TextMate/Bundles ../Support/bin/ validate_bundle.rb Java.tmbundle
Without diving into validate_bundle.rb, I couldn't say if this is anywhere close to what you're looking for (something I once wished for, as well, but resolved to hobble along via the reading of other bundles' sources).
~ Daniel
On Aug 29, 2008, at 3:44 PM, Charles Turner wrote:
Barring that, ;-) I'd be satisfied with a document, or a way to generate a list...
Careful what you wish for…