Skip to content
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

Edit: Faster doc workflow with more target context #1900

Merged
merged 4 commits into from
Nov 28, 2023
Merged

Conversation

umpox
Copy link
Contributor

@umpox umpox commented Nov 27, 2023

closes #1464

Description

This PR:

  • Streamlines the doc intent flow for fixup tasks. Previously we would treat these as "edit", which means we would try to fetch lots of context from the selected code. That is very rarely helpful, for documenting we really just want to take the surrounding code and the current selection.

I also investigating going the other way, and fetching relevant reference code for a documentable symbol. This confirmed to me that it's not necessarily helpful. It can lead to the LLM documenting code based on how it is used elsewhere rather than how it should be used. That might help for "explaining" code but not for documenting. (Related PR: #1904)

Test plan

  1. Run doc command via right click menu
  2. Run doc command via sidebar
  3. Run doc command via code action

@umpox umpox marked this pull request as ready for review November 27, 2023 16:58
@umpox umpox changed the title Edit: Faster doc code action with more specific LSP context Edit: Faster doc workflow with more target context Nov 27, 2023
@umpox umpox requested review from abeatrix and a team November 27, 2023 17:00
@umpox umpox mentioned this pull request Nov 27, 2023
@umpox umpox self-assigned this Nov 27, 2023
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Everything looks good to me. I think the only change we will need to do is to remove the currentDir from the cody.json for the default doc command to reflect this change? https://sourcegraph.com/github.com/sourcegraph/cody/-/blob/lib/shared/src/chat/prompts/cody.json?L8

@umpox
Copy link
Contributor Author

umpox commented Nov 28, 2023

Thanks @abeatrix, will do that now

Base automatically changed from tr/fixup-consistency to main November 28, 2023 10:55
@umpox umpox enabled auto-merge (squash) November 28, 2023 11:10
@umpox umpox merged commit f97f07c into main Nov 28, 2023
13 checks passed
@umpox umpox deleted the tr/faster-doc-command branch November 28, 2023 11:26
@umpox umpox assigned umpox and unassigned umpox Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cody: Improve fixup response speed
2 participants