Commit 744ba92
authored
Show the Autofill completion case as what would be auto-filled (#22819)
Partial Fix for scalameta/metals#7274
We have in our completion provider an option to automatically fill a
case class constructor with named parameters:
```scala
case class A(x: Int, y: Int)
val a = A(@@)
^^ // would fill in here
val a = A(x = ???, y = ???)
// ^^^ ^^^ cursor marks added, so tabs can be used to move between the fields
```
However previously it was labeled `Autofill with default values`, which
would never pass editors' filters based on the
current state of input (most likely the name of a field).
The only way to find this option was to type something matching the
`Autofill with default values` label, which explains the
`auto` in the above issue.
We now provide the actual provided fields as the label, so the above
would show `x = ???, y = ???` instead, which is both
more intuitive for the user, and more friendly to editors.1 parent 8fe16fe commit 744ba92
File tree
3 files changed
+23
-3
lines changed- presentation-compiler
- src/main/dotty/tools/pc/completions
- test/dotty/tools/pc/tests/completion
3 files changed
+23
-3
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
270 | | - | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
342 | 348 | | |
343 | 349 | | |
344 | | - | |
| 350 | + | |
| 351 | + | |
345 | 352 | | |
346 | 353 | | |
347 | 354 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
0 commit comments