-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metadata to context items #5153
Conversation
vscode/src/configuration.ts
Outdated
@@ -135,6 +135,7 @@ export function getConfiguration( | |||
*/ | |||
|
|||
internalUnstable: getHiddenSetting('internal.unstable', isTesting), | |||
internalDebugContext: getHiddenSetting('internal.debugContext', false), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what we can do to make adding new settings easier. Something which doesn't require updating 3 different files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, tbh we should probably just use the vscode.workspace.getConfiguration api. What we've built around that feels like an unnecessary abstraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be better to link this with cody.debug.enable.all
"Enable Debug Mode" rather than a separate config flag?
LGTM
@@ -244,6 +244,7 @@ export class ContextRetriever implements vscode.Disposable { | |||
range, | |||
source: ContextItemSource.Search, | |||
content: text, | |||
metadata: ['source:symf-live'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we maybe add symf-live into the context source enum?
e1c864a
to
c181479
Compare
Context items now include optional metadata about their source or scoring, which can help developers understand why certain items are appearing in the context. This change adds a `metadata` field to the `ContextItemCommon` interface and populates it for context items from Sourcegraph search, the local symbol index, and live search results.
c181479
to
58f3968
Compare
"Enable Debug Mode" is technically user visible and I want to keep this internal for now (so as to not worry about the way it looks at all)
Not sure, I think that belongs in a separate change, as that alters how we want to convey to the end user what is happening. "This came from symf" feels like a low-level implementation detail, where as "came from search" maps to more of a user-level mental model. |
Context items now include optional metadata about their source or scoring, which can help developers understand why certain items are appearing in the context. This change adds a
metadata
field to theContextItemCommon
interface and populates it for context items from Sourcegraph search, the local symbol index, and live search results.You can view these by setting
"cody.internal.debug.context": true
in settings. Thecody.internal.showContextAlternatives
has been removed and replaced by this one.Test plan
Test locally, doesn't affect prod.