Eliminate compiler warnings.

This commit is contained in:
Vincent Zhang 2019-05-23 16:47:30 +08:00
parent b2b7e60798
commit c5226e4aae
2 changed files with 28 additions and 26 deletions

View file

@ -497,7 +497,7 @@ If the actual char height is larger, it respects the actual char height.")
'mode-line 'mode-line
'mode-line-inactive))) 'mode-line-inactive)))
(defsubst doom-modeline--char-height () (defsubst doom-modeline--font-height ()
"Calculate the actual char height of the mode-line." "Calculate the actual char height of the mode-line."
(ceiling (* 1.68 (frame-char-height)))) (ceiling (* 1.68 (frame-char-height))))

View file

@ -148,9 +148,9 @@
(declare-function jsonrpc-last-error 'jsonrpc) (declare-function jsonrpc-last-error 'jsonrpc)
(declare-function lsp--workspace-print 'lsp-mode) (declare-function lsp--workspace-print 'lsp-mode)
(declare-function lsp-describe-session 'lsp-mode) (declare-function lsp-describe-session 'lsp-mode)
(declare-function lsp-restart-workspace 'lsp-mode)
(declare-function lsp-shutdown-workspace 'lsp-mode)
(declare-function lsp-workspace-folders-open 'lsp-mode) (declare-function lsp-workspace-folders-open 'lsp-mode)
(declare-function lsp-workspace-restart 'lsp-mode)
(declare-function lsp-workspace-shutdown 'lsp-mode)
(declare-function lsp-workspaces 'lsp-mode) (declare-function lsp-workspaces 'lsp-mode)
(declare-function magit-toplevel 'magit-git) (declare-function magit-toplevel 'magit-git)
(declare-function mc/num-cursors 'multiple-cursors-core) (declare-function mc/num-cursors 'multiple-cursors-core)
@ -1624,34 +1624,36 @@ mouse-3: Describe current input method")
(face (if workspaces 'success 'warning)) (face (if workspaces 'success 'warning))
(icon (doom-modeline-lsp-icon "LSP" face))) (icon (doom-modeline-lsp-icon "LSP" face)))
(propertize icon (propertize icon
'help-echo (if workspaces 'help-echo
(concat "LSP Connected " (if workspaces
(string-join (--map (format "[%s]\n" (lsp--workspace-print it)) (concat "LSP Connected "
workspaces)) (string-join (--map (format "[%s]\n" (lsp--workspace-print it))
"C-mouse-1: Switch to another workspace folder workspaces))
"C-mouse-1: Switch to another workspace folder
mouse-1: Describe current session mouse-1: Describe current session
mouse-2: Quit server mouse-2: Quit server
mouse-3: Reconnect to server") mouse-3: Reconnect to server")
"LSP Disconnected "LSP Disconnected
mouse-1: Reload to start server") mouse-1: Reload to start server")
'mouse-face '(:box 0) 'mouse-face '(:box 0)
'local-map (let ((map (make-sparse-keymap))) 'local-map
(if workspaces (let ((map (make-sparse-keymap)))
(progn (if workspaces
(define-key map [mode-line C-mouse-1] (progn
#'lsp-workspace-folders-open) (define-key map [mode-line C-mouse-1]
(define-key map [mode-line mouse-1] #'lsp-workspace-folders-open)
#'lsp-describe-session) (define-key map [mode-line mouse-1]
(define-key map [mode-line mouse-2] #'lsp-describe-session)
#'lsp-shutdown-workspace) (define-key map [mode-line mouse-2]
(define-key map [mode-line mouse-3] #'lsp-workspace-shutdown)
#'lsp-restart-workspace)) (define-key map [mode-line mouse-3]
(progn #'lsp-workspace-restart))
(define-key map [mode-line mouse-1] (progn
(lambda () (define-key map [mode-line mouse-1]
(interactive) (lambda ()
(revert-buffer t t))))) (interactive)
map))))) (revert-buffer t t)))))
map)))))
(add-hook 'lsp-mode-hook #'doom-modeline-update-lsp) (add-hook 'lsp-mode-hook #'doom-modeline-update-lsp)
(add-hook 'lsp-after-uninitialized-hook #'doom-modeline-update-lsp) (add-hook 'lsp-after-uninitialized-hook #'doom-modeline-update-lsp)