Commit db21bbb
committed
Add suggestions for pipeline similar to function but with arity of 1.
At this stage, pipeline are not considered as `Call` so previous work
on `UntypedExpr::Call` does not apply directly to pipeline. With this
change, we handle the pipeline case when the function / constructor is
not a `Call`.
```gleam
1 |> to_string
```
When there is a call in the pipeline, it is more delicate to address
because something like that:
```gleam
1 |> add(2)
```
Can be desugared into two possibilities and so suggestions are not the
same. The function `report_name_error` does not have enough context to
make good suggestions:
```gleam
add(1, 2)
add(2)(1)
```
In this case, we just suggest every functions.1 parent 54a4166 commit db21bbb
3 files changed
+50
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | | - | |
| 1669 | + | |
1670 | 1670 | | |
| 1671 | + | |
| 1672 | + | |
1671 | 1673 | | |
1672 | 1674 | | |
1673 | 1675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
730 | | - | |
| 730 | + | |
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | | - | |
| 1141 | + | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| |||
3555 | 3555 | | |
3556 | 3556 | | |
3557 | 3557 | | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
3558 | 3574 | | |
3559 | 3575 | | |
3560 | 3576 | | |
| |||
4632 | 4648 | | |
4633 | 4649 | | |
4634 | 4650 | | |
4635 | | - | |
| 4651 | + | |
4636 | 4652 | | |
4637 | 4653 | | |
4638 | 4654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
350 | 357 | | |
351 | 358 | | |
352 | 359 | | |
353 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
354 | 374 | | |
355 | 375 | | |
356 | 376 | | |
357 | 377 | | |
358 | 378 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 379 | + | |
363 | 380 | | |
364 | 381 | | |
365 | 382 | | |
| |||
0 commit comments