@@ -192,6 +192,14 @@ As defined by the Language Server Protocol 3.16."
192
192
:group 'lsp-mode
193
193
:type 'boolean)
194
194
195
+ (defcustom lsp-progress-spinner-type 'progress-bar
196
+ "Holds the type of spinner to be used in the mode-line.
197
+ Takes a value accepted by `spinner-start'."
198
+ :group 'lsp-mode
199
+ :type `(choice :tag "Choose a spinner by name"
200
+ ,@(mapcar (lambda (c) (list 'const (car c)))
201
+ spinner-types)))
202
+
195
203
(defvar-local lsp--cur-workspace nil)
196
204
197
205
(defvar-local lsp--cur-version 0)
@@ -1328,7 +1336,7 @@ the lists according to METHOD."
1328
1336
1329
1337
(defun lsp--spinner-start ()
1330
1338
"Start spinner indication."
1331
- (condition-case _err (spinner-start ' progress-bar-filled ) (error)))
1339
+ (condition-case _err (spinner-start (lsp- progress-spinner-type) ) (error)))
1332
1340
1333
1341
(defun lsp--propertize (str type)
1334
1342
"Propertize STR as per TYPE."
@@ -2056,7 +2064,7 @@ WORKSPACE is the workspace that contains the progress token."
2056
2064
(-let* (((&WorkDoneProgressBegin :title :percentage?) value)
2057
2065
(reporter
2058
2066
(if lsp-progress-via-spinner
2059
- (let* ((spinner-strings (alist-get ' progress-bar spinner-types))
2067
+ (let* ((spinner-strings (alist-get (lsp- progress-spinner-type) spinner-types))
2060
2068
;; Set message as a tooltip for the spinner strings
2061
2069
(propertized-strings
2062
2070
(seq-map (lambda (string) (propertize string 'help-echo title))
@@ -8826,6 +8834,10 @@ This avoids overloading the server with many files when starting Emacs."
8826
8834
(unless (flycheck-checker-supports-major-mode-p 'lsp mode)
8827
8835
(flycheck-add-mode 'lsp mode)))
8828
8836
8837
+ (defun lsp-progress-spinner-type ()
8838
+ "Retrive the spinner type value, if value is not a symbol of `spinner-types defaults to 'progress-bar."
8839
+ (or (car (assoc lsp-progress-spinner-type spinner-types)) 'progress-bar))
8840
+
8829
8841
(defun lsp-org ()
8830
8842
(interactive)
8831
8843
(-if-let ((virtual-buffer &as &plist :workspaces) (-first (-lambda ((&plist :in-range))
0 commit comments