Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] TypeScript & JSDT with typescript.java

Hi everybody,

For your information, I have started a new project https://github.com/angelozerr/typescript.java which provides a TypeScript client which consumes tsserver like tom have started with https://github.com/BestSolution-at/java-tsserver/

I have prefered to create from scratch the TypeScript client (instead of using tom work) because:

 * I have doen the  same thing than tern.java (plugins which ar enot linked to Eclipse) to consume it with Netbeans, etc
 * it doesn't requires Java8.
 * I would like to have the same TypeScript client API than VSCode https://github.com/Microsoft/vscode/blob/master/extensions/typescript/src/typescriptServiceClient.ts
 * I use collector architecture to provide with an easy mean, asynch/synch completion, with or without timeout, etc

For the moment, I have a lot worked about completion features:

 * with a simple Java main: https://github.com/angelozerr/typescript.java/blob/master/samples/ts.samples/src/test/Main.java You can notice that I have managed too update of the content of the typescript file (when user changes content of the editor). Today it works like Sublime and Vim integration which consumes tsserver (with a temporay file, it's strange but it's the only mean to do that since tsserevr use readline). It seems that VSCode uses "change" command to update content. I will study that.

 * with a simple SWT Text: https://github.com/angelozerr/typescript.java/blob/master/samples/ts.eclipse.swt.samples/src/ts/eclipse/swt/samples/NodejsTSEditor.java

 * and with JSDT Editor! https://github.com/angelozerr/typescript.java/blob/master/eclipse/jsdt/ts.eclipse.ide.jsdt.ui/src/ts/eclipse/ide/jsdt/internal/ui/contentassist/TypeScriptCompletionProposalComputer.java


I have not tested with a lot of files, but performance seems very good (tsserver uses a system of request/response which is very performant. I hav eused Future task for that an dit works very good). With existing Eclipse TypeScript plugins, my Eclispe freeze every time with the same file. Their integration waits a response from a request and doesn't uses tsserver. In my case I use tsserver (which is used by VSCode which is very performant) and Future task.

My next work is to integrate TypeScript validation by developping a WTP Validator (like I have done with tern.java). Validation with tsserver is done with async mode, so I'm very impatient to see the result.


Hope you will like it.

Regard's Angelo



Back to the top