Skip to content

Commit

Permalink
refactor: use copilot-ls / copilot-ls-remote as server ids
Browse files Browse the repository at this point in the history
  • Loading branch information
kassick committed Dec 7, 2024
1 parent 48bcf82 commit 1752d1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clients/lsp-copilot.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ lsp-install-server to fetch an emacs-local version of the LSP."
:type 'boolean
:group 'lsp-copilot)

(lsp-dependency 'lsp-copilot
(lsp-dependency 'copilot-ls
`(:system ,lsp-copilot-executable)
'(:npm :package "copilot-node-server"
:path "language-server.js"))
Expand Down Expand Up @@ -143,7 +143,7 @@ lsp-install-server to fetch an emacs-local version of the LSP."
This function is automatically called during the client initialization if needed"
(interactive)

(-when-let (workspace (--some (lsp-find-workspace it) '(lsp-copilot lsp-copilot-remote)))
(-when-let (workspace (--some (lsp-find-workspace it) '(copilot-ls copilot-ls-remote)))
(with-lsp-workspace workspace
(-when-let* ((response (lsp-request "signInInitiate" '(:dummy "dummy"))))
(-let (((&copilot-ls:SignInInitiateResponse? :status :user-code :verification-uri :expires-in :interval :user) response))
Expand Down Expand Up @@ -203,7 +203,7 @@ automatically, browse to %s." user-code verification-uri))
;; Server installed by emacs
(lsp-register-client
(make-lsp-client
:server-id 'lsp-copilot
:server-id 'copilot-ls
:new-connection (lsp-stdio-connection #'lsp-copilot--cmdline)
:activation-fn #'lsp-copilot--client-active-for-mode-p
:multi-root lsp-copilot-server-multi-root
Expand All @@ -223,12 +223,12 @@ automatically, browse to %s." user-code verification-uri))

(lsp-register-client
(make-lsp-client
:server-id 'lsp-copilot-remote
:server-id 'copilot-ls-remote
:new-connection (lsp-stdio-connection (lambda ()
`(,lsp-copilot-executable ,@lsp-copilot-langserver-command-args)))
`(,(lsp-package-path 'copilot-ls) ,@lsp-copilot-langserver-command-args)))
:activation-fn #'lsp-copilot--client-active-for-mode-p
:multi-root lsp-copilot-server-multi-root
:priority -2
:priority -1
:add-on? t
:completion-in-comments? t
:initialization-options #'lsp-copilot--server-initialization-options
Expand Down

0 comments on commit 1752d1c

Please sign in to comment.