Emacs: LSP: Improve semantic highlighting.

This commit is contained in:
tastytea 2020-12-01 18:27:57 +01:00
parent da1717684a
commit 79a2e89344
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,6 @@
;;; lsp.el --- Language Server Protocol. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-11-13T14:50:05+0100>
;; Time-stamp: <2020-12-01T18:20:29+0100>
;;; Commentary:
@ -21,8 +21,16 @@
(lsp-eldoc-render-all t)
(lsp-restart 'auto-restart)
(lsp-enable-semantic-highlighting t) ; Needs clangd 11(?).
(lsp-semantic-tokens-apply-modifiers t)
(lsp-prefer-capf t)
(lsp-keymap-prefix "C-c l"))
:custom-face
;; Semantic highlighting. TODO: Check later if better options are available.
(lsp-face-semhl-variable ((t (:inherit font-lock-variable-name-face
:italic t))))
(lsp-face-semhl-parameter ((t (:inherit font-lock-variable-name-face
:italic t :underline t))))
(lsp-face-semhl-member ((t (:inherit default))))
:config (progn
(setq lsp-clients-clangd-args '("--compile-commands-dir=build"))
;; Add “-clang-tidy” to clangd args if the version supports it.