rust-lang / rust-lang/rust-analyzer
Idea (Quickfix): "Add todo!() to end of your function"
Open
@pickx is already working on this.
Since Dec 18, 2024.
C-feature
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
It would be nice if rust-analyzer provides a code action (quickfix) which adds todo!() when:
- No
returnsentence - The function should return something (not
-> ()), but it doesn't return anything
// Case 1: Should suggest, because the function looks like it's not completed
fn foo() -> String {
doing_things();
// ...
// add todo!() here
}
// Case 2: Should not suggest, because it's more likely an user issue
fn foo() -> String {
doing_things();
return 42;
}
// Case 3: Should not suggest, because it's more likely an user issue
fn foo() -> String {
doing_things();
return;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.