windwp / vscode-expand-region

porting sublime-expand-region to visual code
GNU General Public License v3.0
57 stars 23 forks source link

Please add expansion step for variable #33

Open amoliski opened 2 years ago

amoliski commented 2 years ago

Is it possible to add an expansion step to select the variable name and equals sign when expanding an object?

Ex:

if(cond === 1) {
  console.log('cond is 1')
    const a = {
      a: 5,
      b: 5,
      c: 12,
    }
  console.log(a);
}

If the brackets are selected:

const a = { a: 5, b: 5, c: 12, }

And you press ctrl+w, it should expand to: if(cond === 1){ console.log('cond is 1') const a = { a: 5, b: 5, c: 12, } console.log(a); }

but it instead selects the entire contents of the 'if' conditional block

if(cond === 1){ console.log('cond is 1') const a = { a: 5, b: 5, c: 12, } console.log(a); }