tareqimbasher / NetPad

A cross-platform C# editor and playground.
MIT License
1.25k stars 66 forks source link

[Feature Request] Integrate GitHub Copilot #127

Open JKamsker opened 9 months ago

JKamsker commented 9 months ago

I think (Github) copilot would make the editor much more powerful.

tareqimbasher commented 9 months ago

I've been wanting to add something like this for a while, would be awesome. Unfortunately GitHub Copilot APIs are not public yet, or at least publicly documented which makes it hard to build a proper integration with it. I've seen some projects integrate with it so I'll take a look, but the answer might be going with OpenAI instead.

JKamsker commented 9 months ago

Hey, @tareqimbasher ! Thanks for your answer, i have seen how it turned out for linqpad, who went for openai and i can say its far from usable. You have to trigger the completion manually and it doesnt reay fit to the entered code :/

Maybe its just about good prompting and text detection/merging...

JKamsker commented 9 months ago

Atleast the neovim plugin seems to be open source https://github.com/github/copilot.vim

I have looked into it a bit (and the vs extension) and it looks very complicated to use 😅

tareqimbasher commented 9 months ago

Yeah :confused: I'll take a look at the source and see what's involved.

JKamsker commented 9 months ago

I'm probably making it too easy for myself, but would it be possible to just host VSCode as the text editor? Given that the NetPad frontend is effectively a sophisticated web interface, it might be a viable route to explore. If VSCode would be used as the frontend, the project could potentially benefit from GitHub Copilot integration, not to mention all the other premade plugins that come with it. It could be a substantial value addition. What do you think?

JKamsker commented 9 months ago

I have found something that might help: https://github.com/CopilotKit/CopilotKit

tareqimbasher commented 8 months ago

I have thought about integrating into VS Code but I always end up alot of unanswered questions, like: what part of NetPad would be part of the "VS Code plugin"?

Would it be just the .Dump capability and rendering data in an output window? Essentially a .NET NuGet lib that when used can interface with a NetPad backend (hosted by a plugin you install) and render the data for you. Or would it be pretty much all the functionality (run a dedicated script independent of any .NET project the user has open in VS Code at the time with its own NuGet packages, DbConnections...etc) but substituting the frontend for VS Code?

If its the later, there are some other questions like how easy/awkward would it be to build a fully functional NetPad interface (or a minimalist version of it) within a VS Code plugin. How easy/awkward would it be download, run and manage the .NET app, the backend of NetPad, from a VS Code plugin.

That CopilotKit repo looks promising, I'll check it out!