Edit HTML injected inside JavaScript literals

It often happens that we need to edit HTML code inside JavaScript literals. And most of the time it is something involving trial-and-error and not too pleasant in result. But not within RubyMine!

Here is a simple string…

But once you add '<' inside it, it becomes a superstring more than just a string and if you hit Ctrl+Space, you can see the difference. Yes, you get all HTML code assistance inside a JS literal!

You can of course complete tag attributes…

and you have anything else you’d expect…

…including code completion, quick documentation, and navigation for HTML, CSS and even JavaScript inside JavaScript literals.

Using RubyMine IDE already?   Following @rubymine on Twitter?   Tried the latest Early Access build?

Develop with pleasure!
JetBrains Team

Comments below can no longer be edited.

5 Responses to Edit HTML injected inside JavaScript literals

  1. Avatar

    Evgeniy Dolzhenko says:

    March 23, 2010

    The next step would be probably JavaScript inside of the string literals in Ruby, or JavaScript itself. That would nicely work for CouchDB views and alike http://wiki.apache.org/couchdb/HTTP_view_API?action=show&redirect=HttpViewApi

  2. Avatar

    Henning Koch says:

    March 23, 2010

    Boy did RubyMine creep me out when it warned me of a mismatched pair of HTML tags inside a Javascript String. I called a coworker over and was all like RubyMine can’t know that, can it?.

  3. Avatar

    Eugene Toporov says:

    March 25, 2010

    @Evgeniy: Right, and we definitely are thinking about it. Thanks!

    @Henning: A great story! Thanks! 🙂

  4. Avatar

    GeekyCoder says:

    March 28, 2010

    Will this useful feature be added in Intellij’s ruby plugin as well ?

  5. Avatar

    Eugene Toporov says:

    March 30, 2010

    @GeekyCoder: sure! This feature is available in IntelliJ IDEA by default.

Discover more