sansarip / owlbear

An experimental Visual Studio Code extension that supports paredit-like structural-editing features for HTML, TypeScript, TypeScript-React, JavaScript, and JavaScript-React.
https://sansarip.github.io/owlbear/
MIT License
36 stars 2 forks source link

As a User, I would like to splice elements #101

Closed sansarip closed 1 year ago

sansarip commented 1 year ago

Description

As a User, given that my cursor is in/on a TS/X or HTML subject and the TS/X or HTML subject has children, when I execute the splice command, then the contents of the subject node should take its place

Definition of Done

Before:

= cursor position

const App = () => {
  const name:string = "World";
  return (
    <React.Fragment>
      ▌<div>
        <h1>Hello</h1>
        <h2>{name}!</h2>
      </div>
    </React.Fragment>
  );
};

VS Code splice command

After:

const App = () => {
  const name:string = "World";
  return (
    <React.Fragment>
      ▌<h1>Hello</h1>
       <h2>{name}!</h2>
    </React.Fragment>
  );
};