On 14.06.16 16:06, Michael Rennie wrote: > Eugene, > >> I believe using the TS Services is the best solution at the moment. It > would allow JSDT handle the .js, .jsx, .ts files. >> It provides symbols information, content assist etc. > > We have been investigating the tsserver and the language service > protocol for the JS tools in Orion as well (currently we use Tern 0.18). > It looks very promising, as it would immediately provide support for > many different file types (and has all the benefits that Angelo has > mentioned previously). > >> Though the concrete integration strategy is subject to discuss. > > Perhaps we could discuss this more on the next JSDT call? It feels to me > like there might be some overlap work here with Orion and JSDT both > trying to implement / integrate the services. > >> Language Service protocol doesn't provide AST which may be necessary > to display outline for example. >> Another point to consider is refactoring which depends on AST as well. > Perhaps it makes sense to create some .ts layer >> between JSDT and TS Services. > > Is this something that could be 'fixed' via an extension to the services? >
You can get an outline using the LanguageService API using getNavigationBarItems() if you use java2typescript the code looks like this: > languageService.getNavigationBarItems(uri).stream().forEach(this::handleNavbarItem); > private void handleNavbarItem(NavigationBarItem item) { > if( ScriptElementKind.CLASS_ELEMENT == item.kind() > || ScriptElementKind.INTERFACE_ELEMENT == > item.kind() > || ScriptElementKind.VARIABLE_ELEMENT == > item.kind()) { > ..... > } else if( ScriptElementKind.MODULE_ELEMENT == item.kind() ) { > if( "<global>".equals(item.text()) ) { > > item.childItems().stream().forEach(this::handleNavbarItem); > } else { > .... > } > } > } Tom > Michael Rennie > > > _______________________________________________ > wtp-dev mailing list > wtp-dev@eclipse.org > 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@eclipse.org To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/wtp-dev