-
Notifications
You must be signed in to change notification settings - Fork 291
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
Agent protocol and implementation for searching, listing, testing remote repository names #3775
Conversation
3ad3ff8
to
5df1cb9
Compare
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.
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.
|
||
if (!this.fuzzyIndex || !this.fuzzyTargetRepoMap) { | ||
// Update the fuzzy search index. | ||
// TODO: When speed is necessary, improve this by only indexing |
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.
This sounds like a good plan! Reasons we don't want to do that now?
// repositories and merging the result with the cached results, if any. | ||
// Could also limit the result set and cap the maximum size of any list. | ||
const result = fuzzysort.go(query, this.fuzzyIndex, { | ||
threshold: -1000, |
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.
threshold: -1000, | |
limit: 20, | |
threshold: -1000, |
would it make sense to limit the results for UI? I don't imagine people would want to go through a long list but that's just me, so feel free to ignore this 😄
5df1cb9
to
05b9338
Compare
@abeatrix thank you for the review 🙇
demo.sourcegraph.com is a good one to test. 0 is working as intended: you haven't selected a repo.
The UX is: Hit the pencil, then type repo names. Autocomplete will appear. Command-space to manually trigger it.
I removed these TODOs. It seems fast enough, so I will keep it simple for now.
There's two levels of filtering: This -1000 limit, and then IntelliJ autocomplete requests a subset of that list. I tried to do something which would work for a lot of clients:
It's not super elegant but it should work for a range of client capabilities. |
…1308) This facilitates bulk editing of multiple remote repositories, with an autocompleter and fuzzy search to make it easy to find repositories. Agent side in sourcegraph/cody#3775 version. Fixes #982 ## Test plan Manually tested: - Switch from an Enterprise to dotcom account and back. The enhanced context selector in the chat panel should change presentation. - Click the pencil and enter repository names. Duplicates should have yellow underlines. More than 10 repositories should have yellow underlines. Unknown repositories should have red underlines. Note, in JetBrains 2022.x, Annotators are not DumbAware: The underlines will only appear after the project finishes indexing. - Ctrl-Space should open an autocomplete with fuzzy search of remote repositories. - Command/Ctrl-Enter should update the selected repositories in the enhanced context selector. The entered text, including errors, should persist for the life of the chat panel to facilitate incremental editing; new chat panels should pick up a list of repositories separated with newlines. - Opening and closing the enhanced context selector tree view should resize the bottom of the panel. Checking and unchecking the tree nodes should influence whether enhanced context is used for chats (root node) or for specific repositories (leaf nodes.) Note, the repository associated with the open workspace is included implicitly when enhanced context is enabled.
This adds Agent endpoints for:
Closes sourcegraph/jetbrains#605.
Test plan
Manually tested with sourcegraph/jetbrains#1308
Added agent tests, run with
pnpm test