emacs: update lsp-ui-peek-*

Fangrui Song 2018-10-30 22:45:21 -07:00
parent 82467cc8d7
commit f94131fed5

@ -145,13 +145,8 @@ Aside from definitions/references/workspace symbol, ccls provides some LSP exten
; Use lsp-goto-implementation or lsp-ui-peek-find-implementation for derived types/functions
;; Alternatively, use lsp-ui-peek interface
(lsp-ui-peek-find-custom 'caller "$ccls/call")
(lsp-ui-peek-find-custom 'callee "$ccls/call" '(:callee t))
(defun ccls/vars (kind) (lsp-ui-peek-find-custom 'vars "$ccls/vars" `(:kind ,kind)))
(ccls/vars 3) ;; field or local variable
(ccls/vars 1) ;; field
(ccls/vars 4) ;; parameter
(lsp-ui-peek-find-custom "$ccls/call")
(lsp-ui-peek-find-custom "$ccls/call" '(:callee t))
```
Recommended helpers:
@ -159,19 +154,19 @@ Recommended helpers:
```elisp
(defun ccls/callee ()
(interactive)
(lsp-ui-peek-find-custom 'callee "$ccls/call" '(:callee t)))
(lsp-ui-peek-find-custom "$ccls/call" '(:callee t)))
(defun ccls/caller ()
(interactive)
(lsp-ui-peek-find-custom 'caller "$ccls/call"))
(lsp-ui-peek-find-custom "$ccls/call"))
(defun ccls/vars (kind)
(lsp-ui-peek-find-custom 'vars "$ccls/vars" `(:kind ,kind)))
(lsp-ui-peek-find-custom "$ccls/vars" `(:kind ,kind)))
(defun ccls/base (levels)
(lsp-ui-peek-find-custom 'base "$ccls/inheritance" `(:levels ,levels)))
(lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels)))
(defun ccls/derived (levels)
(lsp-ui-peek-find-custom 'derived "$ccls/inheritance" `(:levels ,levels :derived t)))
(lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels :derived t)))
(defun ccls/member (kind)
(interactive)
(lsp-ui-peek-find-custom 'member "$ccls/member" `(:kind ,kind)))
(lsp-ui-peek-find-custom "$ccls/member" `(:kind ,kind)))
;; ccls/vars ccls/base ccls/derived ccls/members have a parameter while others are interactive.
;; (ccls/base 1)
@ -180,6 +175,8 @@ Recommended helpers:
;; (ccls/member 3) => 3 (Func) => member functions / functions in a namespace
;; (ccls/member 0) => member variables / variables in a namespace
;; (ccls/vars 3) => field or local variable
;; (ccls/vars 1) => field
;; (ccls/vars 4) => parameter
```
Hierarchies provide a flattened xref interface: