From 979c201bf159340584b9f701761ceb38569b601f Mon Sep 17 00:00:00 2001 From: Andrew Whatson Date: Tue, 12 Mar 2019 23:20:28 +1000 Subject: [PATCH] Fix latest company-box all-the-icons configuration --- modules/completion/company/config.el | 81 ++++++++++++++++------------ 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/modules/completion/company/config.el b/modules/completion/company/config.el index 350b84d83..b247dddde 100644 --- a/modules/completion/company/config.el +++ b/modules/completion/company/config.el @@ -59,39 +59,54 @@ (setq company-box-show-single-candidate t company-box-backends-colors nil company-box-max-candidates 50 - company-box-icons-yasnippet (all-the-icons-material "short_text" :height 0.8 :face 'all-the-icons-green) - company-box-icons-unknown (all-the-icons-material "find_in_page" :height 0.8 :face 'all-the-icons-purple) - company-box-icons-elisp - (list (all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red) - (all-the-icons-material "check_circle" :height 0.8 :face 'all-the-icons-blue) - (all-the-icons-material "stars" :height 0.8 :face 'all-the-icons-orange) - (all-the-icons-material "format_paint" :height 0.8 :face 'all-the-icons-pink)) - company-box-icons-lsp - `((1 . ,(all-the-icons-material "text_fields" :height 0.8 :face 'all-the-icons-green)) ; text - (2 . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) ; method - (3 . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) ; function - (4 . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) ; constructor - (5 . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) ; field - (6 . ,(all-the-icons-material "adjust" :height 0.8 :face 'all-the-icons-blue)) ; variable - (7 . ,(all-the-icons-material "class" :height 0.8 :face 'all-the-icons-red)) ; class - (8 . ,(all-the-icons-material "settings_input_component" :height 0.8 :face 'all-the-icons-red)) ; interface - (9 . ,(all-the-icons-material "view_module" :height 0.8 :face 'all-the-icons-red)) ; module - (10 . ,(all-the-icons-material "settings" :height 0.8 :face 'all-the-icons-red)) ; property - (11 . ,(all-the-icons-material "straighten" :height 0.8 :face 'all-the-icons-red)) ; unit - (12 . ,(all-the-icons-material "filter_1" :height 0.8 :face 'all-the-icons-red)) ; value - (13 . ,(all-the-icons-material "plus_one" :height 0.8 :face 'all-the-icons-red)) ; enum - (14 . ,(all-the-icons-material "filter_center_focus" :height 0.8 :face 'all-the-icons-red)) ; keyword - (15 . ,(all-the-icons-material "short_text" :height 0.8 :face 'all-the-icons-red)) ; snippet - (16 . ,(all-the-icons-material "color_lens" :height 0.8 :face 'all-the-icons-red)) ; color - (17 . ,(all-the-icons-material "insert_drive_file" :height 0.8 :face 'all-the-icons-red)) ; file - (18 . ,(all-the-icons-material "collections_bookmark" :height 0.8 :face 'all-the-icons-red)) ; reference - (19 . ,(all-the-icons-material "folder" :height 0.8 :face 'all-the-icons-red)) ; folder - (20 . ,(all-the-icons-material "people" :height 0.8 :face 'all-the-icons-red)) ; enumMember - (21 . ,(all-the-icons-material "pause_circle_filled" :height 0.8 :face 'all-the-icons-red)) ; constant - (22 . ,(all-the-icons-material "streetview" :height 0.8 :face 'all-the-icons-red)) ; struct - (23 . ,(all-the-icons-material "event" :height 0.8 :face 'all-the-icons-red)) ; event - (24 . ,(all-the-icons-material "control_point" :height 0.8 :face 'all-the-icons-red)) ; operator - (25 . ,(all-the-icons-material "class" :height 0.8 :face 'all-the-icons-red))))) + company-box-icons-alist 'company-box-icons-all-the-icons + company-box-icons-functions + '(+company-box-icons--yasnippet company-box-icons--lsp +company-box-icons--elisp company-box-icons--acphp) + company-box-icons-all-the-icons + `((Unknown . ,(all-the-icons-material "find_in_page" :height 0.8 :face 'all-the-icons-purple)) + (Text . ,(all-the-icons-material "text_fields" :height 0.8 :face 'all-the-icons-green)) + (Method . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) + (Function . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) + (Constructor . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) + (Field . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) + (Variable . ,(all-the-icons-material "adjust" :height 0.8 :face 'all-the-icons-blue)) + (Class . ,(all-the-icons-material "class" :height 0.8 :face 'all-the-icons-red)) + (Interface . ,(all-the-icons-material "settings_input_component" :height 0.8 :face 'all-the-icons-red)) + (Module . ,(all-the-icons-material "view_module" :height 0.8 :face 'all-the-icons-red)) + (Property . ,(all-the-icons-material "settings" :height 0.8 :face 'all-the-icons-red)) + (Unit . ,(all-the-icons-material "straighten" :height 0.8 :face 'all-the-icons-red)) + (Value . ,(all-the-icons-material "filter_1" :height 0.8 :face 'all-the-icons-red)) + (Enum . ,(all-the-icons-material "plus_one" :height 0.8 :face 'all-the-icons-red)) + (Keyword . ,(all-the-icons-material "filter_center_focus" :height 0.8 :face 'all-the-icons-red)) + (Snippet . ,(all-the-icons-material "short_text" :height 0.8 :face 'all-the-icons-red)) + (Color . ,(all-the-icons-material "color_lens" :height 0.8 :face 'all-the-icons-red)) + (File . ,(all-the-icons-material "insert_drive_file" :height 0.8 :face 'all-the-icons-red)) + (Reference . ,(all-the-icons-material "collections_bookmark" :height 0.8 :face 'all-the-icons-red)) + (Folder . ,(all-the-icons-material "folder" :height 0.8 :face 'all-the-icons-red)) + (EnumMember . ,(all-the-icons-material "people" :height 0.8 :face 'all-the-icons-red)) + (Constant . ,(all-the-icons-material "pause_circle_filled" :height 0.8 :face 'all-the-icons-red)) + (Struct . ,(all-the-icons-material "streetview" :height 0.8 :face 'all-the-icons-red)) + (Event . ,(all-the-icons-material "event" :height 0.8 :face 'all-the-icons-red)) + (Operator . ,(all-the-icons-material "control_point" :height 0.8 :face 'all-the-icons-red)) + (TypeParameter . ,(all-the-icons-material "class" :height 0.8 :face 'all-the-icons-red)) + ;; (Template . ,(company-box-icons-image "Template.png")))) + (Yasnippet . ,(all-the-icons-material "short_text" :height 0.8 :face 'all-the-icons-green)) + (ElispFunction . ,(all-the-icons-material "functions" :height 0.8 :face 'all-the-icons-red)) + (ElispVariable . ,(all-the-icons-material "check_circle" :height 0.8 :face 'all-the-icons-blue)) + (ElispFeature . ,(all-the-icons-material "stars" :height 0.8 :face 'all-the-icons-orange)) + (ElispFace . ,(all-the-icons-material "format_paint" :height 0.8 :face 'all-the-icons-pink)))) + + (defun +company-box-icons--yasnippet (candidate) + (when (get-text-property 0 'yas-annotation candidate) + 'Yasnippet)) + + (defun +company-box-icons--elisp (candidate) + (when (derived-mode-p 'emacs-lisp-mode) + (let ((sym (intern candidate))) + (cond ((fboundp sym) 'ElispFunction) + ((boundp sym) 'ElispVariable) + ((featurep sym) 'ElispFeature) + ((facep sym) 'ElispFace)))))) (def-package! company-dict