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

Basic ctags support in rustdoc #17143

Closed
wants to merge 1 commit into from

Conversation

wickerwaka
Copy link

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

Added 'ctags' option to -w argument which causes rustdoc to output a
ctags file (default name is TAGS) for the input crate.
@huonw
Copy link
Member

huonw commented Sep 10, 2014

FWIW, we currently allow dumping a 'generic' CSV of information about definitions etc. in a crate (via -Z save-analysis) in the format expected by the DXR tool. Some quick googling turns up

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.)

@brson
Copy link
Contributor

brson commented Sep 10, 2014

What makes rustdoc the place to put this? I don't associate CTAGS with documentation, but code navigation.

@wickerwaka
Copy link
Author

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.

@brson
Copy link
Contributor

brson commented Sep 11, 2014

cc @alexcrichton

clean::MacroItem(..) => {
tags.push( Tag::from_item( item, Macro, [] ) );
},
clean::PrimitiveItem(..) => fail!( "primitive" ),
Copy link
Member

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.

@alexcrichton
Copy link
Member

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.

@wickerwaka wickerwaka closed this Sep 12, 2014
@nrc
Copy link
Member

nrc commented Sep 12, 2014

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.

RalfJung pushed a commit to RalfJung/rust that referenced this pull request Apr 26, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Apr 27, 2024
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

Successfully merging this pull request may close these issues.

5 participants