Add quickfix for missing use block on lambdas
Open
major-league-hacking
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
Example bad code:
```hack
function foo(): void {
$x = 1;
$f = function() {
return $x;
};
}
```
The quickfix should add the `use` (if not already present), and the extra variable.
```hack
function foo(): void {
$x = 1;
$f = function() use ($x) {
return $x;
};
}
```
Contributor guide
Research direction
No files, tests, or entry points are named. Start by locating the Hack lambda quickfix implementation and its tests, then verify handling for lambdas without a use block, lambdas with an existing use block, and the required captured variable; done means the examples receive the requested quickfix.
Written by the indexing model from the issue text.
Assessment
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100