Request to add integration between IC2 and Github Copilot

Issue #2377 resolved
Philip Faulconer created an issue

The Jetbrains IDE integration with Copilot is a great tool. It would be wonderful to extend the integration or add a new IC2 integration to allow the use of Copilot in the Anonymous Apex window.

Official response

  • Scott Wells repo owner

    I’ve investigated this a bit and it seems that it’s something that the Github Copilot plugin dev team would need to resolve. The Anonymous Apex and SOQL Query tool window editors aren’t file-backed, and it appears that Copilot is only enabled for editors with physical files behind them. I’ll see if I can log an enhancement request against their plugin explaining how these lightweight editors work, but in the interim, there is a reasonable workaround in the form of scratch files. You can create an Apex scratch file:

    to write the same types of contents that you would in the Anonymous Apex or SOQL Query tool windows, and then you can open, execute, and debug the contents of those scratch files using the context actions keyboard shortcut:

    Copilot works just fine in those scratch files because they’re backed by physical files:

    Again, it’s not a perfect solution, but hopefully it will allow you to take advantage of Copilot while writing ad hoc, REPL-style scripts in IC2 until the Copilot plugin team can provide support for non-file-backed editors.

Comments (7)

  1. Scott Wells repo owner

    I’ve investigated this a bit and it seems that it’s something that the Github Copilot plugin dev team would need to resolve. The Anonymous Apex and SOQL Query tool window editors aren’t file-backed, and it appears that Copilot is only enabled for editors with physical files behind them. I’ll see if I can log an enhancement request against their plugin explaining how these lightweight editors work, but in the interim, there is a reasonable workaround in the form of scratch files. You can create an Apex scratch file:

    to write the same types of contents that you would in the Anonymous Apex or SOQL Query tool windows, and then you can open, execute, and debug the contents of those scratch files using the context actions keyboard shortcut:

    Copilot works just fine in those scratch files because they’re backed by physical files:

    Again, it’s not a perfect solution, but hopefully it will allow you to take advantage of Copilot while writing ad hoc, REPL-style scripts in IC2 until the Copilot plugin team can provide support for non-file-backed editors.

  2. Philip Faulconer reporter

    Yes, thanks for the investigation, Scott! Your workaround is very useful in the interim.

  3. Log in to comment