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: Quality improvements: Add related fix context when available #1723

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

umpox
Copy link
Contributor

@umpox umpox commented Nov 13, 2023

Description

Some improvements to "fix":

  • Includes the source when available, e.g. "typescript" for better prompt instruction.
  • Better use of the severity in the messaging
  • Makes use of the relatedInformation diagnostic from VS Code:
    • Fetches the related code from the included range
    • Adds any additional data like the message

Test plan

Run code actions manually (I need to add eval cases to make this easier)

@umpox umpox changed the title Edit: Add related fix context when available Edit: Quality improvements: Add related fix context when available Nov 13, 2023
@umpox umpox requested review from abeatrix and a team November 13, 2023 13:54
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.

nice!

@umpox umpox self-assigned this Nov 13, 2023
Base automatically changed from tr/faster-edits to main November 14, 2023 10:22
@umpox umpox closed this in #1639 Nov 14, 2023
umpox added a commit that referenced this pull request Nov 14, 2023
Part of #1544
Part of #1464

## Description

"Ask Cody to Fix" is one of the most common command actions we currently
have.

It makes sense to support this better instead of treating this like a
normal "edit"
- Skip fetching context, from my personal testing it very rarely helps.
Most information is contained within the error, or is part of
`relatedInformation` attached to the diagnostic
- We can start fetching more relevant context from sources directly
related to the fix: #1723
- Use a more targeted prompt preamble to address the task

## Test plan

- Fixups without code actions (edit/document/edit with no selection)
- Fixups through code action (Ask Cody to Fix)

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
@umpox umpox reopened this Nov 14, 2023
@umpox umpox merged commit 5a07f34 into main Nov 14, 2023
13 checks passed
@umpox umpox deleted the tr/better-fix-context branch November 14, 2023 11:21
@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.

None yet

2 participants