The Artima Developer Community
Sponsored Link

Java Buzz Forum
IntelliJ IDEA 6.0 "Demetra": JavaScript navigation and completion

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alex Tkachman

Posts: 296
Nickname: alextk
Registered: Dec, 2005

Dmitry Jemerov is IntelliJ IDEA developer, JetBrains
IntelliJ IDEA 6.0 "Demetra": JavaScript navigation and completion Posted: Dec 22, 2005 10:36 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Alex Tkachman.
Original Post: IntelliJ IDEA 6.0 "Demetra": JavaScript navigation and completion
Feed Title: Dmitry Jemerov's Weblog
Feed URL: http://www.jetbrains.com/rss.xml
Feed Description: IntelliJ IDEA Developer, JetBrains
Latest Java Buzz Posts
Latest Java Buzz Posts by Alex Tkachman
Latest Posts From Dmitry Jemerov's Weblog

Advertisement

Unlike all features I described previously, this one has parts of my work in its implementation. Before we committed to improving the UI designer and I was assigned to that project, I spent some time on foundation work for the new JavaScript support. After I switched to UI designer development, the JavaScript plugin was picked up by Maxim Mossienko, and he greatly improved upon my foundation and implemented many new features on top of it.

The key thing that we added in Demetra is cross-file navigation and resolve. The JavaScript plugin builds an index of all functions and variables in the project, and uses it for resolving references. We spent some time discussing the possibility of implementing a type inference algorithm to make the plugin aware of specific object types that can be contained in each variable, but then we decided that a huge amount of work is required to make this feature really useful, and it will not work in all cases anyway, because of the very dynamic nature of the language. Because of this, the current reference resolution algorithm is based only on method names. Also, we have not yet added any scoping rules – we assume that all JavaScript code is visible from anywhere in the project.

The JavaScript symbol index is currently stored only in memory and rebuilt on every project open. Later we plan to provide the possibility to make this index persistent (possibly reusing our existing Java repository) and correctly updatable. Of course, all these facilities will be available to other custom languages as well.

The first feature based on the new index, and the only one I implemented myself, is “Goto Symbol”:

During testing we have found out that different large-scale JavaScript libraries use different styles of assigning functions to object properties, and the plugin should currently be aware of all commonly-used ones.

“Goto Definition” for cross-file references was added by Maxim. The “Show Implementations” feature is based on the same underlying mechanism but is easier to show on a screenshot, so I’ll use that to demonstrate the feature.

The new symbol index is also used for completion:

(Speaking of JavaScript, yesterday we started a Companion Products program, and one of the products offered in it is Inspection-JS by Sixth and Red River Software. Inspection-JS is a plugin for IntelliJ IDEA 5.0 which can detect many common programming errors in JavaScript code, and provides quick fixes for a number of the errors. You can learn more about the Companion Products program from a blog post by Alex Tkachman, the Marketing Director of JetBrains.)

Discuss this in the newsgroup or Web forum

Read: IntelliJ IDEA 6.0 "Demetra": JavaScript navigation and completion

Topic: RELAX NG now an ISO standard Previous Topic   Next Topic Topic: [Dec 13, 2005 06:50 PST] 22 Links

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use