Sarcasm / company-irony

company-mode completion back-end for irony-mode
118 stars 11 forks source link

Brief is only displayed for file-local items #9

Closed ghost closed 9 years ago

ghost commented 9 years ago

company-irony will autocomplete symbols from external files, if even they are not open, which is really nice. However the brief comment for a function is only displayed if the brief text is present in the current file. It won't show briefs for functions that are in other files.

I'm not sure if this is expected behavior or if I've configured something improperly. Please let me know if you need any additional information.

ghost commented 9 years ago

I looked into this a bit further so I'm adding additional details.

To be clear, it will display doxygen briefs that are present in functions in the current file, or briefs that are placed in header files which are included, which is basically the same thing since the preprocessor will paste the contents.

On most projects I write my doxygen comments in the header next to a declaration, but on some comments are located in the source file, and these briefs will not display unless I am currently inside that source file.

Sarcasm commented 9 years ago

Sometimes the best way to be clear is with a code sample. Do you mean that documentation is accounted for function declaration but not the definition? For what it's worth, I'm not doing anything special for the doxygen comments, I'm just using the libclang api to get the candidate documentation so that may be a libclang bug

ghost commented 9 years ago

Declaration vs definition doesn't matter. It only retrieves the doxygen brief if the doxygen comment is inside the file you have open (either literally there or pasted via include). If the doxygen brief is located in another .c/.c++ file it will not show up.

I'll check out libclang's behavior for this, thanks for the information. I guess I'll close this since it is probably not a bug with irony. Thank you.

Sarcasm commented 9 years ago

Oh, I understand better now, yes the documentation is only taken in the current translation unit, there is no indexing of the file or so in the completion, not an issue when doxygen comments go in header files but when they are in source files libclang will not help.