8

Is there an easy way to get selected text into a variable similar to native variable ${lineNumber} which is the current selected line number? It would be very useful as a parameter for link to online help etc. Thank you.

Pavel Vicha
  • 91
  • 1
  • 6
  • 11
    the easiest way you can get the current selected text I know of is... const editor = vscode.window.activeTextEditor; var selection = editor.selection; var text = editor.document.getText(selection); – sreenivas Oct 01 '17 at 17:16

1 Answers1

2

It will be $(selectedText} once this vscode github code is released.

Edit: It's actually available now.