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"

m (Introduction)
 
(75 intermediate revisions by 10 users not shown)
Line 1: Line 1:
= JavaScript Development Tools =
+
{{DISPLAYTITLE:JavaScript Development Tools}}
  
== Introduction ==
+
{{JSDT}}
The ATF team is proposing  to develop a new set JavaScript Editor/Development Tooling. The ATF team feels that a good JavaScript editor with a real JavaScript model for both AJAX and JavaScript developers. This effort would be an component of WST, since the WST project is scoped to do JavaScript development tools for the web. The JavaScript Development Tooling would be a WTP 3.0 2008 release item and would replace the existing JavaScript editor.
+
  
== Description ==
+
The '''JavaScript Development Tools''' (JSDT) is an Eclipse project ''aimed to build the most accurate JavaScript IDE'' while keeping it ''very fast''.
  
With the advent of Web 2.0, JavaScript have become central in the creation of a richer user experience on the Web. Its use has shifted from the creation of simple functions and handlers to events, to the creation of complex Web Application frameworks. Such complexity makes it crucial that more sophisticated set of tool become available on Eclipse.
+
It is a child project of the [https://projects.eclipse.org/projects/webtools WebTools Platform (WTP)] which reuses the [https://projects.eclipse.org/projects/webtools.sourceediting Structured Source Editing (SSE)] components and that was initiated by cloning and adapting the [https://projects.eclipse.org/projects/eclipse.jdt Java Development Tools (JDT)] project.
  
The JavaScript Development Tools's goal will be to develop a framework for development of JavaScript applications, with full support for editing, refactoring, and searching. The JavaScript editor would be designed such that is can be plugged in to the Web Tools. The JavaScript Development Tools would be also be extensible such that new language features can easily be added.
+
JSDT is based on [[WTP]], [https://eclipse.org/webtools/wst/components/sse/overview.html SSE] and copies many features from [[JDT]]; so it carries on, extends and add rich features like: JavaScript integration in web editors, code completion, smart error detection, AST inference, JS debugging and so on..
  
The functionality of the JavaScript Development Tools will be heavily based on the functionality of the JDT. Because JavaScript is not a fully typed or class-based language, it will not be possible to provide 100% of the JDT functionality. Configurable capabilities will be provided to infer type and class structure from the JavaScript code, so as much JDT functionality as possible can be used.  
+
JSDT also integrate JS to other technologies like HTML, JSP, CSS, Nodejs, Gulp, Grunt, JSON, Angularjs, Chromium (V8), etc..,  
 +
plus is open to integrate even more (CoffeeScript, TypeScript...) and is driven by a small and though development team.  
  
Functions provided include:
+
Contribute with us, if you dare!
  
* Editor capabilities:
+
== Description ==
** Syntax highlighting
+
** Code folding
+
** Configurable formatting
+
** Code completion
+
** Content assist
+
*** Variable/function resolution
+
*** Resolution Context
+
** Quick fix
+
** syntax checking/error display
+
** Hover help/tips
+
** Occurences marking
+
** open selected item
+
** highlight matching parenthesis/brace/bracket
+
** add/remove/generate comment
+
** Typing helpers:
+
** Automatically close strings, parentheses, brackets,etc
+
** Automatically insert semicolons, braces
+
** automatic formatting
+
* Refactoring
+
** method- rename, move, delete, change signature
+
** var - rename, move, delete
+
** class (inferred) rename, move up/down
+
* Javadoc support (or JSDoc)
+
* Externalize strings (NLS support)
+
* Class hierarchy view
+
* Call hierarchy view
+
* Script explorer view
+
* Search references/declarations
+
* j(s)unit support
+
* Preferences:
+
** Appearance
+
** Templates
+
** Formatting
+
** Validation options
+
** Error/Warning levels
+
** Editor options
+
* Code Obfuscation
+
* Code Compression
+
 
+
== Proposed Design ==
+
The JavaScript Development Tools design would use the JDT design with the necessary adjustments made for JavaScript.
+
 
+
As far as the JavaScript Development Tools design is concerned, the major differences between Java and JavaScript are:
+
 
+
* Javascript has no explicit typing support, whereas in Java everything is typed.
+
* At the top level, a JavaScript file can contain any program statement, whereas a Java file only contains a class.
+
* JavaScript has no classpath/jar file concept.
+
 
+
Other areas where the java/JavaScript differences will necessitate changes:
+
 
+
* syntax differences - parse definitions
+
* additional program elements with no correspondence in java
+
** object literal
+
** for (var in collection)
+
 
+
=== Inferred Types ===
+
 
+
In order for some JDT functionality (such as code completion) to work correctly, class type information needs to be available. This information is not available in JavaScript, but it can be inferred in many cases. A type inferring framework will be put in place to support this functionality. The type inferring will examine the JavaScript abstract syntax tree (AST), and generate "virtual" class information.
+
 
+
The type inferring will run off of a configuration will provide many options for how to infer the types/classes. The type inferring will also be extensible, so the unique conventions among various JavaScript toolkits can be handled. The type inferring will be configurable on a project basis, and possible on a file by file basis.
+
 
+
The type inferring configuration will also be used by the refactoring function.
+
 
+
=== Javascript file handling ===
+
 
+
Java files have a very top down structure, where files only contain classes, which only contain fields, methods, and classes, and program statements only contained within methods. Because of this, some JDT functionality will not work for JavaScript, because a program statement can be directly at the top of a JavaScript file. This will be handled by refactoring the relevant JDT code.
+
 
+
=== Variable/function resolution ===
+
 
+
In Java, everything is resolvable because of the classpath, package structure, and import statements. This has no correspondence in JavaScript. The function will be handled within JSDT by various means. When resolving functions/variables, JSDT will search all files in the same directory, files in referenced projects, files in referenced paths (configured by something like JDT "Java Build Path" page), and system API files (contained within JSDT).
+
  
Because of the "loose" nature of JavaScript, many of the validation errors produced by the resolution code will be changed to warnings, or removed altogether. It may be desirable to configure what should be errors on a (JavaScript) file by file basis.  
+
With the advent of Web 2.0, JavaScript has become central in the creation of a richer user experience on the Web. Its use has shifted from the creation of simple functions and events handlers to the creation of complex Web Application frameworks. Such complexity made it crucial that a more sophisticated set of tools become available in Eclipse.
  
=== Functionality mapping ===
+
JSDT's goal is to develop an IDE for JavaScript applications, with full support for editing, search, and refactoring.  The functionality of the JavaScript Development Tools is heavily based on the functionality of the Java Development Tools, but since JavaScript is not a fully typed or class-based language, it is not possible to provide 100% of the JDT functionality.  JSDT is extensible in that it can be (is) plugged into the HTML and JSP editors within WTP as well as being architected with pluggable type inference and completion proposals in mind.  The inference engine is used to determine type and class structures from the JavaScript code, enabling as much of the JDT equivalent functionality as possible, while still allowing adopters to contribute to the process for atypical or extended scenarios.
  
This table shows how the JDT functionality corresponds to the JavaScript functionality. It does not include anything where there is a direct one to one correspondence.
+
JSDT is split up into three functional areas:
  
{| border="1"
+
#Core - all of the core components, including, but not limited to, the parser, compiler, DOM and ASTs
|-
+
#[[/Debug|Debug]] - integrated debug support for Rhino and Crossfire
| '''JDT function''' || '''JSDT function'''
+
#UI - all of the UI bits that drive the core
|-
+
| Build path || include path (or something similar)
+
|-
+
| JDK level (1.4 vs 1.5) || Ecma script level 3 vs 4
+
|-
+
| Compile || validation
+
|}
+
=== Extension Points ===
+
  
The JSDT will functionality will be embedded. This means, for instance, the JavaScript editing capabilities will be embeddable within HTML and XML editors, both within script tags, and script attribute values.
+
== Key Features ==
 +
There are many features that the JDT has the the JSDT also has.  
  
The following jsdt.core extension points will be supported :
+
A few of these key features are:
  
* include path variable initializer
+
* Syntax Highlighting
* include path container initializer
+
* Full outlining showing Classes, Functions and Fields
* code formatter
+
* Highlight and check of matching bracket / parenthesis
* validation participant
+
* Auto-complete of brackets, parentheses and indentation
 +
* Marking of Occurrences
 +
* Generation of element JSDoc
 +
* Smart Code Completion based on a real-time JavaScript Model
 +
* Hover Help that displays element declaration with JSDoc or Error message
 +
* Configurable Error/Warning checking including full language syntax and type/class structure resolution
 +
* Flow analysis showing unreachable code, unused variables and variable hiding.
 +
* Quick-fixes
 +
* Completion Templates
 +
* Extensible and customizable Code Formatting
 +
* Full Search
 +
* Refactoring - renaming, moving, member extraction
 +
* Support for user defined and browser libraries.
  
In addition, the JavaScript syntax tree will be presented as an XML dom, so that various XML processors can be run against it for a variety of reasons, for instance, a Schematron processor could be used to do validation.
+
== Installation ==
  
The following jsdt.ui extension points will be supported :
+
JSDT is included in WebTools and in the Release Train aggregator site. So latest release can directly be installed from http://download.eclipse.org/releases/<luna|mars|...>.
  
* javascript element filter
+
* Milestones are accessible via the site of the next release (ie http://download.eclipse.org/releases/mars when next Eclipse release is Luna).
* javaScriptEditorTextHovers
+
* Snapshot builds are accessible via webtools integration site http://download.eclipse.org/webtools/downloads/drops/R3.7.0/ or via the JSDT-sepecific snapshot site http://download.eclipse.org/webtools/jsdt/snapshots (which may contain additional experimental features, not contributed to WebTools yet).
* javadocCompletionProcessor
+
* quickFixProcessors
+
* quickAssistProcessors
+
* includepathContainerPage
+
* foldingStructureProviders
+
* queryParticipants
+
* javaScriptCompletionProposalComputer
+
* javaScriptCompletionProposalSorters
+
  
 +
== Community ==
  
=== Development Plan ===
+
* User forum
 +
* Contributors mailing-list
 +
* [[/Confcalls | Contributors conference calls]] planning, logistics and minutes
  
The high level plan as follows:
+
== Development ==
  
# Copy the 3.2 level JDT code.
+
* [[JSDTDevelopment | Developing and contributing to JSDT ]]
# refactor java -> JavaScript , org.eclipse.jdt -> org.eclipse.jsdt, etc .
+
# update syntax definitions, parsing, etc to JavaScript
+
# class inferencing
+
# update/refactor jdt junit tests to JavaScript and make work
+
# update ui
+
# remove dead code (any java functionality not used)
+
# determine what code is unchanged from JDT and figure out how to share with JDT
+
  
Specific work items (non-exhaustive):
 
  
* Update syntax definition to JavaScript
+
[[Category:Eclipse Web Tools Platform Project]][[Category:JSDT]]
* Add AST nodes for JavaScript Object literal, array initializer, and "for (var in collection)"
+
* Change junit test cases from testing java to be the corresponding JavaScript
+
* Add inferencing framework
+
** Generic inferencing engine
+
** Configuration support
+
** Support for one or two popular toolkits such as dojo
+
* Include path support
+
** Change resolution mechanisms
+
** Change classpath model to include model
+
** UI
+
** Support for one or two popular toolkits such as dojo
+
* Change formatting code to support JavaScript
+
* Change syntax highlight code to support JavaScript
+
* Remove non-applicable actions from ui
+
* Expose ast as XML dom
+
* Refactoring
+
** Change to run based on inferred types
+
** May need to display dialog when not confident about what needs to change
+
* Code completion
+
** Possible completion parser changes
+
* Quick fix
+
** Add JavaScript possibilities
+
** Remove non applicable possibilities
+

Latest revision as of 12:57, 4 March 2016



JSDT
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse Source


The JavaScript Development Tools (JSDT) is an Eclipse project aimed to build the most accurate JavaScript IDE while keeping it very fast.

It is a child project of the WebTools Platform (WTP) which reuses the Structured Source Editing (SSE) components and that was initiated by cloning and adapting the Java Development Tools (JDT) project.

JSDT is based on WTP, SSE and copies many features from JDT; so it carries on, extends and add rich features like: JavaScript integration in web editors, code completion, smart error detection, AST inference, JS debugging and so on..

JSDT also integrate JS to other technologies like HTML, JSP, CSS, Nodejs, Gulp, Grunt, JSON, Angularjs, Chromium (V8), etc.., plus is open to integrate even more (CoffeeScript, TypeScript...) and is driven by a small and though development team.

Contribute with us, if you dare!

Description

With the advent of Web 2.0, JavaScript has become central in the creation of a richer user experience on the Web. Its use has shifted from the creation of simple functions and events handlers to the creation of complex Web Application frameworks. Such complexity made it crucial that a more sophisticated set of tools become available in Eclipse.

JSDT's goal is to develop an IDE for JavaScript applications, with full support for editing, search, and refactoring. The functionality of the JavaScript Development Tools is heavily based on the functionality of the Java Development Tools, but since JavaScript is not a fully typed or class-based language, it is not possible to provide 100% of the JDT functionality. JSDT is extensible in that it can be (is) plugged into the HTML and JSP editors within WTP as well as being architected with pluggable type inference and completion proposals in mind. The inference engine is used to determine type and class structures from the JavaScript code, enabling as much of the JDT equivalent functionality as possible, while still allowing adopters to contribute to the process for atypical or extended scenarios.

JSDT is split up into three functional areas:

  1. Core - all of the core components, including, but not limited to, the parser, compiler, DOM and ASTs
  2. Debug - integrated debug support for Rhino and Crossfire
  3. UI - all of the UI bits that drive the core

Key Features

There are many features that the JDT has the the JSDT also has.

A few of these key features are:

  • Syntax Highlighting
  • Full outlining showing Classes, Functions and Fields
  • Highlight and check of matching bracket / parenthesis
  • Auto-complete of brackets, parentheses and indentation
  • Marking of Occurrences
  • Generation of element JSDoc
  • Smart Code Completion based on a real-time JavaScript Model
  • Hover Help that displays element declaration with JSDoc or Error message
  • Configurable Error/Warning checking including full language syntax and type/class structure resolution
  • Flow analysis showing unreachable code, unused variables and variable hiding.
  • Quick-fixes
  • Completion Templates
  • Extensible and customizable Code Formatting
  • Full Search
  • Refactoring - renaming, moving, member extraction
  • Support for user defined and browser libraries.

Installation

JSDT is included in WebTools and in the Release Train aggregator site. So latest release can directly be installed from http://download.eclipse.org/releases/<luna|mars|...>.

Community

Development

Back to the top