-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autocomplete: Make string distance filters more lenient (#1320)
We have gotten reports for cases where Cody didn't suggest a useful completion. One such case can be reproed with this example: ``` interface DoInteractionRequest { chatId: string prompt: string systemPrompt: string } interface Fuzz { string: () => string } const z: Fuzz = {} as any const interactionRequest: DoInteractionRequest = { chatId█ prompt: z.string(), systemPrompt: z.string(), } ``` This was caused by the string distance between the inserted line `chatId: z.string(),` and the next line `systemPrompt: z.string(),` (or the one above, for that matter) to be too close. We use to guard heavily against it since our initial Claude Instant implementation could not do infilling well and was repeating the suffix in many cases. Since we have infilling now, we can make this overlap much more lenient. This PR changes the threshold from 0.33% to 0.2%. ## Test plan https://github.com/sourcegraph/cody/assets/458591/e8c4cd05-e33d-4821-91ee-63b23af19a78 <!-- Required. See https://docs.sourcegraph.com/dev/background-information/testing_principles. -->
- Loading branch information
1 parent
4bda68b
commit 35f0f3e
Showing
4 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters