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

feat: at file in chat input box #1549

Closed
wants to merge 19 commits into from
Closed

feat: at file in chat input box #1549

wants to merge 19 commits into from

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Oct 31, 2023

CLOSE #1523

WIP

image

Test plan

@toolmantim
Copy link
Contributor

Woohoo! I know this is a WIP, but I just gave it a go to give some early feedback. Awesome start. Two things I noticed:

  1. The menu doesn't seem to trigger consistently when you type @… seems to want you to type a forward slash or . before appearing
  2. Hitting Enter when the menu is showing shouldn't submit, that should only act as a selection

@abeatrix
Copy link
Contributor Author

abeatrix commented Nov 2, 2023

Woohoo! I know this is a WIP, but I just gave it a go to give some early feedback. Awesome start. Two things I noticed:

  1. The menu doesn't seem to trigger consistently when you type @… seems to want you to type a forward slash or . before appearing
  2. Hitting Enter when the menu is showing shouldn't submit, that should only act as a selection

Thanks for testing this out! I've fixed the both issues in the PR. Also fixed the same issue (#1) on main in #1592

abeatrix added a commit that referenced this pull request Nov 10, 2023
Continue from #1549
Close #1523


https://github.com/sourcegraph/cody/assets/68532117/0d2d868a-8031-4067-b933-705f331f539f

This adds PR support for passing context files to recipe from chat
input. The context files are extracted from the codebase and passed to
the recipe context.
- Create context messages from context files
- Generate display text including context file names
- Add getTextEditorContentForContextFile method in editor to get content
for context files
- Update editor interface to support getting content for context files
- Add ContextFile type to represent context files
- Add userInputContextFiles property to RecipeContext for passing
context files
- Update RecipeContext to accept ContextFile[]
- Generate context messages from ContextFile[]
- Update chat question recipe to support getContextFilesContext
- Pass editor context as ContextFile[] to custom prompt and chat
question handler

> This PR focuses on implementing the feature that allows users to add
local workspace file via @ command via chat box.

## Next

- [ ] A widget that allows user to toggle between including enhanced
context with chat questions or not
#1524
- [ ] Replace current context file display widget with the new UI for
enhanced context #1525

## Test plan

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->

- [ ] In the input box inside the new Chat view, add files from the
current workspace using the `@` command
- [ ] Typing `@` will display a pop up where you can select files in the
current workspace
- [ ] Typing `@` without additional character will show a list of
currently opened files for you to choose
- [ ] Typing `@` follow by additional character will update the file
list and display results that matches the file path and symbol names
when available
  - [ ] Allow you to attach multiple files via @
  - [ ] Ask a question with a file attached using the `@` command
- [ ] Cody should have context about the file or symbol you attached
using the `@` command
    - [ ] The @-file is a link that's clickable in user's display text


![image](https://github.com/sourcegraph/cody/assets/68532117/97459faf-2e64-4a08-954a-b4d747c5fa69)

---------

Co-authored-by: Tom Ross <tom@umpox.com>
@abeatrix abeatrix closed this Nov 14, 2023
@abeatrix abeatrix deleted the bee/at-file branch January 17, 2024 18:39
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.

VSCE: New Chat - @ file context via chat input
2 participants