HOCON Converter

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
Feb 17, 2019
73
This is a plugin for Intellij IDEA which converts HOCON back and forth between map-like and property-like formats.

This can be really useful when you need to change Spring property keys (which are resolved like
    "${aaa.bbb.ccc.ddd}"
and your files are in .conf format, like
    aaa {
      bbb {
        ccc {
          ddd = "some value"
        }
      }
    }

Simply convert the .conf-style file into property-style, then you can search/replace

Features completed

  • read in basic properties-formatted file with simple key/value pairs
  • read in basic conf-formatted file wiht simple key/value pairs & maps
  • Keep "include" at top of file (in order)
  • Top-level lists, like this:
  • cors = [
      "xxxx",
      "yyyy"
    ]
    
What's NOT working
  • Comments
  • Lists inside maps or other lists (only top-level lists are working currently)
Planned features
  • Tie comments to line that follows (currently comments are lost)
  • Auto-detection of if the text is from a .yml file - if so, then it needs to be indented after the `app |-` line

Download plugin

Recent change notes

  • 0.2.2 Feature - optional flattened keys on map-style output. Instead of this:
    aaa {
      bbb {
        ddd {
          eee = 5
        }
      }
      ccc = 4
    }
    you get this:
    aaa {
      bbb.ddd.eee = 5
      ccc = 4
    } 
    This can be set in the Preferences panel (under the "Other Settings/HOCON Converter" menu)
  • 0.2.1 Bug fix - deal with parsing partially flattened keys, like
    aaa.bbb {
    ddd.eee = 5
    }
  • 0.1.0 Initial release