Skip to content

Feature Request: Preview Macro Expansion #13760

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

Closed
AadamZ5 opened this issue Dec 11, 2022 · 2 comments
Closed

Feature Request: Preview Macro Expansion #13760

AadamZ5 opened this issue Dec 11, 2022 · 2 comments

Comments

@AadamZ5
Copy link

AadamZ5 commented Dec 11, 2022

I know there are some open issues about expanding macros in place (#13598, #5949 (comment)), but I'm not sure if those are exactly what I'm trying to describe here. I recently was fantasizing about a "preview macro expansion" in IDE that would open the preview pane. I sometimes want to see how the macro is expanded, but I don't want to actually write the expanded macro into my file. I just want to see it for reference. I use VS Code, not sure how other editors would/could implement.

The preview pane is what you get when you use an action like "Go To References" from the context menu. I think this is also the same functionality as the "Peek" options in VS Code context menu.

Example of the preview pane I'm talking about:
image

I think it would be neat to quickly preview the expanded macro in this manner. This could be accessed by a context menu option when right-clicking on a macro.

Any pointers/tips to investigate how something like this could be implemented? Any current blockers? Thanks!

@bjorn3
Copy link
Member

bjorn3 commented Dec 11, 2022

The "Rust Analyzer: Expand macro recursively" command shows the macro expansion in a separate editor pane.

@AadamZ5
Copy link
Author

AadamZ5 commented Dec 11, 2022

Just did my due diligence after I posted this and checked out the functionality. I still would enjoy the preview pane, but this is great :)

Closing

@AadamZ5 AadamZ5 closed this as completed Dec 11, 2022
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

No branches or pull requests

2 participants