Commit 042ce00
authored
fix(amazonq): inline suggestion scrolling now uses built-in VSC commands. (#7323)
## Problem
The current implementation overwrites the
`editor.action.inlineSuggest.showPrevious` and
`editor.action.inlineSuggest.showNext` commands to swap out the
inlineProvider. These custom overwrites cause a few issues:
- forces us to maintain a ton of state [leads to bugs, some of which
were observed in bug bash].
- causes the suggestions to "refresh" when going through them since we
are re-instantiating the provider on "scrolls".
- doesn't natively support "accept word"/"accept line".
## Solution
- Remove the overwrite, remove reliance of `session` state.
- Simplify implementation to use native VSC commands.
## Fixed Bugs
- Scrolling through suggestions now works and doesn't "refresh".
- Accept Word/Accept Line now work properly.
- Significantly faster to scroll through suggestions.
- Inline Reference Codelense no longer flashes when scrolling through
suggestions.
## Tests and Verification:
Testing this change it feels significantly 'smoother'.
https://github.com/user-attachments/assets/631ee822-3cab-46b5-a07c-b3d4b8eb7d3b
## Future Work
- with some more aggressive refactoring, and once telemetry is mostly in
Flare, we can completely delete the sessionManager.
- revisit reference codelense, and see if its the right choice. Maybe a
message instead?
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.1 parent a814ee0 commit 042ce00
File tree
4 files changed
+25
-192
lines changed- packages/amazonq
- src/app/inline
- test/unit/amazonq/apps/inline
4 files changed
+25
-192
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | 160 | | |
195 | 161 | | |
196 | 162 | | |
| |||
199 | 165 | | |
200 | 166 | | |
201 | 167 | | |
202 | | - | |
203 | | - | |
| 168 | + | |
204 | 169 | | |
205 | 170 | | |
206 | 171 | | |
| |||
217 | 182 | | |
218 | 183 | | |
219 | 184 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
240 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
241 | 203 | | |
242 | 204 | | |
243 | 205 | | |
| |||
271 | 233 | | |
272 | 234 | | |
273 | 235 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | 236 | | |
280 | 237 | | |
281 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 57 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 58 | + | |
98 | 59 | | |
99 | 60 | | |
100 | 61 | | |
| |||
107 | 68 | | |
108 | 69 | | |
109 | 70 | | |
110 | | - | |
111 | 71 | | |
112 | 72 | | |
Lines changed: 6 additions & 83 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 23 | + | |
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
| |||
230 | 225 | | |
231 | 226 | | |
232 | 227 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | 228 | | |
274 | 229 | | |
275 | 230 | | |
| |||
278 | 233 | | |
279 | 234 | | |
280 | 235 | | |
281 | | - | |
282 | 236 | | |
283 | 237 | | |
284 | 238 | | |
285 | 239 | | |
286 | 240 | | |
287 | 241 | | |
288 | 242 | | |
289 | | - | |
290 | 243 | | |
291 | 244 | | |
292 | 245 | | |
| |||
320 | 273 | | |
321 | 274 | | |
322 | 275 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | 276 | | |
341 | 277 | | |
342 | 278 | | |
343 | 279 | | |
344 | 280 | | |
345 | | - | |
346 | | - | |
| 281 | + | |
347 | 282 | | |
348 | 283 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | 284 | | |
358 | 285 | | |
359 | 286 | | |
360 | 287 | | |
361 | 288 | | |
362 | 289 | | |
363 | | - | |
364 | | - | |
| 290 | + | |
365 | 291 | | |
366 | 292 | | |
367 | 293 | | |
| |||
391 | 317 | | |
392 | 318 | | |
393 | 319 | | |
394 | | - | |
395 | | - | |
| 320 | + | |
396 | 321 | | |
397 | 322 | | |
398 | 323 | | |
| |||
415 | 340 | | |
416 | 341 | | |
417 | 342 | | |
418 | | - | |
419 | | - | |
| 343 | + | |
420 | 344 | | |
421 | 345 | | |
422 | 346 | | |
| |||
449 | 373 | | |
450 | 374 | | |
451 | 375 | | |
452 | | - | |
453 | | - | |
| 376 | + | |
454 | 377 | | |
455 | 378 | | |
456 | 379 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 114 | | |
122 | 115 | | |
123 | 116 | | |
0 commit comments