37 lines · c
1//===--- IndexAction.h - Run the indexer as a frontend action ----*- C++-*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEXACTION_H10#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEXACTION_H11#include "Headers.h"12#include "index/SymbolCollector.h"13#include "clang/Frontend/FrontendAction.h"14 15namespace clang {16namespace clangd {17 18// Creates an action that indexes translation units and delivers the results19// for SymbolsCallback (each slab corresponds to one TU).20//21// Only a subset of SymbolCollector::Options are respected:22// - include paths are always collected, and canonicalized appropriately23// - references are always counted24// - all references are collected (if RefsCallback is non-null)25// - the symbol origin is set to Static if not specified by caller26std::unique_ptr<FrontendAction> createStaticIndexingAction(27 SymbolCollector::Options Opts,28 std::function<void(SymbolSlab)> SymbolsCallback,29 std::function<void(RefSlab)> RefsCallback,30 std::function<void(RelationSlab)> RelationsCallback,31 std::function<void(IncludeGraph)> IncludeGraphCallback);32 33} // namespace clangd34} // namespace clang35 36#endif37