Skip to main content

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

There are multiple reasons why I decided to keep the Service-API in a
synchronous fashion but one of the most important ones is that I'd like
to defer the decision to the user of the API if he maybe even wants to
block the UI, most of the time I do things outside the UI-Thread by
leveraging CompletableFuture and friends but going reactive would be
possible as well.

One could even get progressive loading with a synchronous API by
returning an observable list instance.

Tom

On 19.11.15 17:26, Angelo zerr wrote:
> 
> 
> 2015-11-19 17:12 GMT+01:00 Tom Schindl <tom.schindl@xxxxxxxxxxxxxxx
> <mailto:tom.schindl@xxxxxxxxxxxxxxx>>:
> 
>     Just a short reply as I'm traveling. My stuff does not depend at Eclipse
>     at all! It can run in plain java as well as in OSGi.
> 
> 
> Yes tom, you are right. I have restart from scratch the TypeScript
> Client API at first because I don't want to have Java8 dependencies
> (since Eclipse Mars requires Java7).
> After my other reason is that I would like to have collector API. The
> basic idea is to have 
> 
> ---------------------------------------
> void completions(String fileName, int line, int offest,
> ICompletionCollector collector) 
> ---------------------------------------
> 
> instead of having:
> 
> ---------------------------------------
> List<ICompletionEntry> completions(String fileName, int line, int offest) 
> ---------------------------------------
> 
> 
> Collector API gives you more features like:
> 
>  * support async/sync completion. (configured by the collector (ex:
> collector.setAsync(true))
>  * support timeout or not (configured by the collector (ex:
> collector.setTimeout(200))
>  * implement ICompletionCollector as you need (to create for instance
> list of CompletionProposal) to create directly JFace CompletionProposal
> instead of creating CompletionEntry that you must loop for again to
> create a list of CompletionProposal.
> 
>  Hope you will understand my explanation.
>  
> 
> 
>     I take extra care on all this stuff as my Code-Editor Framework works in
>     any setup, from e4 on JavaFX and SWT, Eclipse IDE or Plain Java.
> 
>     Tom
> 
>     On 19.11.15 15:50, Angelo zerr wrote:
>     > 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.
>     >
>     > My main goal is to support
>     > Angular2 https://github.com/angelozerr/angularjs-eclipse/issues/164
>     >
>     > Hope you will like it.
>     >
>     > Regard's Angelo
>     >
>     >
>     >
>     >
>     > _______________________________________________
>     > wtp-dev mailing list
>     > wtp-dev@xxxxxxxxxxx <mailto:wtp-dev@xxxxxxxxxxx>
>     > To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>     > https://dev.eclipse.org/mailman/listinfo/wtp-dev
>     >
> 
> 
>     --
>     Thomas Schindl, CTO
>     BestSolution.at EDV Systemhaus GmbH
>     Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
>     http://www.bestsolution.at/
>     Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
>     _______________________________________________
>     wtp-dev mailing list
>     wtp-dev@xxxxxxxxxxx <mailto:wtp-dev@xxxxxxxxxxx>
>     To change your delivery options, retrieve your password, or
>     unsubscribe from this list, visit
>     https://dev.eclipse.org/mailman/listinfo/wtp-dev
> 
> 
> 
> 
> _______________________________________________
> wtp-dev mailing list
> wtp-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/wtp-dev
> 


-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck


Back to the top