rjsx-mode icon indicating copy to clipboard operation
rjsx-mode copied to clipboard

Vanish tag

Open felipeochoa opened this issue 6 years ago • 0 comments

Especially with React 16, it would be nice to have a single command to unwrap the children of a tag and splice them into the surroundings:

let c = <Parent><Child/><Parent>; // point on Parent

after vanishing parent should give:

let c = <Child/>; // point right before Child
  • [X] Initial implementation
  • [ ] Clean up whitespace outside the removed tag (e.g., extra newlines)
  • [ ] Clean up whitespace when first/last child are text nodes
  • [ ] Fix indentation for children
  • [ ] If only child is text, wrap it in quotes
  • [ ] Set point and mark to the start/end of the child region (or reversed if point was on the closer)
  • [ ] Add tests

felipeochoa avatar Sep 28 '17 08:09 felipeochoa