[cfe-dev] libclang documentation/comments API
Manuel Klimek via cfe-dev
cfe-dev at lists.llvm.org
Tue Sep 8 02:23:39 PDT 2015
On Sun, Sep 6, 2015 at 6:54 PM Ben Jackson via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Hi there,
>
> I’m working on a feature for querying and returning documentation data in
> a libclang-based code comprehension engine (ycmd -
> https://github.com/Valloric/ycmd ). The idea is, for a given cursor,
> return meaningful documentation for display to a user in their IDE (i.e.
> “What is the doxygen documentation for the method under my cursor?” ).
>
\o/ Awesome
> I have found that there is quite rich support for doxygen comment parsing
> within clang, and most (all?) of it is exposed in libclang. This is
> awesome! Thanks!
>
> However, I do have a few questions about the current level of support:
>
> 1. The “comment introspection” API is not listed (here:
> http://clang.llvm.org/doxygen/modules.html) as part of “libclang”. Does
> that mean that the API is not public or not stable in some way? The docs
> say “These facilities are distinct from the core and may be subject to
> their own schedule of stability and deprecation”… I’m just curious as to
> how much this is likely to be an issue?
>
Unlikely to be an issue. I think the case is simply that the comment
parsing stuff is newer than a lot of the things that are considered very
very stable.
> 2. Is there any way via libclang to get the raw text, or any other
> pretty-printed text, of a particular declaration? The idea here is that I
> could present the declaration text, followed by its brief and any other
> documentation. The declaration text itself is probably the most
> useful documentation for a developer :).Currently I am actually getting
> this by calling clang_FullComment_getAsXML() and parsing the output to get
> the “<Declaration>” element, but that seems painfully wasteful.
>
> 3. I guess finally, do you have any other thoughts or has anyone
> approached this before or know of an implementation doing this sort of
> thing, etc. Any feedback would be greatly appreciated. :) If anyone is
> interested, a quick demo is here:
> http://www.gfycat.com/AlertNarrowAntelopegroundsquirrel
>
> Many thanks,
> Ben
>
> P.S. Apologies if this list is not for this sort of query :/
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150908/7905e922/attachment.html>
More information about the cfe-dev
mailing list