Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Context: add three new experimental retriever strategies (#5494)
# Context The PR adds three major context sources useful for autocomplete and next-edit-suggestion. ### Recent Copy retriever. Developers often copy/cut and paste context and before pasting we show autocomplete suggestions to the user. The PR leverages the copied content on the clipboard by the user as a context source. I wasn't able to find any vscode api event exposed which triggers when user `copy` or `cut` text in the editor. This seems like an open issue: microsoft/vscode#30066 Another alternative I think of is to use a keybinding of `Ctrl+x` and `Ctrl+c`, but not fully sure about its implications, since this is one of the most common shortcuts. As a workaround, The way current PR accomplishes the same is: 1. Tracks the selection made by the user in the last `1 minutes` and keeps tracks of upto `100` most recent selections. 3. At the time of retrieval, checks if the current clipboard content matches the selection items in the list. ### Recent View Ports This context source captures and utilizes the recently viewed portions of code in the editor. It keeps track of the visible areas of code that the developer has scrolled through or focused on within a specified time frame. ### Diagnostics The Diagnostics context source leverages the diagnostic information provided by VS Code and language servers. It collects and utilizes information about errors, for a file as a context source. ## Test plan 1. Automated test - Added CI tests for each of the retrievers 2. Manual test - Override the setting `"cody.autocomplete.experimental.graphContext": "recent-copy"` in vscode settings. - Observe the context events using `Autocomplete Trace View`
- Loading branch information