Jump to content
Al T

How to use an external editor like VScode and GitHub Copilot for Delphi 11 Alexandria?

Recommended Posts

I'm trying to figure out if this is even possible.

 

It seems that GitHub Copilot only works with a select few editors.

 

Which external editor would work best with Delphi so that GitHub Copilot could be used?

 

Any ideas?

 

 

 

Share this post


Link to post

Thank y'all!

 

I was able to get DelphiLSP working with VScode only after I deleted my serial numbers and registered them again.

 

Share this post


Link to post

Delphi/pascal file in IntelliJ IDEA and Copilot suggestions.

With I-Pascal plugin for IntelliJ (available for versions before 2022.1) - https://plugins.jetbrains.com/plugin/7340-i-pascal

 

In the editor on the left side - suggested auto-complete
On the right side - copilot panel with multiple suggestions

 

Without hint

image.thumb.png.ac5edde72a725c3a45ad1f410be67688.png

 

With hint (the comment on the first line)

image.thumb.png.8ffa7166daf591f57f2bc5b776352d6a.png

  • Like 1

Share this post


Link to post

I've never heard of the Delphi IDE "using" an external editor. The integration between the editor and the rest of the IDE (designer, object inspector, tool palette, etc) would likely need a heavy refactor or rewrite. But as  @Lars Fosdal mentioned, you can edit Pascal source in any text editor. The project below is a Delphi plug-in that adds a command to the Tools menu to open the current unit in Visual Code. With a little configuration, you could switch between Delphi and Visual Code at will, taking advantage of features in Visual Code such as Copilot.

 

EditInVsCodeDelphiPlugin

  • Thanks 2

Share this post


Link to post

If the form designer of Delphi could be called out-of-process, it could be paired with VSCode, and personally, I really like VSCode.

Then again, the shortcuts in the BDS IDE are engrained in my muscle memory...

Share this post


Link to post
Posted (edited)

I have found these 3 plugins for "chat":

 

https://github.com/AliDehbansiahkarbon/ChatGPTWizard/blob/main/README.md

https://github.com/Code4Delphi/Delphi-AI-Developer

https://github.com/FMXExpress/CodeDroidAI

 

But none has a level of integration similar to Copilot.

_____

 

This is not a plugin but just a guy that says that Copilot can generate Delphi code:

 

Edited by FreeDelphiPascal

Share this post


Link to post

I tried Cursor this week.

The program is still early beta. Realy early beta. Strange things are happening there.

But when it would be ready, for non Delphi programmers (those HTML/JS coders without a true IDE), it is promising.

 

In some cases it will output good ideas/code, in other cases, absolutely monumental garbage, like

        TListBox.Items[0].Visible:= false; (wishful thinking?)

In the end I the time spent on garbage equalized the time when it produced good code/ideas. I think it would be rather useful to produce ideas instead of code.

But considering that you need to understand and review other's code.... I ended up with a negative score.

 

But the end conclusion is that unless it is integrated into Delphi IDE it will not help a well seasoned Delphi programmer. It will rather disturb you.

I am not even mentioning, that you can only use it on PAS files that have no DFM associated since Cursor cannot edit your DFM files!

 

Edited by FreeDelphiPascal

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×