marclipovsky / vscode-string-manipulation

VSCode extension to add common string manipulation
26 stars 6 forks source link

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

Open minalike opened 2 years ago

minalike commented 2 years ago

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

marclipovsky commented 2 years ago

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?

minalike commented 2 years ago

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.

marclipovsky commented 2 years ago

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

marclipovsky commented 1 year ago

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

minalike commented 1 year ago

Awesome!