Skip to content

Instantly share code, notes, and snippets.

@davethesoftwaredev
Created November 11, 2012 23:25
Show Gist options
  • Save davethesoftwaredev/4056693 to your computer and use it in GitHub Desktop.
Save davethesoftwaredev/4056693 to your computer and use it in GitHub Desktop.
TypeScript plist for textwrangler
<?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:
(?&gt; ` (?s: \\. | [^`] )*? (?: ` ) ) |
(?&gt; /// (?s: \\. | [^/] )*? (?: /// ) ) |
(?&gt; """ (?s: \\. | [^"] )*? (?: """ ) ) |
(?&gt; ''' (?s: \\. | [^'] )*? (?: ''' ) ) |
(?&gt; " (?s: \\. | [^"] )*? (?: " ) ) |
(?&gt; ' (?s: \\. | [^'] )*? (?: ' ) )
)</string>
</dict>
</dict>
</plist>
@davethesoftwaredev
Copy link
Author

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.

@vtbassmatt
Copy link

I added "implements" and "module" in my fork. There may be other new TS keywords, I didn't consult the formal spec.

@isao
Copy link

isao commented Jun 24, 2014

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:
        (?&gt;  //      .*          $               ) |
        (?&gt;  /\*     (?s:.*?)    (?: \*/ | \z )  )
    )</string>

@isao
Copy link

isao commented Jun 24, 2014

my fork is here, wherein I include @vtbassmatt's additions. thanks!

@rekomat
Copy link

rekomat commented Mar 30, 2015

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