-
Notifications
You must be signed in to change notification settings - Fork 204
Added support for Rust macros and macro calls #515
Conversation
| self.hover = datum['qualname'] | ||
| return trim_dict(datum, ['qualname']) | ||
|
|
||
| def menu_items(self): |
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.
I think here and below we also want to add the generic_variable_menu items
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.
I'm not quite following - that shouldn't have any impact on macros.
Unless you mean you want to be able to jump to macro references from a macro reference?
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.
Oh yeah, sorry, should have looked that up, it wasn't what I was expecting. Anyway, yeah, I guess you should add find_references_... to RefRef
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.
Done
|
LGTM, modulo the r? @erikrose |
b403278 to
b9cc97b
Compare
|
Do the mentioned "changes to save-analysis re: generated-code" kick in by the rustc nightly of 2016-01-25? That's where DXR is stuck atm due to DXR's rust tests not passing on later ones. It's likely they do, since the tests pass here, but our test coverage on the rust plugin is spotty. |
| def process_macro(args, tree): | ||
| tree.data.macros[args['qualname']] = args | ||
| tree.add_to_lines(args, ('macros', args)) | ||
|
|
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.
(Just a nit: 1 skipped line between methods of a class)
|
Looks okay otherwise. I just want to wait for an answer to the "changes to save-analysis re: generated-code" question before merging. |
|
rust-lang/rust#31097 Is the pull that changed save analysis so that it exported the standard crates (when included). Not sure when it made it into nightly, but the timeframe seems pretty close to when it started breaking. Also, before this commits, I'll implement the suggested changes, and I have a question. Using this build, searching for macros and macro references from the search bar has some weird behaviour: mainly, you can't find anything unless you use the exact qualified name. |
When you search for macro:blah, DXR looks in elasticsearch for lines tagged with a |
|
Since, as you say, the code you added looks just like the processing code for functions, I suspect the wrong info is getting into |
|
Thanks for that, I'm pretty sure I know where the problem is now. I'll have the recommended changes up by the end of today. |
b9cc97b to
1438682
Compare
|
Should be good to go now. One issue is I can't write tests, as nightly rust hasn't caught up yet. |
r? @nrc
Also I've removed the std hack stuff - with the changes to save-analysis re: generated-code, the std crate is already being written out to the CSV file.