Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default arguments & brief documentation #4

Open
lecopivo opened this issue Aug 29, 2014 · 6 comments
Open

Default arguments & brief documentation #4

lecopivo opened this issue Aug 29, 2014 · 6 comments

Comments

@lecopivo
Copy link

1.

When I complete function, than I do not get attributes which have default values.

Example:

 void jump( int h = 1 ){}  
 void walk( int s ){}

they expant to

jump()
walk(int s)

I would like to have option to expand jump to jump(int h) or at least have some tooltip info that there is optional arguments. This leads me to next question

2.

I would like to somehow display documentation(Doxygen) on completion candidates, for example as tooltip and as well to display documentation on function arguments.

Thank you,
Tom

@Sarcasm
Copy link
Owner

Sarcasm commented Sep 9, 2014

Woops, I didn't notice this issue.

So to answer your questions:

1.

This is currently not implemented but I'm aware of this problem. Optional arguments are ignored for now https://github.com/Sarcasm/irony-mode/blob/4554b91a4f80b758f16e9b6e25af651fbfc45624/server/src/Irony.cpp#L253-L255

2.

For the documentation, libclang only provides the brief documentation and so does irony.

For the function arguments, I'm not sure what you mean, do you want the prototype like what is displayed in company's annotation?

@lecopivo
Copy link
Author

lecopivo commented Sep 9, 2014

I might be dumb but how do I display that brief documentation?

2.

I'll give an example of what I mean. Let's have a function

/**
* @brieff Take squareroot of number
* @param x Number to take squareroot of.
* @return Squareroot of x
*/
float squareroot( float x ){ ...}

Now when I write square and complete I get squareroot( float x ) with cursor at the beginning of float x. I would like to display Number to take squareroot of. somewhere, propably as tooltip.

I hope it is clear what I mean.

@Sarcasm
Copy link
Owner

Sarcasm commented Sep 10, 2014

I might be dumb but how do I display that brief documentation?

Not dumb, the brief documentation is only supported on recent version of libclang (see the version check here: server/src/Irony.cpp#L23-L28), if your version is recent enough it should be displayed in the echo area like this:

2.

It's perfectly clear now. So right now this is not possible and it is not planned in the short-term either but I agree that it would be nice to have someday.

@nickbroon
Copy link

The company-clang backend has company-clang-insert-arguments option that defaults to on.
A similar option for the irony backend would be great.

@Sarcasm
Copy link
Owner

Sarcasm commented Aug 19, 2015

@nickbroon how is this related to this issue? Pease open an issue for this.

@nickbroon
Copy link

I think I might have misread section 1 above, and thought it related. But I know see it's about default values. I'll open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants