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

//===--- SyncAPI.cpp - Sync version of ClangdServer's API --------*- 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 "SyncAPI.h"
#include "Protocol.h"
#include "index/Index.h"
#include <optional>

namespace clang {
namespace clangd {

void runAddDocument(ClangdServer &Server, PathRef File,
                    llvm::StringRef Contents, llvm::StringRef Version,
                    WantDiagnostics WantDiags, bool ForceRebuild) {}

namespace {
/// A helper that waits for async callbacks to fire and exposes their result in
/// the output variable. Intended to be used in the following way:
///    T Result;
///    someAsyncFunc(Param1, Param2, /*Callback=*/capture(Result));
template <typename T> struct CaptureProxy {};

template <typename T> CaptureProxy<T> capture(std::optional<T> &Target) {}
} // namespace

llvm::Expected<CodeCompleteResult>
runCodeComplete(ClangdServer &Server, PathRef File, Position Pos,
                clangd::CodeCompleteOptions Opts) {}

llvm::Expected<SignatureHelp> runSignatureHelp(ClangdServer &Server,
                                               PathRef File, Position Pos,
                                               MarkupKind DocumentationFormat) {}

llvm::Expected<std::vector<LocatedSymbol>>
runLocateSymbolAt(ClangdServer &Server, PathRef File, Position Pos) {}

llvm::Expected<std::vector<DocumentHighlight>>
runFindDocumentHighlights(ClangdServer &Server, PathRef File, Position Pos) {}

llvm::Expected<RenameResult> runRename(ClangdServer &Server, PathRef File,
                                       Position Pos, llvm::StringRef NewName,
                                       const RenameOptions &RenameOpts) {}

llvm::Expected<RenameResult>
runPrepareRename(ClangdServer &Server, PathRef File, Position Pos,
                 std::optional<std::string> NewName,
                 const RenameOptions &RenameOpts) {}

llvm::Expected<tooling::Replacements>
runFormatFile(ClangdServer &Server, PathRef File, std::optional<Range> Rng) {}

SymbolSlab runFuzzyFind(const SymbolIndex &Index, llvm::StringRef Query) {}

SymbolSlab runFuzzyFind(const SymbolIndex &Index, const FuzzyFindRequest &Req) {}

RefSlab getRefs(const SymbolIndex &Index, SymbolID ID) {}

llvm::Expected<std::vector<SelectionRange>>
runSemanticRanges(ClangdServer &Server, PathRef File,
                  const std::vector<Position> &Pos) {}

llvm::Expected<std::optional<clangd::Path>>
runSwitchHeaderSource(ClangdServer &Server, PathRef File) {}

llvm::Error runCustomAction(ClangdServer &Server, PathRef File,
                            llvm::function_ref<void(InputsAndAST)> Action) {}

} // namespace clangd
} // namespace clang