Created
November 11, 2012 23:25
-
-
Save davethesoftwaredev/4056693 to your computer and use it in GitHub Desktop.
TypeScript plist for textwrangler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<!-- | |
BBEdit Language Module for TypeScript | |
Put this file in | |
~/Library/Application Support/BBEdit/Language Modules | |
or equivalent. | |
Based off the language file for CoffeeScript found at | |
http://joyofmodeling.org/index.php/OSX/coffeescript-syntax-coloring-in-text-wrangler.html | |
--> | |
<plist version="1.0"> | |
<dict> | |
<key>BBEditDocumentType</key> | |
<string>CodelessLanguageModule</string> | |
<key>BBLMLanguageDisplayName</key> | |
<string>TypeScript</string> | |
<key>BBLMLanguageCode</key> | |
<string>TySc</string> | |
<key>BBLMColorsSyntax</key> | |
<true/> | |
<key>BBLMScansFunctions</key> | |
<true/> | |
<key>BBLMIsCaseSensitive</key> | |
<true/> | |
<key>BBLMKeywordList</key> | |
<array> | |
<string>break</string> | |
<string>case</string> | |
<string>catch</string> | |
<string>continue</string> | |
<string>debugger</string> | |
<string>default</string> | |
<string>delete</string> | |
<string>do</string> | |
<string>else</string> | |
<string>finally</string> | |
<string>for</string> | |
<string>function</string> | |
<string>if</string> | |
<string>in</string> | |
<string>instanceof</string> | |
<string>new</string> | |
<string>return</string> | |
<string>switch</string> | |
<string>this</string> | |
<string>throw</string> | |
<string>try</string> | |
<string>typeof</string> | |
<string>var</string> | |
<string>void</string> | |
<string>while</string> | |
<string>with</string> | |
<string>public</string> | |
<string>class</string> | |
<string>extends</string> | |
<string>super</string> | |
<string>any</string> | |
<string>number</string> | |
<string>bool</string> | |
<string>string</string> | |
<string>export</string> | |
<string>declare</string> | |
</array> | |
<key>BBLMSuffixMap</key> | |
<array> | |
<dict> | |
<key>BBLMLanguageSuffix</key> | |
<string>.ts</string> | |
</dict> | |
</array> | |
<key>Language Features</key> | |
<dict> | |
<key>Identifier and Keyword Character Class</key> | |
<string>0-9A-Z_a-z</string> | |
<key>String Pattern</key> | |
<string>(?x: | |
(?> ` (?s: \\. | [^`] )*? (?: ` ) ) | | |
(?> /// (?s: \\. | [^/] )*? (?: /// ) ) | | |
(?> """ (?s: \\. | [^"] )*? (?: """ ) ) | | |
(?> ''' (?s: \\. | [^'] )*? (?: ''' ) ) | | |
(?> " (?s: \\. | [^"] )*? (?: " ) ) | | |
(?> ' (?s: \\. | [^'] )*? (?: ' ) ) | |
)</string> | |
</dict> | |
</dict> | |
</plist> |
I added "implements" and "module" in my fork. There may be other new TS keywords, I didn't consult the formal spec.
Thanks for this! The code comments weren't working, so I checked out the BBEdit SDK and copied the <key>Comment Pattern</key>
parts from the C++ example into the TypeScript.plist
and one-line and multi-line comments work.
<key>Comment Pattern</key>
<string>(?x:
(?> // .* $ ) |
(?> /\* (?s:.*?) (?: \*/ | \z ) )
)</string>
my fork is here, wherein I include @vtbassmatt's additions. thanks!
Oooops… didn't see Iaso already added syntax coloring for comments. So I did too:
Added syntax coloring for comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not super great with regular expressions, so I'm not sure that the string pattern is accurate. It seem to work well, though! It is the same as the CoffeeScript file in the comment.