feat: in-editor completion / autocomplete popup#157
Conversation
…rovider, CompletionItem, Editor.Completion.cs, WordCompletionProvider in ted) Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/dddd5eaf-c7d7-40bb-866d-9961401a391b Co-authored-by: tig <585482+tig@users.noreply.github.com>
…decisions.md; apply jb cleanup Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/dddd5eaf-c7d7-40bb-866d-9961401a391b Co-authored-by: tig <585482+tig@users.noreply.github.com>
…ox in Settings dialog Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/cfa1ac33-d4c6-44f9-a99b-c6368a9297bd Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot the setting for this on Ted is supposed to be in the first tab, not the Tabs tab of the settings dialog. |
…ettings dialog Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/e681778e-94f5-49ce-a7fc-8316bcd4a183 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Moved the "Auto Complete (Ctrl+Space)" checkbox from the Tab Settings tab to the Config tab (first tab) in the Settings dialog. Commit |
|
@copilot read Claude.md and ensure you are following it in this pr. |
…://github.com/gui-cs/Editor into copilot/add-editor-autocomplete-functionality
…s in tests Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/979aa238-ec63-48d4-8db2-5a3cac276f01 Co-authored-by: tig <585482+tig@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
…://github.com/gui-cs/Editor into copilot/add-editor-autocomplete-functionality
|
@copilot do not use popovermenu for autocompldete. It should be a DropDownList using Popover. Ensure you are following CLAUDE.md. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Added failing tests first in commit
All 476 unit tests + 226 integration tests pass. CodeQL clean. |
|
@copilot now, when the popover is up, up/down arrow keys don't work to navigate the list. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7008d9405e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…x and ListView - Fixed arrow up/down keys updating the completion selected index correctly - Added UpdateCompletionListSelection helper for visual ListView updates - Added CompletionSelectedIndex internal property for test verification - Fixed unit tests: "unsafe" doesn't start with "us" (starts with "un") - Added ArrowDown_Wraps_To_First_Item test - Added ArrowDown_Then_Enter_Accepts_Second_Item integration test Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/ca58f879-5dc4-433d-8e77-2c1161ff8745 Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Fixed in Added tests:
|
Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/ca58f879-5dc4-433d-8e77-2c1161ff8745 Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@copilot it's still not working. Plus when I click on a list item in the popover list, it dismisses without selecting the autocomplete item i clicked on. Study how TextView does this and make sure you are not re-inventing how this should work. Yes, I know TextViewAutoComplete is a different beast, but it works and should show you the way. We are going in circles here and I'm afraid you are now just hacking and playing whack-a-mole. do it right. |
|
@copilot resolve the merge conflicts in this pull request |
…ar insert in HandleCompletionKey, mouse click handling via Editor.OnMouseEvent The Popover intercepts character keys internally (before KeyDown event fires), preventing them from reaching any event handler. Navigation keys (arrows) DO reach the KeyDown event. The solution: 1. Keep Enabled=false on the Popover (visual-only overlay, Editor retains focus) 2. HandleCompletionKey now handles character keys directly (insert + refresh) 3. HandleCompletionMouse detects clicks in the Popover's screen area 4. Arrow keys update ListView selection + SetNeedsDraw on both ListView and Popover 5. Backspace handled in HandleCompletionKey (remove char + refresh) This follows the PopupAutocomplete pattern from TG: the host control owns all input dispatch, the popup just renders. Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/be8ce6c1-d6d7-403d-933a-2e44aabaa22d Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Rewrote the completion popup properly in The fix follows the
All 479 unit tests + 236 integration tests pass. |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Merge conflicts resolved in |
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Merge conflicts resolved in
All 486 unit tests + 262 integration tests pass. |
IEditorCompletionProviderinterface +CompletionItemrecord insrc/Terminal.Gui.Editor/Completion/Editor.Completion.cspartial —CompletionProviderproperty, popup lifecycle, key interception, caret-anchored positioningEditor.Keyboard.cs(notify provider on text input)examples/ted(WordCompletionProvider, Ctrl+Space trigger)Popover<ListView, CompletionItem?>for the autocomplete popupEnabled = falsekeeps Editor focused; character keys handled directly inHandleCompletionKey; mouse clicks detected viaHandleCompletionMousein Editor.OnMouseEvent