mirror of
https://github.com/MaskRay/ccls.git
synced 2024-12-01 20:07:08 +00:00
Compare commits
3 Commits
87d3f9d89c
...
e71ab5eea1
Author | SHA1 | Date | |
---|---|---|---|
|
e71ab5eea1 | ||
|
4331c89586 | ||
|
5d401fc95d |
@ -124,9 +124,11 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
|
||||
args.insert(args.begin() + 1, std::begin(arr), std::end(arr));
|
||||
}
|
||||
|
||||
IntrusiveRefCntPtr<DiagnosticsEngine> diags(
|
||||
CompilerInstance::createDiagnostics(new DiagnosticOptions,
|
||||
new IgnoringDiagConsumer, true));
|
||||
IntrusiveRefCntPtr<DiagnosticsEngine> diags(CompilerInstance::createDiagnostics(
|
||||
#if LLVM_VERSION_MAJOR >= 20
|
||||
*vfs,
|
||||
#endif
|
||||
new DiagnosticOptions, new IgnoringDiagConsumer, true));
|
||||
#if LLVM_VERSION_MAJOR < 12 // llvmorg-12-init-5498-g257b29715bb
|
||||
driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, vfs);
|
||||
#else
|
||||
|
@ -1312,7 +1312,11 @@ index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs,
|
||||
IndexDiags dc;
|
||||
auto clang = std::make_unique<CompilerInstance>(pch);
|
||||
clang->setInvocation(std::move(ci));
|
||||
clang->createDiagnostics(&dc, false);
|
||||
clang->createDiagnostics(
|
||||
#if LLVM_VERSION_MAJOR >= 20
|
||||
*fs,
|
||||
#endif
|
||||
&dc, false);
|
||||
clang->getDiagnostics().setIgnoreAllWarnings(true);
|
||||
clang->setTarget(TargetInfo::CreateTargetInfo(
|
||||
clang->getDiagnostics(), clang->getInvocation().TargetOpts));
|
||||
|
@ -27,26 +27,28 @@ REFLECT_STRUCT(SymbolInformation, name, kind, location, containerName);
|
||||
|
||||
void MessageHandler::workspace_didChangeConfiguration(JsonReader &reader) {
|
||||
auto it = reader.m->FindMember("settings");
|
||||
if (it != reader.m->MemberEnd() && it->value.IsObject()) {
|
||||
rapidjson::StringBuffer output;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(output);
|
||||
JsonReader m1(&it->value);
|
||||
it->value.Accept(writer);
|
||||
LOG_S(INFO) << "didChangeConfiguration: " << output.GetString();
|
||||
try {
|
||||
reflect(m1, *g_config);
|
||||
} catch (std::invalid_argument &) {
|
||||
reader.path_.push_back("settings");
|
||||
reader.path_.insert(reader.path_.end(), m1.path_.begin(), m1.path_.end());
|
||||
throw;
|
||||
}
|
||||
if (!(it != reader.m->MemberEnd() && it->value.IsObject()))
|
||||
return;
|
||||
|
||||
for (auto &[folder, _] : g_config->workspaceFolders)
|
||||
project->load(folder);
|
||||
project->index(wfiles, RequestId());
|
||||
|
||||
manager->clear();
|
||||
// Similar to MessageHandler::initialize.
|
||||
rapidjson::StringBuffer output;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(output);
|
||||
JsonReader m1(&it->value);
|
||||
it->value.Accept(writer);
|
||||
LOG_S(INFO) << "didChangeConfiguration: " << output.GetString();
|
||||
try {
|
||||
reflect(m1, *g_config);
|
||||
} catch (std::invalid_argument &) {
|
||||
reader.path_.push_back("settings");
|
||||
reader.path_.insert(reader.path_.end(), m1.path_.begin(), m1.path_.end());
|
||||
throw;
|
||||
}
|
||||
|
||||
for (auto &[folder, _] : g_config->workspaceFolders)
|
||||
project->load(folder);
|
||||
project->index(wfiles, RequestId());
|
||||
|
||||
manager->clear();
|
||||
}
|
||||
|
||||
void MessageHandler::workspace_didChangeWatchedFiles(
|
||||
|
@ -288,7 +288,11 @@ buildCompilerInstance(Session &session, std::unique_ptr<CompilerInvocation> ci,
|
||||
|
||||
auto clang = std::make_unique<CompilerInstance>(session.pch);
|
||||
clang->setInvocation(std::move(ci));
|
||||
clang->createDiagnostics(&dc, false);
|
||||
clang->createDiagnostics(
|
||||
#if LLVM_VERSION_MAJOR >= 20
|
||||
*fs,
|
||||
#endif
|
||||
&dc, false);
|
||||
clang->setTarget(TargetInfo::CreateTargetInfo(
|
||||
clang->getDiagnostics(), clang->getInvocation().TargetOpts));
|
||||
if (!clang->hasTarget())
|
||||
@ -368,8 +372,11 @@ void buildPreamble(Session &session, CompilerInvocation &ci,
|
||||
#endif
|
||||
|
||||
StoreDiags dc(task.path);
|
||||
IntrusiveRefCntPtr<DiagnosticsEngine> de =
|
||||
CompilerInstance::createDiagnostics(&ci.getDiagnosticOpts(), &dc, false);
|
||||
IntrusiveRefCntPtr<DiagnosticsEngine> de = CompilerInstance::createDiagnostics(
|
||||
#if LLVM_VERSION_MAJOR >= 20
|
||||
*fs,
|
||||
#endif
|
||||
&ci.getDiagnosticOpts(), &dc, false);
|
||||
if (oldP) {
|
||||
std::lock_guard lock(session.wfiles->mutex);
|
||||
for (auto &include : oldP->includes)
|
||||
|
Loading…
Reference in New Issue
Block a user