You could make a snippet that'll do this easily. Add a keybinding to trigger that snippet in keybindings.json:
{
"key": "alt+b", // or whatever keybinding you want
"command": "editor.action.insertSnippet",
"args": {
"snippet": "(${TM_SELECTED_TEXT/\\s*(.+)(\\s)?/'$1'${2:+,}/g})"
}
}
${TM_SELECTED_TEXT/\\s*(.+)(\\s)?/'$1'${2:+,}/g}
get the selected text.
The regex will get the text of each line in capture group 1, and any newline character in capture group 2.
Then 'group 1'
is added followed by a ,
only if there is a group 2. Because of the g
regex flag this will happen for all lines.
If you want empty lines to be represented as an empty strings in your output, use
"snippet": "(${TM_SELECTED_TEXT/((.+)(\\r\\n))|(.+)|(\\r\\n)/'$2$4'${3:+,}${5:+,}/g})"
Demo of this:

If you want this output of the snippet:
Select * from Table where Column in ('line1','line2','line3')
then use:
"snippet": "Select * from Table where Column in (${TM_SELECTED_TEXT/\\s*(.+)(\\s)?/'$1'${2:+,}/g})"