-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Basic ctags support in rustdoc #17143
Conversation
Added 'ctags' option to -w argument which causes rustdoc to output a ctags file (default name is TAGS) for the input crate.
FWIW, we currently allow dumping a 'generic' CSV of information about definitions etc. in a crate (via about turning this info into CTAGS output. (I'm not sure if this should or shouldn't stop us adding support to rustdoc, but it seems worth noting.) |
What makes rustdoc the place to put this? I don't associate CTAGS with documentation, but code navigation. |
Well issue #10317 mentions rustdoc so thats why I started there. I was about to write some other justifications, but now I realize that librustdoc is, well, a lib. So I could just write a new rusttags program that uses librustdoc. This would actually be better because I wouldn't have to jury-rig this new functionality into rustdocs established conventions. |
clean::MacroItem(..) => { | ||
tags.push( Tag::from_item( item, Macro, [] ) ); | ||
}, | ||
clean::PrimitiveItem(..) => fail!( "primitive" ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stylistically we don't put spaces around parens around function calls, macros, or methods.
I also think this may be best to grow outside of the compiler before including in the standard distribution itself. I'm not very familiar with ctags, but it does seem odd that rustdoc would be capable of generating them. |
This does seem to duplicate some of the functionality in rustc::middle::save. It seems to me that the best way to implement ctags support would be to add anything needed to middle::save and have some tool that converts the save output to ctags format. We can be quite flexible about adding stuff to middle::save. I have been toying with the idea of using json or something as output rather than csv to make it more widely usable, not sure if that would be useful here. @wickerwaka ping me (nrc on irc, or here) if you have any questions about the middle::save/DXR stuff. |
internal: Show workspace info in the status bar cc rust-lang/rust-analyzer#17127
internal: Show workspace info in the status bar cc rust-lang/rust-analyzer#17127
First pass for feedback and comments.
Added 'ctags' option to -w argument which causes rustdoc to output a
ctags file (default name is TAGS) for the input crate.
#10317