Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Format a blob of code?

$
0
0

There's often the case that I get a blob of Ruby code from the console, and I want it to be formatted nicely for maximum readability. For example:

{:daterange=>[{:start=>Thu, 15 Aug 2013 00:00:00 +0000, :end=>Wed, 21 Aug 2013 00:00:00 +0000}, {:start=>Fri, 23 Aug 2013 00:00:00 +0000, :end=>Tue, 27 Aug 2013 00:00:00 +0000}], :stats=>[{:total_units=>1234, ...

 

I would like to format this to:

{

  :daterange=>[

    {

      :start=>Thu, 15 Aug 2013 00:00:00 +0000,

      :end=>Wed, 21 Aug 2013 00:00:00 +0000

    },

    {

      :start=>Fri, 23 Aug 2013  00:00:00 +0000,

      :end=>Tue, 27 Aug 2013 00:00:00 +0000

    }

  ],

  ...

 

Code -> Reformat Code looks like the most likely candidate, but it doesn't break up my blob into multiple lines with nice indentation.

 

What can I do?


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>