Commit Graph

93 Commits

Author SHA1 Message Date
Johannes Rieken
9626fb0cd2 Inline chat widget tweaks (#206954)
* make status menu configurable

https://github.com/microsoft/vscode/issues/206940

* pull inline chat zone widget into its own file

* 💄

* remove expand/crop feature

* make chat message contents scrollable
2024-03-06 12:51:50 +01:00
Johannes Rieken
95e10d938f Remove livePreview and its implementation (#206073)
* Remove `livePreview` and its implementation

fixes https://github.com/microsoft/vscode/issues/205535

* make compiler happy
2024-02-23 15:19:33 +01:00
Johannes Rieken
2411a9c913 add inlineChat.accessibleDiffView setting (#205837)
fixes https://github.com/microsoft/vscode/issues/205714
2024-02-21 11:06:38 +01:00
Johannes
f439a7d9c5 wip - use accessible diff viewer for hunk info 2024-02-16 14:52:45 +01:00
Johannes Rieken
7215958b3c add commands to navigate between hunks (#205293)
https://github.com/microsoft/vscode/issues/203349
2024-02-15 15:57:24 +01:00
Matt Bierner
531cc0ee62 Don't accidentally create InlineChatFileCreatePreviewWidget when hiding it (#203830) 2024-01-30 12:31:38 -08:00
Johannes Rieken
6be4d6cc52 Don't let actual decorations grow, but still grow the "ambient" background decoration (#203546)
fixes https://github.com/microsoft/vscode-copilot/issues/3713
2024-01-26 18:03:09 +01:00
Johannes Rieken
6eb3213066 inline chat work (#203534)
* debt - use hunks to render preview diff

* add `InteractiveEditorRequest#previewDocument` to indicate for which document edits are previewed before being applied
2024-01-26 15:40:43 +01:00
Johannes Rieken
1f607d67c5 fix https://github.com/microsoft/vscode-copilot/issues/3652 (#203305) 2024-01-24 13:08:06 +01:00
Johannes Rieken
4217af7696 restore stashed sessions for when accidentially dismissing a session (#203006) 2024-01-22 14:31:23 +01:00
Johannes Rieken
053bbeb47c Use hunks also for livePreview and preview mode (#202843)
* more test coverage

* - Session has textModelN and targetUri where they must not always be equal
- for preview mode create textModelN copy so that AI edits can always be applied
- let preview mode work with hunk information

* - live preview uses hunk information
- tweak utils

* fix live-mode toggle diff
2024-01-19 13:14:28 +01:00
Johannes Rieken
e5a7abbc6a Mirror user edits into base model (#202723) 2024-01-18 14:51:52 +01:00
Johannes Rieken
b8b5a4aad0 Move hunk computation into sessions, let strategies render them (#202578)
* chore - move chat session service implementation and interface into their own files

* chore - move chat saving service implementation and interface into their own files

* - move hunks into session (instead of strategy)
- recompute them after receiving AI changes
- accept& discard moves hunks from textModelN to textModel0 and vice versa
- service renames
- tests

* - session doesn't know about an editor, only service does
- allow to "move" session to a different editor
- let controller pickup session after move to its editor
- session saving picks up orphand sessions

* try to restore editors when group is still valid

* ctrl - don't pause when cancellation happens during session create

* fix tests
2024-01-16 14:50:19 +01:00
Johannes Rieken
02580fd00c Make sure AI generate code gets accepted/discarded before saving (#202347)
* add inline chat save logic that ensures AI generated changes are only saved after consent

* live - when cancelling don't undo until start version but revert changes

* add setting to control save participation

* fix typo

* stub new services, fixes tests
2024-01-12 16:29:12 +01:00
Johannes Rieken
b0abf6638b fix https://github.com/microsoft/vscode/issues/202164 (#202317)
* remove start-method from strategies

* rename - activeSession to session

* keep strategy alive when pausing session, let strategy participate in pause, allow to call LiveStrategy#renderChanges repeatedly without recomputing hunks

* reset diff toggled state

* make sure to reset hunk display on done (dipose, accept, discard)

* reset diff state in pause, not hide function
2024-01-12 09:11:05 +01:00
Johannes Rieken
115155df62 Add test that asserts stream is done when the request is done (#202184)
test that asserts stream is done when the request is done

manifests fixing https://github.com/microsoft/vscode-copilot/issues/3345
2024-01-10 10:48:10 -08:00
Johannes Rieken
8ffbf09e31 Clear edit queue when request errors, tweak Queue/Limiter, tests (#202157)
* don't drag targetWindow all the way across all the layers

* add `ILimiter#clear`, add tests and define onDrain and clear behaviour

* fix compilo

* Queue/Limit - clarify onDrain timing, make sure it fires only once, add whenIdle

* chat - clear edit queue on error, adopt whenIdle

* add test to ensure progress edit stream stop on being cancelled
2024-01-10 15:27:09 +01:00
Johannes Rieken
77ca6ccd41 Joh/mysterious-octopus (#202079)
* debt - don't use extra buttons for accept/discard hunk

* - inline chat history shouldn't loop
- preserve the initial value and restore it

fixes https://github.com/microsoft/vscode-copilot-release/issues/671
2024-01-09 15:43:26 +01:00
Benjamin Pasero
35c44eeb27 Aux window: reduce $window usage (#195888) 2023-12-30 01:41:14 +01:00
Johannes Rieken
0603a4682b allow strategies to control whole range deco, let live not render it (#201224) 2023-12-19 19:20:27 +01:00
Johannes Rieken
595e7d4275 fix https://github.com/microsoft/vscode/issues/201197 (#201221) 2023-12-19 17:55:40 +01:00
Johannes Rieken
43fe3c9456 update changes count as hunks get accepted or rejected (#201188) 2023-12-19 10:47:21 +01:00
Johannes Rieken
0ad1502bee Improve live mode (#201147)
* simpler highlighting as changes are made, when rendering changes only compute diff once and use decorations to track inserts and further edits

* signal accept when at least one hunk was accepted
2023-12-18 19:19:51 +01:00
Johannes Rieken
3369508fe7 inline chat tweaks (#201126)
* streamline tel data

* rename to LiveStrategy

* fix up highlights
2023-12-18 15:17:26 +01:00
Johannes
42daedfd6c add overview ruler decorations for inline chat insertions, only show line level decoration but not word level changes 2023-12-18 12:22:54 +01:00
Johannes
8bfb30d567 don't reveal UI during streaming or when diff was recomputed
fixes https://github.com/microsoft/vscode-copilot/issues/3350
2023-12-18 11:46:28 +01:00
Johannes Rieken
a33752f9f0 clean up strategies (#200938) 2023-12-15 10:57:40 +01:00
Johannes Rieken
054c9129f8 live3 becomes live (#200866) 2023-12-14 18:24:38 +01:00
Johannes Rieken
2018d1523e await undo, reuse code (#200349)
* Revert "protect against faulty `canUndo` result"

This reverts commit cc629533b9.

* await undo, reuse code

https://github.com/microsoft/vscode/issues/200223
2023-12-08 14:41:43 +01:00
Johannes Rieken
2d826896fc protect against faulty canUndo result (#200323)
https://github.com/microsoft/vscode/issues/200223
2023-12-08 11:19:31 +01:00
Johannes Rieken
f746843c72 update diff when document changes but don't auto-accept change regions (#200061)
https://github.com/microsoft/vscode-copilot/issues/3206
2023-12-05 18:59:17 +01:00
Henning Dieterichs
c62947f67e Diff editor code cleanup (#199761)
* Diff editor code cleanup
2023-12-01 17:34:06 +01:00
Johannes Rieken
c364ff25d1 Don't update diff or accept changes when document is just changing (#199661)
fixes https://github.com/microsoft/vscode-copilot/issues/3134,  https://github.com/microsoft/vscode-copilot/issues/3139
2023-11-30 14:45:25 +01:00
Johannes Rieken
7a5744dffc fix https://github.com/microsoft/vscode-copilot/issues/3134 (#199523) 2023-11-29 12:34:19 +01:00
Johannes Rieken
25632434b0 add missing dispose call (#199164) 2023-11-27 15:27:30 +01:00
Johannes Rieken
e6b2fd82c1 use better file create mode for lightweight mode, fix issue with hidden/visible extra button bar (#199151) 2023-11-27 12:39:18 +01:00
Johannes Rieken
f54f1b0400 Further tweak light weight diff mode (#199148)
- Let message talk about changes not lines
- Move "Compare" into rhs toolbar as toogle action
2023-11-27 12:21:57 +01:00
Johannes Rieken
f593d2e626 Joh/weird-mink (#199049)
* fix up wholerange with diff information once all edits are there

* update summary when having changes across ranges
2023-11-24 19:13:50 +01:00
Johannes Rieken
5d73488bb3 Use a light weight diff for live inline chat mode (#199027)
* wip

* add yet another live mode which is live and live preview...

* use `renderLines` and view zones for orginal contents, render accept, discard, and compare in line

* remove LiveStrategy2 again

* render insertion diff as progressive changes happen

* implement discard

* implement explicit accept via button and implict accept via typing inside changes

* merge diff changes that are somewhat near

* pass zone, not just widget to strategies

* add `IEditorDecorationsCollection#append`

* move live3 actions into widget, don't render normal accept, discard, allow strategry to trigger accept, discard flows

* cleanup

* make sure re-run works
2023-11-24 15:14:53 +01:00
Johannes Rieken
6c8fd34375 Joh/young-catshark (#198416)
* add save & discard-btns to inline new file experience, simplify response type because we don't really support workspace edit, fix size/height bug, fix positioning bug

* fix preview mode, clean up events, fix workspace edit escape hatch

* merge main, fix compile errors
2023-11-16 16:27:36 +01:00
Benjamin Pasero
f9b5584b73 aux window - reduce direct setInterval uses (#197741) 2023-11-08 16:09:30 +01:00
Johannes Rieken
96025e7015 Don't dispose diff zone widgets when hiding them. (#197525)
fixes https://github.com/microsoft/vscode-copilot/issues/2617
fixes https://github.com/microsoft/vscode-copilot/issues/2627
2023-11-06 11:59:34 +01:00
Johannes Rieken
6697193a79 debt - merge EditResponse and MarkdownResponse into ReplyResponse (#196885) 2023-10-28 15:08:49 +02:00
Johannes Rieken
9f627c21f6 no undoStops between streaming edits, esp not between last and second to last round (#196708)
fixes https://github.com/microsoft/vscode-copilot/issues/2403
2023-10-26 15:21:08 +02:00
Johannes Rieken
1ca2bfbec1 stop progressive text edits when request is cancelled, hide diffzone(s) after undo'ing changes (#196100) 2023-10-20 11:08:12 -07:00
Johannes
d7bd919732 for now, disable multiple diff zones
https://github.com/microsoft/vscode-copilot/issues/2121
2023-10-20 18:42:03 +02:00
Johannes
52fa01b46c https://github.com/microsoft/vscode-copilot/issues/2122
highlight whole range again, always show widget above whole range, simplify bits some parts
2023-10-20 18:30:49 +02:00
Johannes
07cf686e87 fix https://github.com/microsoft/vscode-copilot/issues/2124 2023-10-20 17:45:05 +02:00
Johannes
fcb1687ef8 Rename DeferredAsyncIterableObject to AsyncIterableSource and align it method names 2023-10-20 11:41:07 +02:00
Johannes
52b663b3ab Add listener to show diff zones as soon as first edit is applied 2023-10-20 11:17:10 +02:00