sourcegraph / cody

AI that knows your entire codebase
https://cody.dev
Apache License 2.0
2.25k stars 215 forks source link

mentions: display queryLabel if no results and no query yet #4621

Closed keegancsmith closed 2 weeks ago

keegancsmith commented 2 weeks ago

This updates the mentions API to be more explicit. Every provider already supplies the title, queryLabel and emptyLabel so we might as well mark those fields as required and rely on them when rendering.

Additionally we update call sites of queryLabel to be used when prompting the user for querying only. For the mention title we now always use title. Previously we prefered the queryLabel for titles which was strange.

Note: this change has no user visible behaviour change, it just makes us internally more consistent.

Test Plan: updated unit tests to demonstrate how the fields are now used. Additionally manually tested openctx and builtin providers in the mention menu to ensure there are no changes in behaviour.