Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] new parser@master

The esprima based parser has landed to master. I would like to give a quick update on the current state.

At this time the old parser is still in place and the Javascript validator is still using the old parser. We will switch to the new parser along with a change to move to using WTP validators[1]. However the type inference and indexing of the old parser has been disabled so JSDT should no longer be causing OOM errors. Unfortunately, missing inference causes code assist, search, and some related functions to stop working. Fixes/replacements for some of those are already waiting for reviews but we will probably not restore all of them.

I have hooked some of the editor features to the new parser for example outline view is using AST generated
by new Parser and supports ES6 class and imports.

Unfortunately, the only way to introduce nashorn to run the esprima parser was to use ClassLoader Hooks[2]. At this time working with them is a bit cumbersome and I have some ideas on how to improve it.

To work with the new parser
1. Import the nashorn related bundles from nashorn/ directory. You need to import these two bundles to your workspace for now 2. Due to the fact that Equinox needs any framework extension co-located with the OSGi framework bundle you need to also import org.eclipse.osgi into your workspace (from the Plug-Ins view's context menu select Import As → Source Project). 3. Add -Dosgi.framework.extensions=org.eclipse.wst.jsdt.nashorn.extension to your config.ini or launch configuration



Back to the top