(defun lsp//sync-peek-face () "Synchronize the face used in lsp-ui peek window according to the theme." (set-face-attribute 'lsp-ui-peek-list nil :background (face-attribute 'hl-line :background nil t)) (set-face-attribute 'lsp-ui-peek-peek nil :background (face-attribute 'hl-line :background nil t)) (set-face-attribute 'lsp-ui-peek-selection nil :background (face-attribute 'highlight :background nil t) :foreground (face-attribute 'default :foreground nil t)) (set-face-attribute 'lsp-ui-peek-filename nil :foreground (face-attribute 'font-lock-constant-face :foreground nil t)) (set-face-attribute 'lsp-ui-peek-highlight nil :background (face-attribute 'highlight :background nil t) :foreground (face-attribute 'highlight :foreground nil t) :distant-foreground (face-attribute 'highlight :foreground nil t)) (set-face-attribute 'lsp-ui-peek-header nil :background (face-attribute 'highlight :background nil t) :foreground (face-attribute 'default :foreground nil t)) )