Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions clang-tools-extra/clangd/tool/ClangdMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Config.h"
#include "ConfigProvider.h"
#include "Feature.h"
#include "FeatureModuleSet.h"
#include "IncludeCleaner.h"
#include "PathMapping.h"
#include "Protocol.h"
Expand Down Expand Up @@ -712,6 +713,10 @@ enum class ErrorResultCode : int {
};

int clangdMain(int argc, char *argv[]) {
return clangdMain(arc, argv, nullptr);
}

int clangdMain(int argc, char *argv[], FeatureModuleSet* FeatureModules) {
// Clang could run on the main thread. e.g., when the flag '-check' or '-sync'
// is enabled.
clang::noteBottomOfStack();
Expand Down Expand Up @@ -898,6 +903,7 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var
Opts.StaticIndex = PAI.get();
Opts.AsyncThreadsCount = WorkerThreadsCount;
Opts.MemoryCleanup = getMemoryCleanupFunction();
Opts.FeatureModules = FeatureModules;

Opts.CodeComplete.IncludeIneligibleResults = IncludeIneligibleResults;
Opts.CodeComplete.Limit = LimitResults;
Expand Down
2 changes: 2 additions & 0 deletions clang-tools-extra/clangd/tool/ClangdMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

namespace clang {
namespace clangd {
class FeatureModuleSet;
// clangd main function (clangd server loop)
int clangdMain(int argc, char *argv[]);
int clangdMain(int argc, char *argv[], FeatureModuleSet *FeatureModules);
} // namespace clangd
} // namespace clang

Expand Down