-
Notifications
You must be signed in to change notification settings - Fork 209
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
Use correct file sources instead of always showing 'embeddings' in chat context #2408
Conversation
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.
Looks good, but are we missing the 'search' source for symf?
Apparently I didn't submit my reply here.... Should there be a new entry in cody/lib/shared/src/codebase-context/messages.ts Lines 6 to 11 in bcd49b3
Or should it use an existing one like |
This test was verifying the user-selected files showed up in the context widget, but this was not intended (see first line of #1858). They were still showing up because the source was not passed through correctly. Now it is, they don't show.
This change causes user-selected files to not show up in the context widget (before/after): This seemed like a bug, but turns out to be deliberate (see first line of #1858) but wasn't working before because the (@toolmantim @abeatrix let me know if I've made the right call here, or if you think we should include them here now) |
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 think you've made the right call. Left a question regarding ContextFileSource for symf but other than that, looks good to me!
@@ -1187,6 +1187,8 @@ class ContextProvider implements IContextProvider { | |||
return { | |||
uri: displayUri, | |||
range, | |||
// TODO(dantup): Set source (a value from `ContextFileSource`) here. | |||
// source: 'user', |
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.
maybe we can create a new ContextFileSource called 'symf' since the results returned from symf is not determined by the user manually? wdyt?
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, that's what the comment above was about - do you know if a) it's safe for me to just add new values here (the type says they're used for analytics - I don't know if they need to match something at the other end), and b) whether any of the existing values are valid for symf or it needs a new one?
Thanks!
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.
a) it's safe for me to just add new values here (the type says they're used for analytics - I don't know if they need to match something at the other end)
That should be fine since the value can be any
, i think the key is the important part haha
b) whether any of the existing values are valid for symf or it needs a new one?
I'd say we will need a new one because I don't see it fitting into any of the existing options: 'embeddings' | 'user' | 'keyword' | 'editor' | 'filename' | 'unified'
, or do you find one they you think it'd match?
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 don't, but I wasn't completely sure about the meaning of keyword
and unified
. I'll add symf
, thanks!
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.
Oh, I just realised that Dominic suggested "search" and this shows up in the tooltip (plus some other things were renamed from "symf" to "search" according to the changelog), so I went with "search".
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.
Oh yeah good points! For reference:
filename
is referring to the results from the FilenameContextFetcherkeyword
refers to the results from thekeywordContextFetcher
but i can't find it anymore, so I guess it's been removed and replaced bysymf
unified
refers to the results from the unifiedContextFetcher that I believe only Cody Web uses. We don't use it in VS Code.
@abeatrix let me know if using "search" (as noted above) seems reasonable, and if so (and the bots are green) I'll merge this. Thanks! |
Yea I think that makes sense to me 👍 |
@dominiccooney merging is blocked on your review. I believe my recent change resolved your issue, but let me know if anything else needs changing. Thanks! |
@abeatrix actually, now I'm a little confused. In the top line at #1858 it says:
And with my fix in this PR, the user-chosen files indeed don't show up. However, in the screenshots (eg. #1858 (comment)) it does still show the mentioned file - so I'm not certain what the intended functionality is now. If the user types something like "Explain foo.dart", should the context widget show up with "foo.dart" listed in it? |
@DanTup Oh that's because the screenshot you linked is context added for the |
But if the context was added via manual |
Great, thanks for confirming. I've re-merged main so it's all up-to-date. Needs @dominiccooney's stamp before it'll let me merge (I presume he's out this week). |
Dismissed staled review request to unblock. |
Thanks! :) |
Fixes #2244
fyi @kalanchan
Test plan
/explain
that will include the context file from the editor