llvm/clang-tools-extra/clangd/unittests/RenameTests.cpp

//===-- RenameTests.cpp -----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "Annotations.h"
#include "ClangdServer.h"
#include "SyncAPI.h"
#include "TestFS.h"
#include "TestTU.h"
#include "index/Ref.h"
#include "refactor/Rename.h"
#include "support/TestTracer.h"
#include "clang/Tooling/Core/Replacement.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include <algorithm>
#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace clang {
namespace clangd {
namespace {

ElementsAre;
Eq;
IsEmpty;
Pair;
SizeIs;
UnorderedElementsAre;
UnorderedElementsAreArray;

llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>
createOverlay(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> Base,
              llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> Overlay) {}

llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> getVFSFromAST(ParsedAST &AST) {}

// Convert a Range to a Ref.
Ref refWithRange(const clangd::Range &Range, const std::string &URI) {}

// Build a RefSlab from all marked ranges in the annotation. The ranges are
// assumed to associate with the given SymbolName.
std::unique_ptr<RefSlab> buildRefSlab(const Annotations &Code,
                                      llvm::StringRef SymbolName,
                                      llvm::StringRef Path) {}

std::vector<
    std::pair</*FilePath*/ std::string, /*CodeAfterRename*/ std::string>>
applyEdits(FileEdits FE) {}

// Generates an expected rename result by replacing all ranges in the given
// annotation with the NewName.
std::string expectedResult(Annotations Test, llvm::StringRef NewName) {}

std::vector<SymbolRange> symbolRanges(llvm::ArrayRef<Range> Ranges) {}

TEST(RenameTest, WithinFileRename) {}

TEST(RenameTest, ObjCWithinFileRename) {}

TEST(RenameTest, Renameable) {}

MATCHER_P(newText, T, "") {}

TEST(RenameTest, IndexMergeMainFile) {}

TEST(RenameTest, MainFileReferencesOnly) {}

TEST(RenameTest, NoRenameOnSymbolsFromSystemHeaders) {}

TEST(RenameTest, ProtobufSymbolIsExcluded) {}

TEST(RenameTest, PrepareRename) {}

TEST(CrossFileRenameTests, DirtyBuffer) {}

TEST(CrossFileRenameTests, DeduplicateRefsFromIndex) {}

TEST(CrossFileRenameTests, WithUpToDateIndex) {}

TEST(CrossFileRenameTests, ObjC) {}

TEST(CrossFileRenameTests, CrossFileOnLocalSymbol) {}

TEST(CrossFileRenameTests, BuildRenameEdits) {}

TEST(CrossFileRenameTests, adjustRenameRanges) {}

TEST(RangePatchingHeuristic, GetMappedRanges) {}

TEST(CrossFileRenameTests, adjustmentCost) {}

} // namespace
} // namespace clangd
} // namespace clang