Closed m-radzikowski closed 3 years ago
Looks good. Only it does not work in this case:
# Employee records
- martin:
name: Martin D'vloper
job: Developer
skills:
- python
- perl
- pascal
- tabitha:
name: Tabitha Bitumen
job: Developer
skills:
- lisp
- fortran
- erlang
java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')
at osmedile.intellij.stringmanip.transform.ConvertJsonYamlAction.yamlToJson(ConvertJsonYamlAction.java:61)
at osmedile.intellij.stringmanip.transform.ConvertJsonYamlAction.transformSelection(ConvertJsonYamlAction.java:44)
at osmedile.intellij.stringmanip.AbstractStringManipAction.executeMyWriteActionPerCaret(AbstractStringManipAction.java:91)
at osmedile.intellij.stringmanip.AbstractStringManipAction$2.perform(AbstractStringManipAction.java:72)
``
I forgot about arrays 😞
Good you caught it! Should work now.
Nice. Thanks!
A new action "Convert Between JSON and YAML".
I put it under the "Filter/Remove/Trim/Minify" group and added "Convert" to it.
I've used org.json for reading the JSON (simplest) and Gson for writing it (better formatting). Gson and SnakeYAML (used for YAML read/write) are bundled with IntelliJ.
This was my first work with IntelliJ plugin so let me know if there is anything that should be done differently.
Closes #123