diff --git a/src/source_clang.cc b/src/source_clang.cc index 2ed5be5..52c954e 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -122,6 +122,7 @@ void Source::ClangViewParse::parse_initialize() { auto expected=ParseProcessState::PROCESSING; if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::POSTPROCESSING)) { clang_tokens=clang_tu->get_tokens(0, parse_thread_buffer.bytes()-1); + diagnostics=clang_tu->get_diagnostics(); parse_lock.unlock(); dispatcher.post([this] { std::unique_lock parse_lock(parse_mutex, std::defer_lock); @@ -257,7 +258,6 @@ void Source::ClangViewParse::update_diagnostics() { fix_its.clear(); get_buffer()->remove_tag_by_name("def:warning_underline", get_buffer()->begin(), get_buffer()->end()); get_buffer()->remove_tag_by_name("def:error_underline", get_buffer()->begin(), get_buffer()->end()); - auto diagnostics=clang_tu->get_diagnostics(); size_t num_warnings=0; size_t num_errors=0; size_t num_fix_its=0; diff --git a/src/source_clang.h b/src/source_clang.h index ba1dfe8..ac7b7e8 100644 --- a/src/source_clang.h +++ b/src/source_clang.h @@ -53,7 +53,9 @@ namespace Source { void update_syntax(); std::set last_syntax_tags; + void update_diagnostics(); + std::vector diagnostics; static clang::Index clang_index; std::vector get_compilation_commands();