Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "JSDT/JSDT-DOM-and-bindings"

Line 1: Line 1:
 
= JSDT DOM and bindings =
 
= JSDT DOM and bindings =
 +
 +
== JSDT parser/compiler infrastructure ==
 +
 +
JSDT changed several parser/compiler toolchains. Below you see a brief resume:
 +
 +
* '''JSDT 1.0''', until Mars.2: supports ES3 using [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino Rhino] (Mozilla Foundation), a Java-based parser/compiler for JavaScript.
 +
* '''JSDT 2.0''', initial release: supports ES6 using [http://esprima.org/ Esprima] (jQuery Foundation). As Esprima is written in JavaScript, this version of JSDT 2.0 needs to [https://wiki.eclipse.org/JSDT/Equinox_hook_for_Nashorn hook Nashorn], the Java8’s JS interpreter.
 +
* '''JSDT 2.0''', from Neon.2 release: supports ES6 using [https://developers.google.com/closure/compiler/ ClosureCompiler] (Google), a java-based parsing infrastructure for JavaScript.
 +
 +
JSDT
  
 
Starting from Eclipse Oxygen, JSDT parsing is done with ClosureCompiler.  
 
Starting from Eclipse Oxygen, JSDT parsing is done with ClosureCompiler.  

Revision as of 18:07, 18 April 2017

JSDT DOM and bindings

JSDT parser/compiler infrastructure

JSDT changed several parser/compiler toolchains. Below you see a brief resume:

  • JSDT 1.0, until Mars.2: supports ES3 using Rhino (Mozilla Foundation), a Java-based parser/compiler for JavaScript.
  • JSDT 2.0, initial release: supports ES6 using Esprima (jQuery Foundation). As Esprima is written in JavaScript, this version of JSDT 2.0 needs to hook Nashorn, the Java8’s JS interpreter.
  • JSDT 2.0, from Neon.2 release: supports ES6 using ClosureCompiler (Google), a java-based parsing infrastructure for JavaScript.

JSDT

Starting from Eclipse Oxygen, JSDT parsing is done with ClosureCompiler. After parsing, a converter transforms the compiler's AST into the JSDT core DOM AST. Then, bindings are used to consume the DOM model to provide content assist, code completion, etc.

This page explains the ClosureCompiler AST, the JSDT core DOM AST and its Bindings to the Eclipse IDE

Other JSDT Architectural information is reported in the parent page JSDT/Architecture.

ClosureCompiler AST

Closure Compiler documentation is mostly in its code. To understand how it works, we should look at the CC source, at few documentation pages, and at the work done when moving JSDT to ClosureCompiler.

DOM AST

The AST class The package org.eclipse.wst.jsdt.core.dom contains the class


This is the AST used in JSDT core. It contains all the information needed to create outline, for content assist etc..

Bindings

This part is about the bindings needed to show the model in the outline, to provide content assist, indexing etc.

Other Notes

See commit https://git.eclipse.org/r/#/c/57504/ (M.Istria) to see the new outline

Back to the top