From f9aa0ef66d1a87a17b802135a88fedc2daf415d3 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 31 Dec 2017 15:55:55 -0800 Subject: [PATCH] [formatting] Refrain from std::make_unique until migration to C++14 or C++17 --- src/messages/text_document_formatting.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/messages/text_document_formatting.cc b/src/messages/text_document_formatting.cc index f196bc7a..343e9448 100644 --- a/src/messages/text_document_formatting.cc +++ b/src/messages/text_document_formatting.cc @@ -60,10 +60,11 @@ struct TextDocumentFormattingHandler int tab_size = request->params.options.tabSize; bool insert_spaces = request->params.options.insertSpaces; - const auto clang_format = std::unique_ptr(new ClangFormat( + const auto clang_format = MakeUnique( working_file->filename, working_file->buffer_content, - {clang::tooling::Range(0, working_file->buffer_content.size())}, - tab_size, insert_spaces)); + llvm::ArrayRef( + clang::tooling::Range(0, working_file->buffer_content.size())), + tab_size, insert_spaces); const auto replacements = clang_format->FormatWholeDocument(); response.result = ConvertClangReplacementsIntoTextEdits( working_file->buffer_content, replacements);