vscode-javascript-booster icon indicating copy to clipboard operation
vscode-javascript-booster copied to clipboard

Feature request: expand/collapse object/arrays declaration

Open enzoclock opened this issue 3 years ago • 2 comments
trafficstars

Hi 👋 Thanks for this very useful extension 🙏

I was looking for a code action to split/merge an array into multiple/single lines, like so:

I found this extension which works fine. But I suppose it can be a nice addition to JS-booster, with the usual quick-action trigger.

Would it be interesting?

enzoclock avatar Mar 03 '22 21:03 enzoclock

Hey @enzoclock, Thanks for the idea! I wonder, what would be the use case for this action in JavaScript/TypeScript code? I would expect most people to use Prettier for automated code formatting, which would eliminate the results of this action. 🤔

xsburg avatar Mar 04 '22 04:03 xsburg

Hey @xsburg I'm reading from the Prettier doc that this feature exists, but yet is considered as a "workaround-feature" since there aren't obvious reversibility rules.

Personally, I wouldn't mind having to decide when to expand/collapse an object/array, depending on the code context, rather than having automatic fixing. Wdyt?

Also, I've read this feature exists for webstorm :)

enzoclock avatar Mar 04 '22 07:03 enzoclock