Skip to content

Instantly share code, notes, and snippets.

@gorkem
Last active May 12, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gorkem/3e3952b2be7870fa1de169d8a109ae7e to your computer and use it in GitHub Desktop.
Save gorkem/3e3952b2be7870fa1de169d8a109ae7e to your computer and use it in GitHub Desktop.

JSDT, meet ECMAScript 2015

An important part of rebooting the JavaScript Development Tools (JSDT) project was updating the JavaScript language level supported with JSDT. In this release, we are replacing the JSDT’s parser/compiler tool chain with esprima parser that supports the ECMAScript 2015 (ES6) which is the latest JavaScript specification release at this time. Previous toolchain only supported up to ES3 level JavaScript. Since the new language JavaScript features was not recognized JSDT often reported false errors on valid Javascript code. As developers adopted to later JavaScript language features, false errors had become more common and was likely to get worse with the wider adoption of ES6.

A parser/compiler is central to a language development tool, the new parser had effected many JSDT features. I would like to highlight a few in this article that are essential to daily development.

ES6 has introduced new keywords such as the for-of, const or let. All the new keywords are now fully recognized. We have added templates for new keywords where appropriate, in addition to keyword content assist. ES6 also had added new constructs such as class definition syntax, or template literals to JavaScript. These new constructs are also recognized and acted upon. As you can see on Figure 1, class definitions are now used by features such as outline view.

ES6Editor
Figure 1. ES6 features on Editor

A second goal with the renewal of the language tools is to allow extensibility of JSDT with the vibrant JavaScript tooling ecosystem outside Eclipse community. For this reason we have refactored JavaScript parser into validators which are easier extend and replace.

The transition of JSDT is not over yet. Some of the JSDT features depended on compiler internal data to work correctly and are disabled. The work continues on enabling or replacing them with more powerful ones with hope to provide an interesting "new and noteworthy" for every release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment