Skip to content

Emit correct monikers for definitions nested in a function#22153

Open
sanxiyn wants to merge 2 commits intorust-lang:masterfrom
sanxiyn:nested-moniker
Open

Emit correct monikers for definitions nested in a function#22153
sanxiyn wants to merge 2 commits intorust-lang:masterfrom
sanxiyn:nested-moniker

Conversation

@sanxiyn
Copy link
Copy Markdown

@sanxiyn sanxiyn commented Apr 23, 2026

Handle definitions in "block modules". I followed hints in #18771.

Fix #18771
Fix #22089

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 23, 2026
Copy link
Copy Markdown
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

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

Looks good overall, modulo some comments.
For the CI failure, you could run it with env vars RUN_SLOW_TEST=1 and UPDATE_EXPECT=1 to update the expected test outputs

View changes since this review

Comment thread crates/ide/src/moniker.rs
Comment thread crates/ide/src/moniker.rs
identifier: &str,
package: &str,
kind: MonikerKind,
expected_list: &[(&str, &str, MonikerKind)],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Though this is used for tests only, the meaning of each tuple field is a bit confusing, as the first two has the same type.
Could you define a new struct for this or just comment the meaning of each field at least?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure.

@ShoyuVanilla
Copy link
Copy Markdown
Member

And could you squash the commits once you have finished?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

3 participants