vscode-string-manipulation icon indicating copy to clipboard operation
vscode-string-manipulation copied to clipboard

Feature request: convert single quotes to double quotes and vice-versa

Open minalike opened this issue 2 years ago • 5 comments

The ability to convert ' characters to " and vice versa would be very nice!

minalike avatar May 01 '22 16:05 minalike

Oh good call. This can get tricky when single quotes are inside double and vv.

Two options for actions:

  1. A single action that swap all quotes with their counter part so "foo is 'bar'" would be updated to 'foo is "bar"'
  2. Two actions where only single get swapped or double get swapped.
  3. BONUS: Do 1 and 2 :)

What do you think @minalike?

marclipovsky avatar May 04 '22 19:05 marclipovsky

For my needs, I only need option 1! 😄

My use case scenario is: I'll have a long list of strings (think of an output of df.columns from pandas) that I'll copy/paste into my editor. Pandas uses single quotes, but I prefer double quotes.

One thing you'll have to think of is the desired behavior when you're starting from "my name's minalike" - in this scenario I would want the output to be 'my name\'s minalike' since in that context ' is an apostrophe, not a paired quote.

minalike avatar May 04 '22 20:05 minalike

Got it. Alright let me sit on this one a bit and see if there's more interest in this too.

marclipovsky avatar May 07 '22 03:05 marclipovsky

Hey @minalike I'll get to this this week.

marclipovsky avatar Apr 12 '23 00:04 marclipovsky

Awesome!

minalike avatar Apr 12 '23 06:04 minalike