abo-abo / function-args

C++ completion for GNU Emacs
120 stars 10 forks source link

show also function description with M-i #26

Closed xianbinKit closed 9 years ago

xianbinKit commented 9 years ago

Hi abo-abo

I would like to ask you that is it possible to show also @param and @return information insert by moo-doxygen when active M-i. example

@param variableInput : input data @param variableoutput: output data @return true/false (int variableinput, int variableoutput): int

include doxygen comment @param and @return but without stars \/* ****

thank you

abo-abo commented 9 years ago

You mean if a function has a (Doxygen) comment before its definition, add that comment on top of M-i?

It's not straightforward to extract the comment, and I'm not using Doxygen currently, so I'll need a test file from you.

xianbinKit commented 9 years ago

thank you for replying and yes, it is like what you said.

for example, in test.c :

include

include "test.h"

include

/**

int main() { func2() }

return 0;

now, I don't know what arguments to write in func2(), then I press M-i, I hope to obtain like this.

@param a : description input a @param b : description input b @return (a+b) : description output (float a, bool b): int

it's amazing to obtain the explication of arguments.

Thank you

xianbinKit commented 9 years ago

sorry, there is not point before @param, that was , gitpub changed \ to point....

abo-abo commented 9 years ago

sorry, there is not point before @param, that was , gitpub changed \ to point....

You should edit your message to indent the source blocks with 4 spaces. That will make them look nice. Or you can use the fence syntax:

```c++
int main() {
return 0;
}


For more info on Markdown, which Github uses as markup, see: http://daringfireball.net/projects/markdown/syntax.
xianbinKit commented 9 years ago

Thank you abo-abo, so you understand what feature I want ? is that possible?

#include <math.h>
#include "test.h"
#include <stdio.h>

/**
 * Here is func2  description 
 *
 * @param a : description input a 
 * @param b : description input b
 * @return (a+b) : description output 
 */
int func2(float a, bool b){
  print("haha");
  return (a+b)
}

int main(){
func2()     // line A
}

here is the code , for exemple, now my cursor is pointing at func2(), line A, and the definition of func2 is in the head of this file, or in other file. I can't see the definition just right there, then I press M-i on func2(), I want to obtain

@param a : description input a 
@param b : description input b
@return (a+b) : description output 
(float a, bool b): int

if it's possible, thank you very much

abo-abo commented 9 years ago

Thanks, it should now be possible to see comments if you set fa-do-comments:

fa-do-comments