Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Conversation

@DanielJCampbell
Copy link

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.

self.hover = datum['qualname']
return trim_dict(datum, ['qualname'])

def menu_items(self):
Copy link

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

Copy link
Author

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?

Copy link

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nrc
Copy link

nrc commented Feb 4, 2016

LGTM, modulo the generic_variable_menu thing.

r? @erikrose

@erikrose
Copy link
Contributor

erikrose commented Feb 8, 2016

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

Copy link
Contributor

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)

@erikrose
Copy link
Contributor

erikrose commented Feb 8, 2016

Looks okay otherwise. I just want to wait for an answer to the "changes to save-analysis re: generated-code" question before merging.

@DanielJCampbell
Copy link
Author

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. macro:foo returns nothing, macro:foo::12345678 returns a result (assuming that macro exists). Do you have any idea why this would happen? As far as I'm aware I just copied the rust implementation for functions, but I must have missed something.

@erikrose
Copy link
Contributor

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 name or qualname of "blah". (That's what a QUALIFIED_LINE_NEEDLE is: a needle in the elasticsearch haystack that has both a short name and a qualified name.) I would guess that you're storing "macro:foo::12345678" as the qualname and perhaps also failing to store "foo" as the name.

@erikrose
Copy link
Contributor

Since, as you say, the code you added looks just like the processing code for functions, I suspect the wrong info is getting into tree earlier in the process.

@DanielJCampbell
Copy link
Author

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.

@DanielJCampbell
Copy link
Author

Should be good to go now. One issue is I can't write tests, as nightly rust hasn't caught up yet.

@cknowles-admin cknowles-admin added the ARCHIVED CLOSED at time of archiving label Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ARCHIVED CLOSED at time of archiving

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants