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

Add VSCode command to view the hir of a function body #7068

Merged
merged 4 commits into from
Jan 3, 2021

Conversation

theotherphil
Copy link
Contributor

@theotherphil theotherphil commented Dec 28, 2020

Will fix #7061. Very rough initial version just to work out where I needed to wire everything up.

@matklad would you be happy merging a hir visualiser of some kind? If so, do you have any thoughts on what you'd like it show, and how?

I've spent very little time on this thus far, so I'm fine with throwing away the contents of this PR, but I want to avoid taking the time to make this more polished/interactive/useful only to discover that no-one else has any interest in this functionality.

image

@theotherphil theotherphil changed the title WIP: Add VSCode command to view the hir of a function body WIP Add VSCode command to view the hir of a function body Dec 28, 2020
@matklad
Copy link
Member

matklad commented Dec 31, 2020

would you be happy merging a hir visualiser of some kind? If so, do you have any thoughts on what you'd like it show, and how?

yup, as long as the functionality is isolated! Don't have thoughts about specific format

crates/ide/src/view_hir.rs Outdated Show resolved Hide resolved
@theotherphil
Copy link
Contributor Author

This is ready for review.

The output is pretty basic (it's unchanged since the original screenshot, except that it now also shows the function name), but is sufficient for my original use case.

@theotherphil theotherphil changed the title WIP Add VSCode command to view the hir of a function body Add VSCode command to view the hir of a function body Jan 1, 2021
Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

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

r=me with format_to fix

bors d+

crates/hir/src/code_model.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors bot commented Jan 3, 2021

✌️ theotherphil can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@theotherphil
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 3, 2021

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.

Feature: VSCode command to visualise the hir_def::Exprs within a function
2 participants