Sublime Text, Vi, Emacs: TypeScript enabled!


TypeScript is a new open and interoperable language for application scale JavaScript development created by Microsoft and released as open source on CodePlex. You can learn about this typed superset of JavaScript that compiles to plain JavaScript reading Soma’s blog.

At Microsoft Open Technologies, Inc. we are thrilled that the discussion is now open with the community on the language specification: you can play (or even better start developing with TypeScript) with the bits, read the specification and provide your feedback on the discussion forum. We also wanted to make it possible for developers to use their favorite editor to write TypeScript code, in addition to the TypeScript online playground and the Visual Studio plugin.

Below you will find sample syntax files for Sublime Text, Vi and Emacs that will add syntax highlighting to the files with a .ts extension. We want to hear from you on where you think we should post these files for you to be able to optimize them and help us make your TypeScript programming an even greater experience, so please comment on this post or send us a message.

 

sublime_text_icon_2181
TypeScript support for
Sublime Text
emacs
TypeScript support for
Emacs
vim-logo
TypeScript support for
Vim

Olivier Bloch
Senior Technical Evangelist
Microsoft Open Technologies, Inc.

Comments (57)

  1. Mike Chaliy says:

    For Sublime you might want to make package available for wbond.net/…/package_control

  2. Chris says:

    SublimeText:  It would be wonderful if you guys could host a) on GitHub for community contributions; and b) in Sublime's Package Control.  

    Any plan to release a full-featured Sublime Package?  

  3. wbond says:

    I'm sure Sublime Text users would love it if you set up the TypeScript language file to be in the default Package Control channel.

    The simplest way is if it is hosted on GitHub (wbond.net/…/package_developers), but it is also possible to use Package Control to generate a .sublime-package file and host it plus a packages.json file (github.com/…/example-packages.json) on any public URL.

    Feel free to shoot me an email or tweet (@wbond) if you have any questions.

  4. Ozan Sener says:

    First of all congratulations and thanks for doing this right. Npm package, git

    repository, editor extensions, Apache License, this is a great announcement.

    Emacs currently has a nice package ecosystem. Please submit stable releases of

    typescript.el to marmalade[1] (). Creating a MELPA[2] recipe wouldn't hurt

    either, especially for new packages with (hopefully) high development activity

    such typescript.el. Since you are hosting your code on git creating a recipe is

    trivial after setting up a git repository:

     (typescript-mode

       :url "git01.codeplex.com/typescript-mode"

       :fetcher git

       :files ("typescript.el"))

    Even though you already have your own IDE please don't dump this on the

    community and stop improving these editor plugins :). From a quick glance it

    looks like TypeScript allows much better code analysis in Emacs and other

    editors compared to JavaScript.

    1: http://marmalade-repo.org/

    2: http://melpa.milkbox.net/

  5. Eran says:

    Is there any plan for an Eclipse plugin anytime in the future? (Will help this go head to head with Dart)

  6. Colin Jack says:

    Very interesting and it's great how open you guys are. Given the traction sublime has it'd be interesting to see if people take advantage of TS to add features like refactoring (something like github.com/…/SublimeRope).

  7. John Fawcett says:

    It seems that in Sublime, method names do not get highlighted if there is an argument specified.

    Also, I think this is really cool. I didn't expect it to be supported in anything except Visual Studio. So, I can dig it! So far, seems like a great alternative to coffeescript.

  8. Jerry Sievert says:

    awesome work! thanks for the Sublime plugin, but it looks like it will also work for TextMate (which is a big plus as well).

  9. Danilo says:

    And WebMatrix? =/

  10. Kirill "Nemoden" K. says:

    Github, please!!!

  11. Bazo says:

    What about NetBeans support?

  12. Jason Denizac says:

    +1 for Sublime Package Control. Thanks for the Sublime Text extension. It would be super awesome if MS would release some sort of static analysis libraries on an open source basis (in JS/TS, preferably!), and from there the community could go about integrating them with common editors.

  13. Vincent Spallek says:

    in addition to Eran's question: Are there plans to support the Eclipse-Maven toolchain? In order to be able to integrate it into a continuous integration environment typically used in our organization for enterprise scale application development, both an Eclipse plugin as well as Maven build plugins are required.

  14. JohnArcher says:

    Cool, thanks for supporting Sublime!

    Would be cool, as others mentioned, to include it into Sublime package manager (wbond)!

    Thanks!

  15. LM says:

    Any plans for netbeans?

  16. Why not webmatrix ? says:

    I am not sure why not this for webmatrix.

    do you ownself don't believe that webmatix and expression studio or marketing guys is just died for webmatrix and expression studio/

  17. test says:

    installer should install some help file or just link to a help website.

  18. Tormi says:

    Looking forward to see a Netbeans plugin.

  19. Leaf Garland says:

    For Vim you could upload to http://www.vim.org/scripts, or make it available as a git repository somewhere (as an example I have created one at github.com/…/typescript-vim and added simple filetype detection).

    With either of those options then the syntax can easily be added using Vim package managers like Pathogen or Vundle.

  20. Vladimir says:

    A zip file? srsly?

  21. obloch says:

    Thanks all for your comments and suggestions. We are looking into the next steps and will definitively let you know rapidly what we will do based on your input. Stay tuned and keep the good feedback and suggestions coming, this helps a lot.

    – Olivier

  22. xy59 says:

    Could you provide VS2010 support?

  23. Adam says:

    +1 for Eclipse Plugin

  24. Matt Kerr @MSFT says:

    +1 for Visual Studio support, but Notepad++ would also be cool. 🙂

  25. Johannes says:

    Great to see that there is Sublime Text 2 Support, I love this editor, as the other commenters said, please publish it through Package Control (wbond).

    Anyway, I'll give it a try these days.

  26. Mark Hurd says:

    It would be nice if you supported people stuck on Windows XP with VS2010 or VS2k8. As with the non-Microsoft editors, just syntax highlighting would do…

  27. koko says:

    Jetbrains Webstorm

  28. John says:

    Could you provide VS2008 support?

  29. Wally says:

    Are the copyright headers from typescript.el correct?

    "Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. […]

    This file is part of GNU Emacs."

    plus.google.com/…/3P9dFY9jUxu

  30. Stu says:

    Anyone have a Sublime build system configuration? I have node, and the TypeScript node package installed on Windows 7.

    This does not work:

    {

       "cmd": ["node", "tsc", "$file"],

       "file_regex": "(.*\.ts?)\s\(([0-9]+)\,([0-9]+)\)\:\s(…*?)$",

       "path":"C:\Windows\system32\cmd.exe",

       "shell": false

    }

  31. Gordan says:

    Yes please add a Package Control version for Sublime Text.

  32. Adam says:

    Please build an Eclipse plug-in and a TextMate package.

    Thanks!

  33. Anthony says:

    Where is the emacs file? It's not in the zip.

  34. Ari says:

    So the emacs zip hasn't been updated in weeks; are we going to get an emacs version again?

    'The file is temporarely unvailable. We will return soon with an updated version.'

    The spelling of temporarily, and unavailable is incorrect as well….

  35. obloch says:

    Hi all

    The Emacs support is still in the works and we hope to be able to bring it back rapidly. Sorry for the delay and thanks for your interest and feedback!

    We are also looking into the best way to deliver these extensions for you to be able to get the most out of them. Stay tuned.

    – Olivier

  36. Ari says:

    Thanks for the quick reply, hope to get the emacs version soon!

  37. Eljay says:

    The README-vim-typescript.txt should say to append these to the $HOME_vimrc file

    syntax on

    filetype on

    au BufNewFile,BufRead *.ts set filetype=typescript

    Or modifying the $VIMRUNTIMEfiletype.vim to recognize the *.ts extension.

  38. obloch says:

    @Eljay

    Thanks for the tip. I will look into this.

    – Olivier

  39. what do I do with the sublime file to get it to work?

  40. Patrick Logan says:

    It's really unfortunate that the decision was made not to support VS2010.  Now instead of being able to learn and begin using TypeScript, a large number of developers are cut off from it until their organizations finally make the decision to allow their people to migrate to VS2012.  Really unfortunate!

  41. Here's another option, use C# that you already know, that works in Visual Studio 2005, 2008, 2010 and 2012, and convert it JavaScript during build, now that's interoperability for you! 😉

    http://sharpkit.net/Live.aspx

  42. Ville Vainio says:

    Sublime text plugin doesn't work as is on Linux.

    You need to rename the file in the zip to typeScript.tmLanguage (Linux is case sensitive!)

  43. ethan says:

    can anyone tell if and when we'll have the netbeans plugin?

  44. obloch says:

    @Ville Vainio  

    Thanks for the heads up. I have fixed the Sublime Text plug in changing the extension of the file to tmLanguage with a capital "L".

    – Olivier

  45. Stuart Thompson says:

    Olivier,

    Thanks for providing these plugins. It helps TypeScript to fit in my workflow pretty smoothly.

    This article was very useful for me on how to set up a new build system within Sublime Text 2. Pasting here in case others can use it: http://www.andrewrowland.com/…/typescript-sublime-text-integration

  46. Eran Medan says:

    I've gathered the syntax highlighting for sublime text 2 here with a build system (based on examples from others) feel free to comment and improve it: github.com/…/sublime-text-2-typescript

  47. obloch says:

    @Eran Medan

    Thanks a lot, this is great!

    – Olivier

  48. Eric Clemmons says:

    I added the [TypeScript syntax highlighting][1] to Packagist[2] for SublimeText 2.  Now it's as easy as doing: "Cmd+Shift+P, Install Package, TypeScript"

    [1]: github.com/…/sublime-typescript

    [2]: github.com/…/810

    As for building, I'd recommend using grunt.js instead, but it looks like someone has already started work for the build system before me.

  49. obloch says:

    @Eric

    Great job! I'll make sure to follow up with you offline to see how we can work together on maintaining this project.

    -Olivier

  50. kevin Mencos says:

    Installing with Sublime Package Control

  51. John gwynn says:

    +1 for WebStorm

  52. Leo says:

    +1 for Eclipse plugin and Maven build plugin

    Great job!

  53. Nitin Bhardwaj says:

    How can we use Database in typescript?

  54. obloch says:

    @Nitin

    TypeScript is JavaScript, therefore you can access Databases the same way you do with JavaScript code.

    There is a sample that shows typed usage of MongoDB for server-side database access in the samples here: typescript.codeplex.com/…/ac38ce9e29b3

    – Olivier

  55. bunnyhero says:

    The Sublime Text syntax definition does not recognize method names unless the opening brace is on the same line as the method name. If the opening brace is on the following line, the method name is not highlighted properly; and worse, the "Go To Symbol" command will not show those method names either!

    Meanwhile, the TypeScript compiler handles various opening brace positions just fine. Please fix.

  56. obloch says:

    @bunnyhero

    We are working on updating all these extensions. You should hear from us soon on our new blog: msopentech.com/blog

    – Olivier

  57. Dima says:

    Create for Notepad++ please