I'm attempting to extract the selected text and format it with line breaks for a VSCODE Extension.
const document = editor.document;
const selection = editor.selection;
const position = editor.selection.end;
const word = document.getText(selection);
I haven't been able to figure out how to separate the selection into an array.
Could someone provide a solution and a link to the API documentation for the document constructor?
I also tried using .split("\n") without success.