Skip to content

feat: add current file context automatically to chat #5670

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

Merged
merged 11 commits into from
May 28, 2025

Conversation

uinstinct
Copy link
Contributor

@uinstinct uinstinct commented May 14, 2025

Description

This PR adds the ability to have the current file context added to a new chat.

I really like this feature from when I used Augment and wanted it in Continue.

In this PR:

  • adds a new vscode setting addFileContext for the extension
  • the file context is added a mention so that it is removable
  • the file context gets added when a new chat is initialized

Closes #5457

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screenshots

feat.mp4

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by mrge

Added a setting to automatically include the current file context as a removable mention when starting a new chat.

  • New Features
    • New addFileContext setting in VS Code extension.
    • Current file context is added to new chats if the setting is enabled.

@uinstinct uinstinct requested a review from a team as a code owner May 14, 2025 16:15
@uinstinct uinstinct requested review from Patrick-Erichsen and removed request for a team May 14, 2025 16:15
Copy link

netlify bot commented May 14, 2025

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit 835d4eb
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/68363a3602e0680008e79da1
😎 Deploy Preview https://deploy-preview-5670--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 14, 2025
@uinstinct uinstinct changed the title add current file context automatically to chat feat: add current file context automatically to chat May 15, 2025
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen left a comment

Choose a reason for hiding this comment

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

This looks great! We've gone back and forth on this feature in the past but I think it's worth experimenting with again.

That being said, I think this should be configured as a UI setting, not an IDE setting.

@RomneyDa recently added a new section for experimental settings in https://github.com/continuedev/continue/blob/main/gui/src/pages/config/UserSettingsForm.tsx, so let's move this in there and then it should be good to go 👍

My other comments were just a few small nitpicks.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs May 20, 2025
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen 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 making those updates! It looks like you moved the setting to the UI, but I was thinking specifically of placing it under the new "Experimental Settings" section. I think you just need to merge main and move the toggle to that section and then we're good to go 👍

@uinstinct
Copy link
Contributor Author

Apologies. Missed that part!
Made the changes now!

Also changed the vertical spacing on the experimental section to match with the other toggles' vertical spacing
image

Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen left a comment

Choose a reason for hiding this comment

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

Nice, thanks for cleaning up the UI while you were editing the experimental section! Appreciate your patience on the back and forth requests here, looking forward to getting this in next pre-release 🚀

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 27, 2025
@Patrick-Erichsen Patrick-Erichsen merged commit ff4d0c0 into continuedev:main May 28, 2025
59 of 61 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs May 28, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2025
@uinstinct uinstinct deleted the current-file branch May 28, 2025 04:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add ability to add local/IDE context automatically/easily
2 participants