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.27k stars 214 forks source link

openctx: set query label if provided #4604

Closed keegancsmith closed 2 weeks ago

keegancsmith commented 2 weeks ago

This sets the query label to the newly added "label" field in OpenCtx. This is a field which prompts the user what to type in an at mention.

Test Plan: Tested manually the following cases

https://github.com/sourcegraph/cody/assets/187831/6b3ade90-13b2-43bb-8ba9-e3e822514679

Parent https://github.com/sourcegraph/cody/pull/4621

Fixes https://linear.app/sourcegraph/issue/CODY-2275/add-all-the-right-labels-for-provider-mentions-query-stats

keegancsmith commented 2 weeks ago

Seeing it IRL I think the URL ones might need to say “Type or paste a URL…” because otherwise it feels like you paste them into the popover or something.

Done

I still think it’s a mistake we don’t have “Search files…” and “Search symbols…” for the built-in files and symbols. Would be great to re-add imo.

Will follow-up in another PR

keegancsmith commented 2 weeks ago

I still think it’s a mistake we don’t have “Search files…” and “Search symbols…” for the built-in files and symbols. Would be great to re-add imo.

So just to confirm, you want to make these slightly different to OpenCtx? For OpenCtx this is the behaviour:

This is the current file behaviour:

The current behaviour kinda makes sense. Because we kinda insta-load symbols and files I'm not sure we need a prompt, but it would make sense from a consistency point of view. To help make this decision I greatly improved the cases in our story book. Check this PR out. https://github.com/sourcegraph/cody/pull/4624