File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -206,13 +206,17 @@ inline json encode(const CodeCompletionString *ccs) {
206
206
}
207
207
208
208
inline json encode (const CodeCompletionResult &cc, const CodeCompletionString *ccs, const SourceManager &sm) {
209
- // TODO: To obtain the complete documentation comment we must
210
- // explore cc.Declaration AST
211
- // cc.Declaration->dump();
212
-
213
209
json res = json{
214
210
{" completion" , encode (ccs)}
215
211
};
212
+
213
+ // Extract doxygen comment if available
214
+ ASTContext& ast = cc.Declaration ->getASTContext ();
215
+ RawComment* comment = ast.getRawCommentForDeclNoCache (cc.Declaration );
216
+ if (comment) {
217
+ res[" doxy" ] = comment->getRawText (sm).str ();
218
+ }
219
+
216
220
switch (cc.Kind ) {
217
221
case CodeCompletionResult::RK_Declaration:
218
222
{
You can’t perform that action at this time.
0 commit comments