Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
Source Link
Robin Green
  • 999
  • 7
  • 17

Outline editing, like org-mode, for JSON

I am trying to edit a Swagger JSON file in emacs. It contains large nested JSON objects, so I want to collapse and hide some of them.

I have tried origami-mode, configured as origami-c-style-parser in origami-parser-alist, but it is quite unsophisticated (the word "parser" seems to be an overly grandiose word for what it does). It doesn't notice that Swagger URL parameter substrings like {id} are inside JSON strings, so it happily collapses them too when I ask it to collapse all nodes in the buffer except the current node. I don't want it to do that. I want a way of collapsing only JSON subtrees like objects, not substrings of JSON strings that happen to have curly braces in them. How can I achieve this goal?