src/vs/editor/contrib/linesOperations/linesOperations.ts/DuplicateSelectionAction/run
class DuplicateSelectionAction:	public run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {
		if (!editor.hasModel()) {
			return;
		}

		const commands: ICommand[] = [];
		const selections = editor.getSelections();
		const model = editor.getModel();

		for (const selection of selections) {
			if (selection.isEmpty()) {
				commands.push(new CopyLinesCommand(selection, true));
			} else {
				const insertSelection = new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn);
				commands.push(new ReplaceCommandThatSelectsText(insertSelection, model.getValueInRange(selection)));
			}
		}

		editor.pushUndoStop();
		editor.executeCommands(this.id, commands);
		editor.pushUndoStop();
	}