Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### New Features

- Add TRAMP support by spawning one Copilot server per remote host. Remote files are served by a server started on their host (over SSH, inside a container, etc.), which also enables sandboxing the server. A new `copilot-disconnect` command shuts down the server for the current buffer's host. ([#403](https://github.com/copilot-emacs/copilot.el/issues/403))
- Add experimental Agent mode for Copilot Chat (`copilot-chat-use-agent-mode`). When enabled, Copilot can run client-side tools (`run_in_terminal`, `create_file`, `get_errors`, `fetch_web_page`); each invocation prompts for confirmation unless listed in `copilot-chat-auto-approve-tools`. ([#441](https://github.com/copilot-emacs/copilot.el/issues/441))
- Add native binary installation support. `copilot-install-server` now falls back to downloading precompiled binaries when npm is unavailable, removing the Node.js requirement on supported platforms. A new `copilot-install-server-native` command is also available for explicit native installation.

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ Customization variables:
- **`copilot-nes-auto-dismiss-move-count`** — cursor movements before auto-dismissing (default `3`)
- **`copilot-nes-auto-dismiss-distance`** — max lines between point and suggestion before auto-dismissing (default `40`)

### Remote files (TRAMP)

Copilot works in buffers visiting remote files over TRAMP. A separate language server is started on each remote host (over SSH, inside a container, and so on) and used for that host's buffers, while local buffers keep using the local server. This also lets you sandbox the server by running it inside a restricted container.

The server must be installed on the remote host (run `M-x copilot-install-server` from a buffer on that host). `M-x copilot-disconnect` shuts down the server for the current buffer's host.

### Keybindings

`copilot-mode` does not set any keybindings by default. Use `copilot-completion-map` (active while a completion overlay is visible) to bind keys:
Expand Down
2 changes: 1 addition & 1 deletion copilot-chat.el
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ If not currently streaming, reset the conversation instead."
(buffer-local-value 'copilot-chat--streaming-p chat-buf))
(with-current-buffer chat-buf
(when (and copilot-chat--request-id (copilot--connection-alivep))
(jsonrpc-notify copilot--connection
(jsonrpc-notify (gethash (copilot--connection-key) copilot--connections)
'$/cancelRequest
(list :id copilot-chat--request-id)))
(copilot-chat--end-streaming)
Expand Down
382 changes: 240 additions & 142 deletions copilot.el

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions dev/integration-smoke.el
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@
(kill-buffer test-buf)))

;; Shutdown
(when copilot--connection
(jsonrpc-shutdown copilot--connection)
(setq copilot--connection nil))
(copilot--shutdown-all-servers)
(message "\nDone."))

(test--run)
Expand Down
6 changes: 2 additions & 4 deletions test/copilot-nes-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@
(edit (list :text "new"
:range (list :start (list :line 0 :character 0)
:end (list :line 0 :character 5))
:command cmd))
(copilot--connection t))
:command cmd)))
(spy-on 'copilot--connection-alivep :and-return-value t)
(spy-on 'jsonrpc-notify)
(copilot-nes--display edit)
Expand Down Expand Up @@ -501,8 +500,7 @@
(edit (list :text "planet"
:range (list :start (list :line 0 :character 6)
:end (list :line 0 :character 11))
:command cmd))
(copilot--connection t))
:command cmd)))
(spy-on 'copilot--connection-alivep :and-return-value t)
(spy-on 'jsonrpc-notify)
(copilot-nes--display edit)
Expand Down
Loading
Loading