Customizing the Copilot API
1. Introduction
Copilot4Eclipse integrates GitHub’s Copilot service directly into the Eclipse IDE by embedding a lightweight Copilot API bridge. Under the hood, this bridge is implemented as a Node.js–based program that communicates with GitHub’s online Copilot servers and feeds completion results back to the IDE.
The following discusion presents the three supported strategies for running the Copilot API in priority order:
-
Copilot API Runtime (Primary Strategy)
Copilot4Eclipse includes a self-contained executable version of the copilot api. This results in a frictionless, zero-configuration experience on supported operating systems.Supported platforms:
- Windows (x64)
- macOS (x64 & ARM)
- Linux (x64 & ARM)
-
Classic Node Runtime (Fallback Strategies)
Used only when no Copilot API Runtime is available for your OS platform—or when you explicitly choose for a classic Node.js runtime environment. There are two sub-options:-
Node.Embedder plugin: An Eclipse plugin dependency (org.eclipse.wildwebdeveloper.embedder.node 1.0.6 or greater) that spawns and manages a dedicated, isolated Node.js v20+ process internally, without requiring a system-wide Node.js installation.
-
Local Node.js runtime: Leverages the developer’s existing global
node
installation, giving you full control over Node.js version and environment.
Prerequisite: If you choose a Classic Node.js strategy, you must have Node.js v20.8 or later installed.
-
By default, Copilot4Eclipse will detect and use the Copilot API Runtime bundle whenever it’s available for your platform. If you encounter compatibility issues, need to debug the Node.js process, or prefer to manage Node.js yourself, you can disable the primary runtime and fall back to one of the Classic Node Runtime approaches.
2. Disable Copilot API Runtime
To force Copilot4Eclipse to skip the bundled native runtime and fall back to a Classic Node.js strategy, set this system property when launching Eclipse:
c4e.api.nativeapp.enabled=false
In eclipse.ini
- Open your ECLIPSE_HOME/eclipse.ini file
- Add the property on its own line after -vmargs:
-vmargs
-Dc4e.api.nativeapp.enabled=false
- Via the command line
Launch Eclipse with:
eclipse -vmargs -Dc4e.api.nativeapp.enabled=false
3. Classic Node.js Runtime
3.1 Disable Node.Embedder Plugin
If you prefer not to use the Eclipse node.embedder
plugin’s bundled Node.js runtime, disable it by setting this system property when launching Eclipse:
-Dc4e.api.embeddednode.enabled=false
- In eclipse.ini
Add the property on its own line after -vmargs:
-vmargs
-Dc4e.api.embeddednode.enabled=false
- On the command line
Launch Eclipse with:
eclipse -vmargs -Dc4e.api.embeddednode.enabled=false
3.2 Local Node.js Runtime Detection Order
When you fall back to the Local Node.js strategy, Copilot4Eclipse locates your node executable in this priority:
-
node.executable
system property -
NODE_HOME
environment variable -
PATH
environment variable -
Common install locations
- Windows:
C:\Program Files\nodejs\node.exe
- macOS (Homebrew):
/usr/local/bin/node
or/opt/homebrew/bin/node
- Linux:
/usr/bin/node
or/usr/local/bin/node
- Windows:
Ensure your chosen Node.js is v20.8 or later to meet the minimum requirement.