mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
Optimize lsp segment.
This commit is contained in:
parent
24d30ccc1e
commit
ee4619d367
1 changed files with 23 additions and 21 deletions
|
@ -1622,8 +1622,10 @@ mouse-3: Describe current input method")
|
||||||
'help-echo
|
'help-echo
|
||||||
(if workspaces
|
(if workspaces
|
||||||
(concat "LSP Connected "
|
(concat "LSP Connected "
|
||||||
(string-join (--map (format "[%s]\n" (lsp--workspace-print it))
|
(string-join
|
||||||
workspaces))
|
(mapcar (lambda (w)
|
||||||
|
(format "[%s]\n" (lsp--workspace-print w)))
|
||||||
|
workspaces))
|
||||||
"C-mouse-1: Switch to another workspace folder
|
"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
|
||||||
|
@ -1631,28 +1633,28 @@ 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
|
'local-map (let ((map (make-sparse-keymap)))
|
||||||
(let ((map (make-sparse-keymap)))
|
(if workspaces
|
||||||
(if workspaces
|
(progn
|
||||||
(progn
|
(define-key map [mode-line C-mouse-1]
|
||||||
(define-key map [mode-line C-mouse-1]
|
#'lsp-workspace-folders-open)
|
||||||
#'lsp-workspace-folders-open)
|
(define-key map [mode-line mouse-1]
|
||||||
(define-key map [mode-line mouse-1]
|
#'lsp-describe-session)
|
||||||
#'lsp-describe-session)
|
(define-key map [mode-line mouse-2]
|
||||||
(define-key map [mode-line mouse-2]
|
#'lsp-workspace-shutdown)
|
||||||
#'lsp-workspace-shutdown)
|
(define-key map [mode-line mouse-3]
|
||||||
(define-key map [mode-line mouse-3]
|
#'lsp-workspace-restart))
|
||||||
#'lsp-workspace-restart))
|
(progn
|
||||||
(progn
|
(define-key map [mode-line mouse-1]
|
||||||
(define-key map [mode-line mouse-1]
|
(lambda ()
|
||||||
(lambda ()
|
(interactive)
|
||||||
(interactive)
|
(ignore-errors (revert-buffer t t))))))
|
||||||
(ignore-errors (revert-buffer t t))))))
|
map)))))
|
||||||
map)))))
|
(add-hook 'lsp-before-initialize-hook #'doom-modeline-update-lsp)
|
||||||
(add-hook 'lsp-after-initialize-hook #'doom-modeline-update-lsp)
|
(add-hook 'lsp-after-initialize-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)
|
||||||
|
(add-hook 'lsp-before-open-hook #'doom-modeline-update-lsp)
|
||||||
(add-hook 'lsp-after-open-hook #'doom-modeline-update-lsp)
|
(add-hook 'lsp-after-open-hook #'doom-modeline-update-lsp)
|
||||||
(add-hook 'lsp-workspace-folders-changed-hook #'doom-modeline-update-lsp)
|
|
||||||
|
|
||||||
(defvar-local doom-modeline--eglot nil)
|
(defvar-local doom-modeline--eglot nil)
|
||||||
(defun doom-modeline-update-eglot ()
|
(defun doom-modeline-update-eglot ()
|
||||||
|
|
Loading…
Reference in a new issue