Commit d930651a authored by Fangrui Song's avatar Fangrui Song

Add ccls-info and clean up

parent d5f0605e
......@@ -93,8 +93,7 @@
;; Notification handlers
;; ---------------------------------------------------------------------
(defvar ccls--handlers
'(("$ccls/progress" . (lambda (_w _p))))
(defvar ccls--handlers nil
"List of cons-cells of (METHOD . HANDLER) pairs, where METHOD is the lsp method to handle,
and handler is a function invoked as (handler WORKSPACE PARAMS), where WORKSPACE is the current
lsp-workspace, and PARAMS is a hashmap of the params recieved with the notification.")
......@@ -107,10 +106,6 @@ lsp-workspace, and PARAMS is a hashmap of the params recieved with the notificat
"Execute a ccls command."
(pcase command
;; Code actions
('"ccls._applyFixIt"
(find-file (lsp--uri-to-path (gethash "uri" args)))
(seq-doseq (edit data)
(ccls--apply-textedit edit)))
('"ccls.xref" ;; Used by code lenses
(xref--show-xrefs (lsp--locations-to-xref-items
(lsp--send-request (lsp--make-request "workspace/executeCommand") command arguments)) nil))
......
......@@ -98,6 +98,11 @@ root location or `nil' if subsequent matchers should be used instead.
;; ---------------------------------------------------------------------
;; Other ccls-specific methods
;; ---------------------------------------------------------------------
;;
(defun ccls-info ()
(lsp--cur-workspace-check)
(lsp--send-request
(lsp--make-request "$ccls/info")))
(defun ccls-file-info ()
(lsp--cur-workspace-check)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment