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

No tooltips available for macros #251

Closed
kjteske opened this issue Apr 23, 2017 · 2 comments
Closed

No tooltips available for macros #251

kjteske opened this issue Apr 23, 2017 · 2 comments

Comments

@kjteske
Copy link
Contributor

kjteske commented Apr 23, 2017

I can put together a PR for this, but wanted to run the general concept by @niosus before putting in the work.

If I add TU.PARSE_DETAILED_PROCESSING_RECORD to parse options and then hover over the usage of a macro, I get a cursor with type CursorKind.MACRO_INSTANTIATION that reference the definition (CursorKind.MACRO_DEFINITION), so it would be pretty easy to create a link to the macro definition like is already done for functions/methods.

Unfortunately, the MACRO_DEFINITION cursor doesn't seem to have brief/raw comments, but we could use the MACRO_DEFINITION cursor's location to open the file with the definition and parse any doxygen comments from the line above macro. I'm optimistic about performance for this, and we would only do this when hovering over a macro, so this shouldn't impact tooltip performance for anything EasyClangComplete handles today.

@niosus
Copy link
Owner

niosus commented Apr 23, 2017

I will have to have a look at it, especially on whether PARSE_DETAILED_PROCESSING_RECORD has any influence on speed of parsing, but overall I really like the idea and would be glad to merge this. Give me a couple of days for testing this out if you want to be 100% sure :)

I totally agree with you that parsing the file doesn't seem dangerous speed-wise.

Also, I guess it is then closely related to #226
It would be cool to address both issues providing a nice way to read a file around the cursor'l location.

@simia
Copy link
Contributor

simia commented Apr 24, 2017

Macro expansion is indeed quite easy to implement.
I was intending to add it at some point but if @kjteske want to do that it's even better :)
As @niosus mentioned it would be good to add features mentioned in #226.
Also I think we should consider adding proper formatting to the tooltip syntax (I think there is a plugin that allows creating popups using current theme formatting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
EasyClangComplete
Awaiting triage
Development

No branches or pull requests

3 participants