diff --git a/src/diagnostics_engine.cc b/src/diagnostics_engine.cc index 15253d1d..36453ea2 100644 --- a/src/diagnostics_engine.cc +++ b/src/diagnostics_engine.cc @@ -13,6 +13,11 @@ void DiagnosticsEngine::Init(Config* config) { void DiagnosticsEngine::Publish(WorkingFiles* working_files, std::string path, std::vector diagnostics) { + // Cache diagnostics so we can show fixits. + working_files->DoActionOnFile(path, [&](WorkingFile* working_file) { + if (working_file) + working_file->diagnostics_ = diagnostics; + }); int64_t now = std::chrono::duration_cast( diff --git a/src/import_pipeline.cc b/src/import_pipeline.cc index 03d8f47c..3fcff636 100644 --- a/src/import_pipeline.cc +++ b/src/import_pipeline.cc @@ -408,12 +408,6 @@ void ParseFile(Config* config, for (std::unique_ptr& new_index : *indexes) { Timer time; - // Cache diagnostics so we can show fixits. - working_files->DoActionOnFile(path, [&](WorkingFile* working_file) { - if (working_file) - working_file->diagnostics_ = diagnostics; - }); - // Only emit diagnostics for non-interactive sessions, which makes it easier // to identify indexing problems. For interactive sessions, diagnostics are // handled by code completion.