Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clangd/ConfigCompile.cpp
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | if (!F.Source.Directory.empty()) { | ||||
if (FragmentDirectory.back() != '/') | if (FragmentDirectory.back() != '/') | ||||
FragmentDirectory += '/'; | FragmentDirectory += '/'; | ||||
} | } | ||||
compile(std::move(F.If)); | compile(std::move(F.If)); | ||||
compile(std::move(F.CompileFlags)); | compile(std::move(F.CompileFlags)); | ||||
compile(std::move(F.Index)); | compile(std::move(F.Index)); | ||||
compile(std::move(F.Diagnostics)); | compile(std::move(F.Diagnostics)); | ||||
compile(std::move(F.Completion)); | compile(std::move(F.Completion)); | ||||
compile(std::move(F.Hover)); | |||||
} | } | ||||
void compile(Fragment::IfBlock &&F) { | void compile(Fragment::IfBlock &&F) { | ||||
if (F.HasUnrecognizedCondition) | if (F.HasUnrecognizedCondition) | ||||
Out.Conditions.push_back([&](const Params &) { return false; }); | Out.Conditions.push_back([&](const Params &) { return false; }); | ||||
#ifdef CLANGD_PATH_CASE_INSENSITIVE | #ifdef CLANGD_PATH_CASE_INSENSITIVE | ||||
llvm::Regex::RegexFlags Flags = llvm::Regex::IgnoreCase; | llvm::Regex::RegexFlags Flags = llvm::Regex::IgnoreCase; | ||||
▲ Show 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | void compile(Fragment::CompletionBlock &&F) { | ||||
if (F.AllScopes) { | if (F.AllScopes) { | ||||
Out.Apply.push_back( | Out.Apply.push_back( | ||||
[AllScopes(**F.AllScopes)](const Params &, Config &C) { | [AllScopes(**F.AllScopes)](const Params &, Config &C) { | ||||
C.Completion.AllScopes = AllScopes; | C.Completion.AllScopes = AllScopes; | ||||
}); | }); | ||||
} | } | ||||
} | } | ||||
void compile(Fragment::HoverBlock &&F) { | |||||
if (F.AKAPrint) { | |||||
Out.Apply.push_back([AKAPrint(**F.AKAPrint)](const Params &, Config &C) { | |||||
C.Hover.AKAPrint = AKAPrint; | |||||
}); | |||||
} | |||||
} | |||||
constexpr static llvm::SourceMgr::DiagKind Error = llvm::SourceMgr::DK_Error; | constexpr static llvm::SourceMgr::DiagKind Error = llvm::SourceMgr::DK_Error; | ||||
constexpr static llvm::SourceMgr::DiagKind Warning = | constexpr static llvm::SourceMgr::DiagKind Warning = | ||||
llvm::SourceMgr::DK_Warning; | llvm::SourceMgr::DK_Warning; | ||||
void diag(llvm::SourceMgr::DiagKind Kind, llvm::StringRef Message, | void diag(llvm::SourceMgr::DiagKind Kind, llvm::StringRef Message, | ||||
llvm::SMRange Range) { | llvm::SMRange Range) { | ||||
if (Range.isValid() && SourceMgr != nullptr) | if (Range.isValid() && SourceMgr != nullptr) | ||||
Diagnostic(SourceMgr->GetMessage(Range.Start, Kind, Message, Range)); | Diagnostic(SourceMgr->GetMessage(Range.Start, Kind, Message, Range)); | ||||
else | else | ||||
Show All 30 Lines |