llvm/clang-tools-extra/clangd/unittests/ConfigTesting.h

//===-- ConfigTesting.h - Helpers for configuration tests -------*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_CONFIGTESTING_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_CONFIGTESTING_H

#include "Protocol.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/SourceMgr.h"
#include "gmock/gmock.h"
#include <functional>
#include <optional>

namespace clang {
namespace clangd {
namespace config {

// Provides a DiagnosticsCallback that records diganostics.
// Unlike just pushing them into a vector, underlying storage need not survive.
struct CapturedDiags {};

MATCHER_P(diagMessage, M, "") {}
MATCHER_P(diagKind, K, "") {}
MATCHER_P(diagPos, P, "") {}
MATCHER_P(diagRange, R, "") {}

inline Position toPosition(llvm::SMLoc L, const llvm::SourceMgr &SM) {}

inline Range toRange(llvm::SMRange R, const llvm::SourceMgr &SM) {}

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

#endif