lang/cc: fix sem-highlight disabler

We unset ccls-sem-highlight-method buffer-locally, but
lsp-before-initialize-hook only runs once per new LSP server instance,
and each server could preside over any number of buffers, so only the
first buffer is affected.
This commit is contained in:
Henrik Lissner 2020-10-14 21:39:56 -04:00
parent 963f96b42f
commit d85c7b857b
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -285,8 +285,9 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
(set-evil-initial-state! 'ccls-tree-mode 'emacs)
;; Disable `ccls-sem-highlight-method' if `lsp-enable-semantic-highlighting'
;; is nil. Otherwise, it appears ccls bypasses it.
(setq-hook! 'lsp-before-initialize-hook
ccls-sem-highlight-method (if lsp-enable-semantic-highlighting ccls-sem-highlight-method))
(setq-hook! 'lsp-configure-hook
ccls-sem-highlight-method (if lsp-enable-semantic-highlighting
ccls-sem-highlight-method))
(when (or IS-MAC IS-LINUX)
(let ((cpu-count-command (cond (IS-MAC '("sysctl" "-n" "hw.ncpu"))
(IS-LINUX '("nproc"))