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

internal: ItemTree pretty-printing #8916

Merged
merged 5 commits into from
May 21, 2021
Merged

internal: ItemTree pretty-printing #8916

merged 5 commits into from
May 21, 2021

Conversation

jonas-schievink
Copy link
Contributor

This adds a printer for ItemTree contents, and a few tests to ensure that ItemTree lowering works like we expect it to. It also adds a new "Debug ItemTree" command that can be used to see the ItemTree of the currently open file. The pretty-printed output is usually close enough to Rust syntax that we can even use Rust syntax highlighting.

This is similar to the old ItemTree tests we had, but produces significantly more readable output, so these should actually carry their weight.


use crate::{db::DefDatabase, test_db::TestDB};

fn check(ra_fixture: &str, expect: Expect) {
Copy link
Member

Choose a reason for hiding this comment

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

👍 thats perfect use case for expect!

@jonas-schievink
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented May 21, 2021

@bors bors bot merged commit ae24651 into rust-lang:master May 21, 2021
@jonas-schievink jonas-schievink changed the title ItemTree pretty-printing internal: ItemTree pretty-printing May 22, 2021
@jonas-schievink jonas-schievink deleted the pretty-item-trees branch May 22, 2021 00:38
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.

None yet

2 participants