================ @@ -0,0 +1,55 @@ +//===------------------ ProjectModules.h -------------------------*- 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_PROJECTMODULES_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_PROJECTMODULES_H + +#include "ModuleDependencyScanner.h" + +namespace clang { +namespace clangd { + +/// An interface to query the modules information in the project. +/// This should be obtained by +/// `GlobalCompilationDatabase::getProjectModules(PathRef)`. +/// +/// TODO: The existing `ScanningAllProjectModules` is not efficient. See the +/// comments in ModuleDependencyScanner for detail. +class ProjectModules { +public: + virtual std::vector<std::string> getRequiredModules(PathRef File) = 0; + virtual PathRef getSourceForModuleName(StringRef ModuleName) = 0; +}; + +class ScanningAllProjectModules : public ProjectModules { ---------------- ChuanqiXu9 wrote:
Done https://github.com/llvm/llvm-project/pull/66462 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits