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

WIP: goto defenition inside macro_rules macro #724

Closed
wants to merge 12 commits into from

Conversation

Projects
None yet
3 participants
@matklad
Copy link
Collaborator

matklad commented Feb 1, 2019

This uses #719 to actually implement a user-visible feature. Goto declaration works inside a macro_rules macro (see this test).

That's pretty cool except for the fact that, when I try to actually use this branch, rust-analyzer kills my system by consuming all the ram :)

A most important API change here is that we start assigning ids to TokenStream tokens.
Now token has not only a value, but an identity as well, which we currently use to map offsets, but which should also work for hygiene.

@marcusklaas

This comment has been minimized.

Copy link
Contributor

marcusklaas commented Feb 1, 2019

defenition -> definition ;-)

@matklad matklad force-pushed the res-macros branch from 036e50d to 719d38c Feb 1, 2019

@matklad matklad force-pushed the res-macros branch from bba3714 to bcd552f Feb 1, 2019

@@ -169,4 +169,71 @@ impl_froms!(TokenTree: Leaf, Subtree);
Some(TextRange::from_to(23.into(), 32.into())),
)
}

#[test]
fn dont_die_on_serde() {

This comment has been minimized.

@DJMcNab

DJMcNab Feb 1, 2019

Contributor

It probably doesn't matter, but we should make some callback to serde's license.

This comment has been minimized.

@matklad

matklad Feb 1, 2019

Author Collaborator

Not a lawyer, but MIT LICENSE says:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

I believe this not a substantial portion :)

This comment has been minimized.

@DJMcNab

DJMcNab Feb 1, 2019

Contributor

👍

@matklad

This comment has been minimized.

Copy link
Collaborator Author

matklad commented Feb 22, 2019

Closing, as this should be done in a more principaled way

@matklad matklad closed this Feb 22, 2019

@matklad matklad deleted the res-macros branch Mar 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.