Giter VIP home page Giter VIP logo

line-breaker's Introduction

Line breaker

Logo

  • This line-breaker is a VS code extension that would switch between single and multi line format for texts with brackets.
  • The operation is made in the most simple way:
  • Step 1: choose target text by either
    • Simply put the cursor at the open bracket or close bracket line. (Recommended)
    • Select the text by mouse.
  • Step 2: Trigger the Switch by either of below
    • Hot key: Ctrl + Alt + L (Recommended)
    • Type Command + P to open VS Code Command Palette and input >switch between... then click to execute.

Supported switches:

Simple Object

From

 return { a: 'a', b: true }; 

to below and vice versa.

  return {
    a: 'a',
    b: true
  }; 

Function Params

From

const functionA = ({ param1, param2, param3, })

to below and vice versa.

const functionA = ({ 
  param1,
  param2,
  param3,
}) => {
  // some code
};

Nested Object

From

export const nestedObject = {
  moderation: {
    approve: 'models.approve.post',
    reject: 'models.reject.post',
    moderation: {
      approve: 'models.approve.post',
      reject: 'models.reject.post'
    }
  }
}

to below and vice versa.

export const nestedObject = { moderation: { approve: 'models.approve.post', reject: 'models.reject.post', moderation: { approve: 'models.approve.post', reject: 'models.reject.post' } } }

Github Link: line-breaker

line-breaker's People

Contributors

zhengxin-wang avatar

Stargazers

 avatar  avatar

Watchers

 avatar

line-breaker's Issues

[FEATURE] User experience improvement

Hi @zhengxin-wang

Could you please consider switch interaction while formatting the object:

Reproduce Steps:

Step1. Select lines you want to change
image

Step2. Tap ALT + CTRL + L
image

Step3. For now, if I tap ALT + CTRL + L, we can not switch back, and got this error
image

Is there any possibility to enable users to switch back and forth without doing something manually, which means I can still switch back as one line on Step3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.