sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.55k stars 265 forks source link

fix a bug where the current file would not show up when searching for @-file mentions #5214

Closed sqs closed 1 month ago

sqs commented 1 month ago

This was unintentionally caused by https://github.com/sourcegraph/cody/pull/5057. The intent was to not show 2 mention items Current File: foo.ts and foo.ts, but it meant that if you typed @foo then neither would show up.

Also simplify how initial context is passed to MentionMenu. Just include it in items so we don't spread responsibility for displaying and filtering it across multiple components.

A future improvement would be to move all of this logic to the backend (extension host) and just give the UI the fully filtered list.

Test plan

Open a new Cody chat. Type @ and then the name of the currently open file in your editor. Confirm that Cody shows Current File: ... as an option.

Changelog