From 91a6f40d2d1980bcabfbf316fdb06177f9deeb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Wed, 11 Oct 2017 17:31:55 +0200 Subject: [PATCH] Match comments for unexposed entities --- src/libclang/parse_functions.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libclang/parse_functions.cpp b/src/libclang/parse_functions.cpp index a47fc15..06631eb 100644 --- a/src/libclang/parse_functions.cpp +++ b/src/libclang/parse_functions.cpp @@ -219,11 +219,16 @@ std::unique_ptr detail::parse_entity(const detail::parse_context& co detail::tokenizer tokenizer(context.tu, context.file, cur); detail::token_stream stream(tokenizer, cur); auto spelling = detail::to_string(stream, stream.end()); + + std::unique_ptr entity; if (name.empty()) - return cpp_unexposed_entity::build(std::move(spelling)); + entity = cpp_unexposed_entity::build(std::move(spelling)); else - return cpp_unexposed_entity::build(*context.idx, detail::get_entity_id(cur), - name.c_str(), std::move(spelling)); + entity = cpp_unexposed_entity::build(*context.idx, detail::get_entity_id(cur), + name.c_str(), std::move(spelling)); + + context.comments.match(*entity, cur); + return entity; } else return nullptr;