之前嘗試,(setq cquery-sem-highlight-method 'overlay)
慢得不能忍( 感覺 'font-lock 也挺慢的)
Andreas Politz 有個 對 overlay 使用數據結構的改進 (list zipper? → red-black tree) Re: Overlays as an AA-tree
某個 issue 中 Andreas Politz 提到他放棄了……(以及標題未更正,他的patch據說從 AA tree 改成 red-black tree 了)
(defconst my-cquery-packages '((cquery :location local)))
;; See also https://github.com/jacobdufault/cquery/wiki/Emacs
(defun my-cquery/init-cquery ()
(require 'lsp-imenu)
(use-package cquery
:after lsp-mode
:config
;; overlay is slow
;; WAIT https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00084.html
(setq cquery-sem-highlight-method 'font-lock)
;; cquery.cl cquery--publich-semantic-highlighting is very slow
(setq cquery-enable-sem-highlight t)
(setq cquery-extra-init-params '(:enableComments 2 :cacheFormat "msgpack"))
(add-hook 'c-mode-common-hook #'my-cquery//enable)))