This repository was archived by the owner on Aug 1, 2025. It is now read-only.
Commit 2e5b3ab
authored
[JetBrains] Fix an issue with exiting the multi-caret mode (#8179)
My [fix](https://github.com/sourcegraph/cody/pull/8071) broke exiting
from multiline caret mode 🥲
This PR fixes the issue by using the built-in chain of responsibility
responsibly 😅
## Test Plan
### Test Case 1: Multiline Mode + Auto-edit Dismissal
**Setup:**
- No Vim extension enabled
- Open any file in editor
- Add multiple cursors (Ctrl/Cmd + Alt + Click or similar)
- Enter multiline editing mode
**Steps:**
1. Trigger auto-edit suggestion (type code that generates autocomplete)
2. Verify popup/inlay appears
3. Press `Escape` key
**Expected Result:**
- Auto-edit popup/inlay is dismissed
- Multiline cursor mode is exited (returns to single cursor)
- Editor returns to normal single-cursor state
### Test Case 2: Vim Insert Mode + Auto-edit Dismissal
**Setup:**
- Vim extension (IdeaVim) enabled
- Open any file in editor
- Enter Vim insert mode (`i`, `a`, `o`, etc.)
**Steps:**
1. While in insert mode, trigger auto-edit suggestion
2. Verify popup/inlay appears
3. Press `Escape` key
**Expected Result:**
- Auto-edit popup/inlay is dismissed
- Vim exits insert mode and returns to normal mode
- Cursor behavior follows Vim normal mode conventions
### Test Case 3: Baseline - No Special Mode
**Setup:**
- No Vim extension
- Single cursor, normal editing mode
**Steps:**
1. Trigger auto-edit suggestion
2. Verify popup/inlay appears
3. Press `Escape` key
**Expected Result:**
- Auto-edit popup/inlay is dismissed
- Editor remains in normal editing state
- No unexpected mode changes
---
**Note:** These test cases verify that the handler properly participates
in IntelliJ's action chain, allowing both autocomplete dismissal AND the
underlying editor action (multiline exit, vim mode change) to execute
correctly.
<!-- Required. See
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles.
-->1 parent ce48776 commit 2e5b3ab
2 files changed
Lines changed: 14 additions & 5 deletions
File tree
- jetbrains/src/main
- kotlin/com/sourcegraph/cody/autocomplete/action
- resources/META-INF
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments