-
Notifications
You must be signed in to change notification settings - Fork 89
Technical information
Angelo edited this page Dec 18, 2013
·
8 revisions
#Technical information
Here some technical information about AngularJS Eclipse :
- the HTML JFlex parser was modified (like JSP have done) to manage expression tokens {{}}. See AngularTokenizer.jflex. It allows to higlight {{}} expression (even in an attribute value).
- a new content type "org.eclipse.angularjs.core.angularsource" was created and linked to this AngularTokenizer.jflex. This content type is applied to html file only if project has "org.eclipse.angularjs.core.AngularNature" nature.
- the AngularJS HTML editor extends the WTP HTML Editor with WTP extensions point "org.eclipse.wst.sse.ui.editorConfiguration" for completion, hover, etc
AngularTokenizer is a good idea to highlight {{}} epression and manage completion, etc, but JSP editor doesn't benefit with Angular feature (see issue 2). We need to rewrite the JSP lexer to add {{}} expression token.
- to manage completion in HTML editor, tern which is is a stand-alone code-analysis engine for JavaScript , is used. tern gives several support (call plugins and defs) like AngularJS, require, ecma5, jquery...
- As tern is written in Javacsript, AngularJS Eclipse uses [tern.java]https://github.com/angelozerr/tern.java).
- tern.java gives you the capability to execute tern in Java context. It provides several implementation :
- with Rhino, but it's bad idea to use it for big Javascript file (slow and out of memory problem).
- with node.js. this implementation starts tern with node.js process and call it with an HTTP client. It's the prefered mean to use Tern in Java.
- to avoid installing node.js, tern.java provides some embed node.js plugins.