zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.45k stars 67 forks source link

A question. Does copilot.lua expose the project or open tabs to copilot? #170

Closed moonlitknight closed 1 year ago

moonlitknight commented 1 year ago

Many thanks for the plugin. I hope it's OK to ask a question here.

I read that Vscode shares the content of open tabs with copilot in order to improve the project context. Does copilot.lua do the same thing, ie. should I be opening multiple tabs within my project in order to improve the copilot suggestions?

Similarly, if it's up to the editor to decide which files are exposed to copilot, could copilot.lua be enhanced to allow me to share my entire project (or a configured subset) with copilot to improve the context without the overhead of opening multiple files?

zbirenbaum commented 1 year ago

My instinct and anecdotal experience supports the idea that requesting a completion from a buffer forwards it's content enters copilot's scope. Opening a new buffer is enough to attach the client to it and should be sufficient.

To do this without opening a buffer requires workspace support, which im not certain copilot has.

You would have to ask this in the copilot discussion or try and format + read the packed code inside the lsp server js file to figure this out since copilot.vim doesn't do any special handling for it that I'm aware of.