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

This entry was posted in Feature and tagged , , . Bookmark the permalink.

5 Responses to Edit HTML injected inside JavaScript literals

  1. Great!
    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. Henning Koch says:

    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. @Evgeniy: Right, and we definitely are thinking about it. Thanks!

    @Henning: A great story! Thanks! :)

  4. GeekyCoder says:

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

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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>