Skip to content

Conversation

A4-Tacks
Copy link
Contributor

@A4-Tacks A4-Tacks commented Oct 7, 2025

Example

fn foo() {
    bar(|| $0);
}
fn bar(f: impl FnOnce() -> u32) {}

Before this PR:

ty: impl FnOnce() -> u32, name: ?

After this PR:

ty: u32, name: ?

Example
---
```rust
fn foo() {
    bar(|| $0);
}
fn bar(f: impl FnOnce() -> u32) {}
```

**Before this PR**:

```
ty: impl FnOnce() -> u32, name: ?
```

**After this PR**:

```
ty: u32, name: ?
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2025
.unwrap_or((None, None))
},
ast::ParamList(_) => (None, None),
ast::ParamList(it) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it inside a ParamList? Couldn't this degrade completions for some other cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is it inside a ParamList?

When completing || $0, the token is | and token.parent() is the ParamList

Couldn't this degrade completions for some other cases?

The difference should only be when ParamList is used as a closure parameter, because .and_then(ast::ClosureExpr::cast)

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
Development

Successfully merging this pull request may close these issues.

3 participants