— but they all do it differently. This makes generically identifying object and
class structures difficult, if not impossible. To make things worse — or
better, depending on who you ask — the language has a couple of powerful
holes programmers use to perform clever tricks that are otherwise difficult. One
example of this is wrapping major chunks of code in an
evalf(..) function, making it only valid at runtime. It's an issue
we're still struggling to model accurately in JSDT.
Without a language model, it's difficult or impossible to place code in context. Since many programming elements depend on the context of code, it's essential for tooling to establish context. IDEs that lack a model and code context also miss out on full type-resolution and validation, scope, visibility, or any of the other good validation essential for easy development.
Figure 1. JSDT language abstraction stack
The basic language model
Type and class inference
Exposing the model
Managing variable and member scope
Figure 2. JSDT library configuration
JSDT uses a library mechanism to manage common objects, variables, and types in a project. Libraries can be added to a project to provide object and variable sets specific to the users' target runtime environment. If two libraries exist that define conflicting members, the members are aggregated and noted in the user interface where relevant. This helps establish methods common across browsers or environments.
With the high-level design points out of the way, let's take a closer look at the features. A few of JSDT's less-visual — but essential — features include same-word highlighting, auto-closing of braces, parentheses, quotes, and auto-indention to name a few. It may suffice to say, "If a good IDE should have it, then JSDT supports it."
Figure 3. Content assistance
Error detection and correction
An IDE is most useful when it can actively determine code errors. The JSDT detects three major types of errors: grammar/language errors, types/fields/method visibility, and flow or logic errors. All error warning levels are individually configurable by way of the preference pages.
Figure 4. Unresolved method
JSDT attempts to resolve all fields and methods for an object. When a method can't be resolved, it's marked in error.
Figure 5. Syntax error
Syntax errors are also found and marked. Here, the
statement is missing a semicolon.
Figure 6. Flow analysis
Figure 6 demonstrates the flow analysis. Since any code after the
return statement is unreachable, it's marked in error.
Figure 7. Quick fix
Some errors have quick-fix options. In Figure 7, when the user clicked the error marker
next to the unresolved variable
formyValue, JSDT comes up with some options to correct the error.
Source gets messy at times. It's easy-to-read, well-structured, and well-formatted code. The problem is keeping code formatted while you develop and debug. JSDT supports many as-you-type formatting features, such as configurable auto-indent and character pair-matching. These are helpful for speed of development and readability.
Other JSDT features
The items above aren't the only features JSDT supports. Here's a full list of the self-explanatory (but must-have) JSDT features:
- Syntax highlighting
- Folding/line numbers
- Full outlining, showing classes, functions, and fields
- Highlight and check of matching brackets/parentheses
- Auto-complete of brackets, parentheses, and indentation
- Mark occurrence
- Comment toggle (line and block)
- Generate element JsDoc
- Surround with do, for, try/catch, while
- User-configurable completion templates
- Extract function/change function signature
- Indentation correction
- Open declaration
- Open-type hierarchy
- Open-call hierarchy
- Customizable code formating
- Full search
- Breakpoint support
- Defined browser libraries with JsDoc for Firefox, Internet Explorer, and ECMA-3
- Library image support
- Debugging support provided through the ATF Project
- Read more about the ECMA-3 standard at the ECMA Web site.
- Read more about the Eclipse ATF Project.
- Check out the "Recommended Eclipse reading list."
- Browse all the Eclipse content on developerWorks.
- New to Eclipse? Read the developerWorks article "Get started with Eclipse Platform" to learn its origin and architecture, and how to extend Eclipse with plug-ins.
- Expand your Eclipse skills by checking out IBM developerWorks' Eclipse project resources.
- To listen to interesting interviews and discussions for software developers, check out developerWorks podcasts.
- Stay current with developerWorks' Technical events and webcasts.
- Watch and learn about IBM and open source technologies and product functions with the no-cost developerWorks On demand demos.
- Check out upcoming conferences, trade shows, webcasts, and other Events around the world that are of interest to IBM open source developers.
- Visit the developerWorks Open source zone for extensive how-to information, tools, and project updates to help you develop with open source technologies and use them with IBM's products.
Get products and technologies
- Check out the latest Eclipse technology downloads at IBM alphaWorks.
- Download Eclipse Platform and other projects from the Eclipse Foundation.
- Download IBM product evaluation versions, and get your hands on application development tools and middleware products from DB2®, Lotus®, Rational®, Tivoli®, and WebSphere®.
- Innovate your next open source development project with IBM trial software, available for download or on DVD.
- The Eclipse Platform newsgroups should be your first stop to discuss questions regarding Eclipse. (Selecting this will launch your default Usenet news reader application and open eclipse.platform.)
- The Eclipse newsgroups has many resources for people interested in using and extending Eclipse.
- Participate in developerWorks blogs and get involved in the developerWorks community.
Dig deeper into Open source on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Keep up with the best and latest technical info to help you tackle your development challenges.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.