In JavaScript we quite often use strings as some kind of identifiers. Event and module names are good examples here.
A good IDE should support this in my opinion. With this plugin you can define a format of your identifiers. Each JavaScript string matching this format becomes a 'symbol' which you can rename(Shift + F6), find usages of (Alt + F7) or Go To (CTRL + Click).
By default all strings in format ':hyphen-identifier' are symbols but you can configure recognized formats in the plugin configuration page.
You can find this plugin on IntelliJ plugin repository. Take a look at IntelliJ IDEA documentation for instructions about installing plugins.
After installing, this plugin will recognize 'symbols' and will highlight them blue:
Symbols which appear only once in whole project are marked with warning:
Referenced symbols are shown without warning:
Symbol names will appear in the suggestions list (Ctrl + Space Bar):
You can easily find usages of symbol with Alt + F7:
Even more conveniently you can go to usage with Ctrl + left click:
Last but not least you can rename your symbol with Shift + F6:
You can configure recognized symbol formats in Other Settings -> JavaScript Symbols.
This plugin is definitely not finished. If you've found it useful feel free to contribute.
Build against IntelliJ IDEA Ultimate Platform SDK
- add
plugins/JavaScriptLanguage/lib/*.jar
andplugins/AngularJS/lib/*.jar
to the SDK classpath (Platform Settings->SDKs->Classpath) - build the plugin JAR with right clicking on the project -> Prepare Plugin Module 'intellij-javascript-symbols' for Deployment