Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript plugin for Sublime

So Microsoft offers syntax highlighting for ST2, but not much else.

How hard would it be to build a plugin that can replicate a lot of the IDE features. I figure if they can replicate it in JS (in the playground) it shouldn't be -THAT- hard to as a ST2 plugin. I'm just not sure where to start... I know how to build a ST2 plugin... but I know nothing about compilers, parsers, etc...

like image 981
speg Avatar asked Oct 11 '12 17:10

speg


3 Answers

[edit] Here's a list of started TS plugins, that I'll try to keep up-to-date:

  • T3S - new, as of december 2013
  • sublime-typescript - new, as of january 2013 (not developed anymore)
  • github.com/stoffera/sublimetext2-typescript-plugin (not developed anymore)

[/edit]

We already added basic TypeScript support for SublimeLinter, see this pull request. This will at least show you TypeScript errors in Sublime. It works, but will be slow for big projects as all referenced files will be parsed on every lint. This needs to be fixed in the future.

As TypeScript and its services are written in TypeScript itself, they convert to JS and thus can be used from nodejs and in consequence from Sublime (as Christopher Pappas suggested). This is exactly how the TypeScript support in SublimeLinter works.

If you want to create a full-featured Sublime plugin, I advice you to take a look at the TypeScript services which provide all the necessary functions for auto-completion and such. languageService.ts should be what you are looking for. Also, you should take a look at the source-code of the TypeScript Playground, as they provide auto-completion through JS on the web. Unfortunately you have to un-minify the source yourself, as there is no offical source-code for playground.

In any case, I would be gladly willing to help if you are really interested in creating a Sublime TypeScript plugin!

[edit]

You should also look at the Sublime documentation for information about adding completions.

like image 166
CodeSalad Avatar answered Nov 16 '22 02:11

CodeSalad


There is new TypeScript Plugin for Sublime Text from Microsoft: https://github.com/Microsoft/TypeScript-Sublime-Plugin

like image 20
Vojta Avatar answered Nov 16 '22 02:11

Vojta


I would have a look at these other possible solutions, particular to Node, and go from there:

Use TypeScript compiler from node

Does TypeScript provide an explicit Public API for NodeJS Module Access?

like image 45
cnp Avatar answered Nov 16 '22 01:11

cnp