Skip to content

Commit

Permalink
change set-client-capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Dec 22, 2020
1 parent b80f663 commit 4bdd553
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/methods/lifetime.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:use :cl)
(:import-from :cl-lsp/server
:define-method
:this-server
:set-client-capabilities)
(:import-from :cl-lsp/swank
:swank-init)
Expand Down Expand Up @@ -71,7 +72,7 @@
))

(define-method "initialize" (params protocol:initialize-params) ()
(set-client-capabilities params)
(set-client-capabilities params (this-server))
(json:object-to-json
(make-instance 'protocol:initialize-result
:capabilities (make-server-capabilities)
Expand Down
6 changes: 2 additions & 4 deletions src/server.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
(defclass abstract-server ()
((client-capabilities
:initform nil
:accessor server-client-capabilities)))
:reader server-client-capabilities
:writer set-client-capabilities)))

(defun register-all-methods (server)
(dolist (class (closer-mop:class-direct-subclasses (find-class 'request)))
Expand All @@ -46,9 +47,6 @@
(defmacro with-server ((server) &body body)
`(let ((*server* ,server)) ,@body))

(defun set-client-capabilities (capabilities)
(setf (server-client-capabilities (this-server)) capabilities))

;;; json-object-converter
(defclass json-object-converter ()
((params-type
Expand Down

0 comments on commit 4bdd553

Please sign in to comment.