Commit dc1e35a
authored
Completions should prepend, not replace as it is for Scala 2 (#18803)
By default, in Scala 2 completion prepend and only replace if there is
exact match. This PR unifies the experience between the Scala versions.
It seems more intuitive to work that way.
The change will be as follows (the order is: new logic, old logic and
scala 2 logic):
https://github.com/lampepfl/dotty/assets/48657087/c037c322-5613-4b95-a6e5-090b4e8827b6
In the future, it should be improved by changing implementation to use
`InsertReplaceEdit` instead of `TextEdit`. This will allow users to
decide which behaviour they prefer, but this has to be first implemented
in metals to properly handle the new logic, but for now the key is to
unify behaviours.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#insertReplaceEdit1 parent e399c43 commit dc1e35a
File tree
3 files changed
+57
-19
lines changed- presentation-compiler
- src/main/dotty/tools/pc/completions
- test/dotty/tools/pc/tests/completion
3 files changed
+57
-19
lines changedLines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
Lines changed: 11 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 154 | + | |
158 | 155 | | |
159 | 156 | | |
160 | 157 | | |
| |||
165 | 162 | | |
166 | 163 | | |
167 | 164 | | |
168 | | - | |
| 165 | + | |
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
186 | 181 | | |
187 | 182 | | |
188 | 183 | | |
| |||
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1500 | 1500 | | |
1501 | 1501 | | |
1502 | 1502 | | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
0 commit comments