First, you need to create the two Position objects:
const pos1 = new vscode.Position(line1, col1); const pos2 = new vscode.Position(line2, col2); Second, create a Selection using pos1 as the anchor position and pos2 as the active position:
const sel = new vscode.Selection(pos1, pos2)