37 return ASTSelection.takeError();
38 std::unique_ptr<SelectedASTNode> StoredSelection =
39 std::make_unique<SelectedASTNode>(std::move(*ASTSelection));
40 std::optional<CodeRangeASTSelection> CodeRange =
44 return Context.createDiagnosticError(
45 Context.getSelectionRange().getBegin(),
46 diag::err_refactor_selection_invalid_ast);
47 Context.setASTSelection(std::move(StoredSelection));
48 return std::move(*CodeRange);