Skip to content
Merged
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
22 changes: 14 additions & 8 deletions copilot.el
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,28 @@ Enabling event logging may slightly affect performance."
(jsonrpc-shutdown copilot--connection)
(setq copilot--connection nil))
(setq copilot--opened-buffers nil)
;; We are going to send a test request for the current buffer so we have to activate the mode
;; if it is not already activated.
;; If it the mode is already active, we have to make sure the current buffer is loaded in the
;; agent.
(if copilot-mode
(copilot--on-doc-focus (selected-window))
(copilot-mode))
(copilot--async-request 'getCompletions
'(:doc (:version 0
:source "\n"
:path ""
:uri ""
:relativePath ""
:languageId "text"
:position (:line 0 :character 0)))
`(:doc (:version 0
:source "\n"
:path ""
:uri ,(copilot--get-uri)
:relativePath ""
:languageId "text"
:position (:line 0 :character 0)))
:success-fn (lambda (_)
(message "Copilot OK."))
:error-fn (lambda (err)
(message "Copilot error: %S" err))
:timeout-fn (lambda ()
(message "Copilot agent timeout."))))


;;
;; Auto completion
;;
Expand Down