Skip to content

Commit 91a6f40

Browse files
committed
Match comments for unexposed entities
1 parent 0723bea commit 91a6f40

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/libclang/parse_functions.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,16 @@ std::unique_ptr<cpp_entity> detail::parse_entity(const detail::parse_context& co
219219
detail::tokenizer tokenizer(context.tu, context.file, cur);
220220
detail::token_stream stream(tokenizer, cur);
221221
auto spelling = detail::to_string(stream, stream.end());
222+
223+
std::unique_ptr<cppast::cpp_entity> entity;
222224
if (name.empty())
223-
return cpp_unexposed_entity::build(std::move(spelling));
225+
entity = cpp_unexposed_entity::build(std::move(spelling));
224226
else
225-
return cpp_unexposed_entity::build(*context.idx, detail::get_entity_id(cur),
226-
name.c_str(), std::move(spelling));
227+
entity = cpp_unexposed_entity::build(*context.idx, detail::get_entity_id(cur),
228+
name.c_str(), std::move(spelling));
229+
230+
context.comments.match(*entity, cur);
231+
return entity;
227232
}
228233
else
229234
return nullptr;

0 commit comments

Comments
 (0)