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

Copilot Chat should directly apply suggestion as edited/new files #95

Closed
AndyOR-R opened this issue May 23, 2023 · 19 comments
Closed

Copilot Chat should directly apply suggestion as edited/new files #95

AndyOR-R opened this issue May 23, 2023 · 19 comments
Assignees
Labels
feature-request Request for new features or functionality panel-chat Chat conversation sidepanel

Comments

@AndyOR-R
Copy link

At a minimum we need to be able to give copilot access to the working directory and files.
I think many developers would like it to have write access as well as just read.

It could help speed up tasks such as making new reports when there are existing reports for copilot to use as a template.
Create new files based on what's being discussed etc.

I might be trying to jump a couple of years with the write access, but there's no reason it shouldn't be able to read what is right in front of it.

@SirV00lkon
Copy link

This shoul be a must, optional of course, but ready to roll at any moment

@NikiLentz
Copy link

I would also love that. Atm it's not able to do some things that intellisense can do, just because it doesn't know even the full open file.(for example "remove unused imports")

@NarHakobyan
Copy link

Yeah, I thought it has a access to whole project, but seems it doesn't and also as I can see it's working using gpt-3.5 so it doesn't make sense to use it. ChatGPT plus will work better.

@JohannesHoppe
Copy link

I see no reason why I should use Github Copilot Chat, when I have exactly the same user experience on https://chat.openai.com/ It would be a game changer if I could ask it questions regarding the whole codebase.

At least I have Chat GPT-4 there!
Screenshot 2023-05-25 at 13 18 12

@TitaniumKnight1
Copy link

I do appreciate that it is able to access and understand GitHub repositories which allow easy integration but without it being able to read my active files I cannot have it work as efficiently as I need it to. It often forgets what I am referencing so it starts building new code. If it is using GPT-3 it is definitely falling behind however I have yet to see it make horrible mistakes like outdated includes which GPT does quite often.

@digitarald digitarald added the chat-context Editor context for grounding conversations label May 31, 2023
@digitarald digitarald changed the title We need to be able to give it access to the project folder. Copilot Chat should directly apply suggestion as edited/new files Jun 3, 2023
@digitarald
Copy link
Contributor

Focusing this to the gist of the initial comment, giving Copilot write access.

@digitarald digitarald added the feature-request Request for new features or functionality label Jun 3, 2023
@Jenverse Jenverse added the context-increase Request that ask us to increase our current scope of contextual understanding label Jun 7, 2023
@roblourens roblourens added the panel-chat Chat conversation sidepanel label Jun 12, 2023
@roblourens roblourens self-assigned this Jun 12, 2023
@angrypro
Copy link

From what I understand, today the copilot has the same capacity as ChatGPT with an increase of being able to see the current context of the file that is open.

What I really wanted was to be able to give some commands like:

  • Copilot, create a crud for me based on the vehicles crud to register Elephants with id, name, sex and weight properties.

Copilot should already understand my source, my standards and create a list of new entity files, repository, models, controllers, routes etc and also modify more where necessary like permissions etc.

It could even show a summary of what would be changed first (like a GIT diff for example) and have an "Apply" button.

  • Copilot, change the "name" property to "fullName" in all files in the /public/resources directory.

After confirmation, the change should be applied.

Very close to what Microsoft is doing with the copilot for their tools, but in the entire VSCode project.

@mjomble
Copy link

mjomble commented Jul 24, 2023

For me, it's not that important to have Copilot be able to edit the file system directly.

I'd be happy with a more powerful version of the "Insert at Cursor" feature, which doesn't have file system access either, but changes code in the editor and lets you save it manually.

For example, I write in the chat panel that I want to refactor the code in a specific way and Copilot responds with something like this:

Make these changes in dir1/file1.ts:
(code diff block with an "Apply" button that edits file1.ts instead of inserting a new block of code)

Create new file dir2/file2.ts:
(collapsed long code block with an "Apply" button that's similar to "Insert into new file", but associates the new editor with the suggested file path, even if the file doesn't exist yet, so that it will be created after saving)

("Apply all" button)

It would, of course, be nice if I didn't have to manually save each open editor, but if "giving AI direct file system access" turns out to be a major blocker on this issue, I wouldn't mind pressing "Ctrl-K S" myself to do that 😁

@AndyOR-R
Copy link
Author

I appreciate how this is coming along. Copilot can sometimes see the file that I have open. Not sure why it doesn't recognize it every time.
But that still isn't enough for it to be truly useful. It needs to be able to read the entire project folder.
If I'm working on a web application it should already know what files I have in the folder, full awareness of the CSS being used etc. I understand there might need to be a limit on the amount of files/data it can read at any one point. Perhaps as a stepping stone we could just give it read access to all currently open files. Not just the current tab.
That would allow us to open the relevant CSS/HTML/TypeScript files so that copilot has a better understanding of what we are currently working on. I've done this with GPT4 by copying and pasting the different files into the chat window and it has been able to reference CSS etc. that it is now aware of.
Likewise if I'm working on a NodeJS script I'd like it to at least be able to read the package.json file and know what node modules I'm using. At the moment if I ask it a question about what I'm working on then it just answers it as though it'd dealing with a general question about code. I'd like it to be able to answer within the context of the project.

Really appreciate what you are working towards here. Changing the world ain't easy.

@AndyOR-R AndyOR-R reopened this Jul 31, 2023
@pepijndevos
Copy link

I was really hoping Copilot would help with tedious changes but it really doesn't. I made a commit that I want to apply in a dozen similar places. So I copied the diff into the chat, but it started simply printing what it thought the updated file would look like.

First of all it ran out of message length, secondly it seems like I'd need to manually copy-paste the code and hope for the best.

It seems like inline chat is able to make changes directly but only in a very local way. In this case this is slower than just using autocomplete.

I look forward to the day I can tell copilot to just go and execute a bunch of mechanical changes across the workspace for me.

@JohannesHoppe
Copy link

I'm unsubscribing now. You had several months to convince me, but using Chat GPT 4 directly is much more direct and useful. I'm surprised by the low quality of this product. There is literally no advantage or reason to use this plugin.

@digitarald
Copy link
Contributor

As clarification, GPT-4 is used for all chat panel questions since the latest release of Copilot Chat (0.10): #6 (comment)

The main idea of this issue, applying chat panel code directly, is being worked on. Meanwhile I recommend Inline Chat to apply Copilot edits directly to a single file.

@Wladefant
Copy link

@digitarald what I would suggest is adding some kind of button here
image
for "smart pasting". So that it uses inline chat to not think what the solutoin should be, but instead pastes in the right way. Because often the code block consists of code from different lines, sometimes with unnecessary definition of classes, which means you have to only select spefcific lines in the code, which amounts to even more work.

TLDR: "Smart" pasting from the sidebar code blocks with the help of inline chat.

@kakadais
Copy link

This was not applied yet?
To edit the code on the editor directly like the other AI plugin like 'continue' or 'AI Assistant for jetbrains'.

@s-nt-s
Copy link

s-nt-s commented Aug 20, 2024

Please let me know when github copilot can make bulk changes like "format code", "remove unused imports", "document functions", "add typing", etc.

From what I understand from this issue, this can't be done yet, right?

I'll wait until it can be done to buy the subscription.

@riadhnet
Copy link

i agree, this would be a powerful thing, otherwise i would copy paste like i do with other ai sites

@digitarald
Copy link
Contributor

Hey 👋 subscribers and readers: The July release added a smart action for applying Chat's codeblocks directly to the open file – not for new file or multiple files yet, so I am keeping this issue open, but as we polish the quality of this basic flow, we will explore those.

Image

Please try this out and report feedback (via new issues, please), helping us make this work rock-solid for y'all.

@digitarald digitarald removed chat-context Editor context for grounding conversations context-increase Request that ask us to increase our current scope of contextual understanding labels Aug 21, 2024
@jwedel
Copy link

jwedel commented Oct 10, 2024

One step further, think about the follwoing use case:

  • I want to apply a transformation to multiple files
  • I select let's say 5 files
  • Enter a prompt like "Remove all comments" or "transform the bullet point list into an AsciiDoc table using xy as headers.."
  • Apply that to all files (sequencially). There is actually no need to put all files into context at the same time.

@isidorn
Copy link

isidorn commented Oct 31, 2024

This is now done, please try out the Copilot Edits view and let us know what you think
https://code.visualstudio.com/docs/copilot/copilot-edits

@isidorn isidorn closed this as completed Oct 31, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality panel-chat Chat conversation sidepanel
Projects
None yet
Development

No branches or pull requests