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

Request: in identifier search, mark where the kernel-doc is #78

Closed
cxw42 opened this issue Dec 4, 2019 · 14 comments · Fixed by #135
Closed

Request: in identifier search, mark where the kernel-doc is #78

cxw42 opened this issue Dec 4, 2019 · 14 comments · Fixed by #135
Assignees

Comments

@cxw42
Copy link
Contributor

cxw42 commented Dec 4, 2019

Thank you for this tool, which is incredibly useful!! I have a request. An example of the situation:

From the search results for an identifier, I am not able to tell which result has the kernel-doc comments. Therefore, I have to find the comments by trial and error between the header and implementation file(s).

Would it be possible for elixir to mark the location of the kernel-doc comments in the ident/foo search results? E.g., what if the results looked like this?---

drivers/media/v4l2-core/v4l2-common.c, line 66 _(as a function)
include/media/v4l2-common.h, line 94 (as a prototype) (doc)

(with the "(doc)" link pointing to the first line of the doc comments)

Thank you for considering this request!

@michaelopdenacker
Copy link

Hi.
Many thanks for the suggestion. Though not trivial to implement, this should definitely be helpful.
I'll keep this open until we can come up with a solution.
Thanks again :)
Michael

@cxw42
Copy link
Contributor Author

cxw42 commented Dec 18, 2019

Michael, thanks! In case I get some time to work on this, could you give me any initial thoughts as to which files might need to change, or where I might start?

@michaelopdenacker
Copy link

Hi Chris,

The way Elixir is architectured doesn't make things very easy... Here's a rough description of how it could be implemented

  • In update.py (when new source objects are parsed), detect documentation for symbols, and store such information in a new database file (indexed per symbol and version).
  • Modify the query.py back-end to support returning documentation references too. I guess it will be easier to create a new | Documented in" section for documentation in symbol search results, between "Defined in" and "Referenced in". Keep in mind that there could be multiple documentation results, especially if the same symbol is found with the same name in two unrelated parts of the kernel code.
  • Modify http/web.py and api/api.py front-end to return the new documentation references.

So, that's not trivial, but of course doable. Don't hesitate to propose a simpler idea :)
Thanks for proposing your help!
Cheers,
Michael.

@cxw42
Copy link
Contributor Author

cxw42 commented Jan 16, 2020

I have a rough cut working! Not yet tested, and definitely not yet cleaned up for a PR :) . https://github.com/cxw42/elixir/tree/local-server

image

@michaelopdenacker
Copy link

Hi Chris,
Thanks for sharing this snapshot (though I don't have overlay-loader.c in my kernel tree...). At least I know what it would look like :)
Please, don't hesitate to submit a PR when you're ready. I'll be happy to test it.
Many thanks,
Michael

@michaelopdenacker
Copy link

Hi Chris (@cxw42)

FYI, https://elixir.bootlin.com now is running with a freshly generated database with documentation information. Switching to a web front-end exposing such information will just take minutes ;-)

Michael

@cxw42
Copy link
Contributor Author

cxw42 commented Apr 23, 2020

I was thinking just yesterday that I had better get my PR in for the front end now that Maxime is on the job :) .

@cxw42
Copy link
Contributor Author

cxw42 commented May 14, 2020

I have a branch going with an initial test framework for web.py. I'm doing TDD on this one :) .
PR to follow in due course. https://github.com/cxw42/elixir/tree/webtest

@cxw42
Copy link
Contributor Author

cxw42 commented May 22, 2020

I have added tests of the doc-comment front end and cxw42@29ce0f0 passes the tests! @MaximeChretien would you please give it a try and let me know how it goes? I will squash before submitting the PR. Thanks!

@MaximeChretien
Copy link
Contributor

Hi @cxw42

I merged it on top of #130 , everything seems to work fine for me, both tests and web interface work without problems.

But I noticed some things :

Maybe it would be great to add that ? What do you think @michaelopdenacker ?

I'll continue to do some tests and I'll tell you if I find something else ;)

@cxw42
Copy link
Contributor Author

cxw42 commented May 22, 2020

Much appreciated! I'll try out those cases. My original thought was to detect all kernel-doc, not just functions, but maybe I missed something.

@cxw42
Copy link
Contributor Author

cxw42 commented May 22, 2020

After commenting above, I looked at #130 and I see that it switches from exuberant to universal ctags. It may be that the ctags-output parser in find-file-doc-comments.pl needs some updates to be able to accept universal's output. I will investigate.

cxw42 added a commit to cxw42/elixir that referenced this issue May 23, 2020
- Generate "Documented in" HTML
- resolve path to __file__: web.py finds its template directory with
  respect to __file__.  If __file__ is a symlink, resolve it.  This lets
  web.py work in a t/interact.pl session.
@cxw42
Copy link
Contributor Author

cxw42 commented May 23, 2020

Nope --- it's just that find-file-doc-comments.pl only extracts function docs! Would you like to do the current release with just functions, then add the rest later?

@MaximeChretien
Copy link
Contributor

Hi,
Yes you can send the current release with just functions docs and add the rest later when you have time
Thanks :D

cxw42 added a commit to cxw42/elixir that referenced this issue May 25, 2020
- Generate "Documented in" HTML
- resolve path to __file__: web.py finds its template directory with
  respect to __file__.  If __file__ is a symlink, resolve it.  This lets
  web.py work in a t/interact.pl session.
cxw42 added a commit to cxw42/elixir that referenced this issue Oct 3, 2020
cxw42 added a commit to cxw42/elixir that referenced this issue Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants