;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\307\310\301\311\312& \210\313\314\315\316\317DD\320\321\322\310\303&\210\313\323\315\316\324DD\325\321\326\310\303\327\330& \210\313\331\315\316\332DD\325\321\322\310\303\327\333& \210\334\335\336\337\310\303%\210\334\340\341\337\310\303%\210\342\343\344\304#\210\345\211\203z\211@\343N\203s\344N\204s\346\344\343N#\210A\266\202\202Y\210\347\343\344\350#\210\313\344\315\316\351DD\352\310\303\321\353\327\354& \207" [require lsp-mode custom-declare-group lsp-modeline nil "LSP support for modeline" :prefix "lsp-modeline-" :group :tag "LSP Modeline" custom-declare-variable lsp-modeline-code-actions-kind-regex funcall function #[0 "\300\207" [#1="$\\|quickfix.*\\|refactor.*"] 1 #1#] "Regex for the code actions kinds to show in the modeline." :type string lsp-modeline-code-actions-segments #[0 "\300\207" [(count icon)] 1] "Define what should display on the modeline when code actions are available." (repeat (choice (const :tag "Show the lightbulb icon" icon) (const :tag "Show the name of the preferred code action" name) (const :tag "Show the count of how many code actions available" count))) :package-version (lsp-mode . "7.1") lsp-modeline-code-action-fallback-icon #[0 "\300\207" [#2="💡"] 1 #2#] (lsp-mode . "7.1") custom-declare-face lsp-modeline-code-actions-face ((t :inherit homoglyph)) "Face used to code action text on modeline." lsp-modeline-code-actions-preferred-face ((t :foreground "yellow")) defvaralias lsp-diagnostics-modeline-scope lsp-modeline-diagnostics-scope (saved-value saved-variable-comment) put make-obsolete-variable "lsp-mode 7.0.1" #[0 "\300\207" [:workspace] 1] "The modeline diagnostics scope." (choice (const :tag "File" :file) (const :tag "Project" :workspace) (const :tag "All Projects" :global)) (lsp-mode . "6.3")] 10) #@51 Holds the current code action string on modeline. (defvar lsp-modeline--code-actions-string nil (#$ . 1909)) (make-variable-buffer-local 'lsp-modeline--code-actions-string) #@93 Return the face checking if there is any PREFERRED-CODE-ACTION. (fn PREFERRED-CODE-ACTION) (defalias 'lsp-modeline--code-action-face #[257 "\211\203\300\207\301\207" [lsp-modeline-code-actions-preferred-face lsp-modeline-code-actions-face] 2 (#$ . 2088)]) #@65 Build the icon for modeline code actions using FACE. (fn FACE) (defalias 'lsp-modeline--code-actions-icon #[257 "\301\302\303\304#\203\305\306\307\310\311%\207\312\313#\207" [lsp-modeline-code-action-fallback-icon require all-the-icons nil t all-the-icons-octicon "light-bulb" :face :v-adjust -0.0575 propertize face] 7 (#$ . 2353)]) #@117 Return the code action name from ACTIONS and PREFERRED-CODE-ACTION-TITLE. (fn ACTIONS PREFERRED-CODE-ACTION-TITLE) (defalias 'lsp-modeline--code-action-name #[514 "\211\206 \300\301!!\207" [lsp-modeline--code-action->string lsp-seq-first] 5 (#$ . 2700)]) #@54 Convert code ACTION to friendly string. (fn ACTION) (defalias 'lsp-modeline--code-action->string #[257 "\300\301\302\303!#\207" [replace-regexp-in-string "[\n ]+" " " lsp:code-action-title] 6 (#$ . 2964)]) #@72 Build the code ACTIONS string from the defined segments. (fn ACTIONS) (defalias 'lsp-modeline--build-code-actions-segments #[257 "\211\211\205 \301\302\"\262\211\205\303!\262\304!\305\306\307$\310#\207" [lsp-modeline-code-actions-segments -first lsp:code-action-is-preferred\? lsp-modeline--code-action->string lsp-modeline--code-action-face mapconcat make-closure #[257 "\211\303\267\202\304\302!\207\305\306\300\301\"\307\302#\207\305\310\311\300!!\307\302#\207\312\207" [V0 V1 V2 #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (icon 6 name 10 count 19)) lsp-modeline--code-actions-icon propertize lsp-modeline--code-action-name face number-to-string seq-length nil] 5 "\n\n(fn SEGMENT)"] " "] 9 (#$ . 3179)]) #@78 Build the string to be presented on modeline for code ACTIONS. (fn ACTIONS) (defalias 'lsp-modeline--build-code-actions-string #[257 "\211G\300U\301\302\303!\211\205\304\305\"\262\211\205\306!\262\307Q\310!\211\205)\311\312\"\262\211\2052\313!\262\314\315G\316\317\320\"\203L\321\n\"\202M\322P\323\324\325\326\327\330\331#\"\257$\210\332\230?\205j\333P\207" [1 "(" where-is-internal lsp-execute-code-action -find #[257 "\211\300H\301>?\207" [0 (menu-bar normal-state)] 3 "\n\n(fn O)"] key-description ")" lsp-modeline--build-code-actions-segments -first lsp:code-action-is-preferred\? lsp-modeline--code-action->string add-text-properties 0 help-echo format "Apply code actions %s\nmouse-1: " lsp-modeline--code-action-name "select from multiple code actions" mouse-face mode-line-highlight local-map make-mode-line-mouse-map mouse-1 make-closure #[0 "\301\203\n\302\303\300!!\207\302\304\300!!\207" [V0 V1 lsp-execute-code-action lsp-seq-first lsp--select-action] 3 nil nil] "" " "] 19 (#$ . 3950)]) #@54 Update modeline with new code ACTIONS. (fn ACTIONS) (defalias 'lsp--modeline-update-code-actions #[257 "\203\n\302\303\"\262\304!\203\305\202\306!\307 \207" [lsp-modeline-code-actions-kind-regex lsp-modeline--code-actions-string seq-filter #[257 "\301\302\"\211?\206 \303\"\207" [lsp-modeline-code-actions-kind-regex gethash "kind" s-match] 5 "\n\n(fn INPUT0)"] seq-empty-p "" lsp-modeline--build-code-actions-string force-mode-line-update] 4 (#$ . 4994)]) #@73 Request code actions to update modeline for given BUFFER. (fn &rest _) (defalias 'lsp-modeline--check-code-actions #[128 "\300\301!\205\302\301\303 \304\305\306\307\310&\207" [lsp-feature\? "textDocument/codeAction" lsp-request-async lsp--text-document-code-action-params lsp--modeline-update-code-actions :mode unchanged :cancel-token :lsp-modeline-code-actions] 9 (#$ . 5473)]) #@39 Enable code actions on modeline mode. (defalias 'lsp-modeline--enable-code-actions #[0 "\205 \301\302!\205 \303\304!\207" [lsp-modeline-code-actions-enable lsp-feature\? "textDocument/codeAction" lsp-modeline-code-actions-mode 1] 2 (#$ . 5863)]) #@40 Disable code actions on modeline mode. (defalias 'lsp-modeline--disable-code-actions #[0 "\300\301!\207" [lsp-modeline-code-actions-mode -1] 2 (#$ . 6118)]) #@129 Non-nil if Lsp-Modeline-Code-Actions mode is enabled. Use the command `lsp-modeline-code-actions-mode' to change this variable. (defvar lsp-modeline-code-actions-mode nil (#$ . 6282)) (make-variable-buffer-local 'lsp-modeline-code-actions-mode) #@618 Toggle code actions on modeline. This is a minor mode. If called interactively, toggle the `Lsp-Modeline-Code-Actions mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `lsp-modeline-code-actions-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'lsp-modeline-code-actions-mode #[256 "\303 \304=\203 ?\202\247\203\305W\203\306\202\307\310\301!\2031\311\300 \"\2031\300 B\203R\312\302\313\"\210\314\315\316\306\307$\210\314\317\320\306\307$\210\314\321\322\306\307$\210\202i\323\315\316\307#\210\323\317\320\307#\210\323\321\322\307#\210\324\325\n\"\326\327\203s\330\202t\331\"\210\332\333!\203\226\303 \203\210\211\303 \232\203\226\334\335\203\222\336\202\223\337\340#\210\210\341 \210\207" [lsp-modeline-code-actions-mode local-minor-modes global-mode-string current-message toggle 1 nil t boundp delq add-to-list (t (:eval lsp-modeline--code-actions-string)) add-hook lsp-on-idle-hook lsp-modeline--check-code-actions lsp-configure-hook lsp-modeline--enable-code-actions lsp-unconfigure-hook lsp-modeline--disable-code-actions remove-hook remove (t (:eval lsp-modeline--code-actions-string)) run-hooks lsp-modeline-code-actions-mode-hook lsp-modeline-code-actions-mode-on-hook lsp-modeline-code-actions-mode-off-hook called-interactively-p any message "Lsp-Modeline-Code-Actions mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 7 (#$ . 6534) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar lsp-modeline-code-actions-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205#\310\211%\207" [lsp-modeline-code-actions-mode-map lsp-modeline-code-actions-mode-hook variable-documentation put "Hook run after entering or leaving `lsp-modeline-code-actions-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode lsp-modeline-code-actions-mode "" boundp] 6) #@49 Value of current buffer diagnostics statistics. (defvar lsp-modeline--diagnostics-string nil (#$ . 8995)) (make-variable-buffer-local 'lsp-modeline--diagnostics-string) #@87 Plist of workspaces to their modeline strings. The `:global' workspace is global one. (defvar lsp-modeline--diagnostics-wks->strings nil (#$ . 9170)) #@77 Calculate diagnostics statistics based on `lsp-modeline-diagnostics-scope'. (defalias 'lsp-modeline-diagnostics-statistics #[0 "\306=\203\f\307 C\202\310\311\312=!!\313 \314\"\315\314\316\317\320\"\"\210\211 W\203jH\314V\203c\321\322\323H\"\324\nU\203C\325\202^ U\203M\326\202^\fU\203W\327\202^ U\205^\327#C\244\262\211T\262\202!\321\330\331\"\332\333\334\335\336\337\340\315\341#\205\200\342\343\344\"&\207" [lsp-modeline-diagnostics-scope lsp/diagnostic-severity-max lsp/diagnostic-severity-error lsp/diagnostic-severity-warning lsp/diagnostic-severity-information lsp/diagnostic-severity-hint :file lsp--get-buffer-diagnostics ht-values lsp-diagnostics :workspace make-vector 0 nil mapc make-closure #[257 "\301\302\303\300\"\"\207" [V0 mapc make-closure #[257 "\301!\205\n\302\303\"\211\205\300HTI\266\202\207" [V0 ht\? gethash "severity"] 8 "\n\n(fn DIAG)"]] 5 "\n\n(fn BUF-DIAGS)"] propertize format "%s" face error warning success s-join "/" mouse-face mode-line-highlight help-echo "mouse-1: Show diagnostics" local-map require lsp-treemacs t make-mode-line-mouse-map mouse-1 lsp-treemacs-errors-list] 15 (#$ . 9326)]) #@39 Reset the modeline diagnostics cache. (defalias 'lsp-modeline--diagnostics-reset-modeline-cache #[0 "\302\303 @\304#\210\302\305\304#\210\304\211\207" [lsp-modeline--diagnostics-wks->strings lsp-modeline--diagnostics-string plist-put lsp-workspaces nil :global] 4 (#$ . 10502)]) #@37 Update diagnostics modeline string. (defalias 'lsp-modeline--diagnostics-update-modeline #[0 "\303\304\267\202? \206@\211 \202@\305 @\306\n\"\206% \307\n#\211\262\262\202@\306\n\310\"\206@\211 \307\n\310#\211\262\202@\311\211\207" [lsp-modeline-diagnostics-scope lsp-modeline--diagnostics-string lsp-modeline--diagnostics-wks->strings #[0 "\300 \211\211\301\230\262\203 \301\207\211\302P\207" [lsp-modeline-diagnostics-statistics "" " "] 4] #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:file 7 :workspace 16 :global 42)) lsp-workspaces plist-get plist-put :global nil] 7 (#$ . 10790)]) #@38 Enable diagnostics on modeline mode. (defalias 'lsp-modeline--enable-diagnostics #[0 "\205 \301\302!\205 \303\304!\207" [lsp-modeline-diagnostics-enable lsp-feature\? "textDocument/publishDiagnostics" lsp-modeline-diagnostics-mode 1] 2 (#$ . 11444)]) #@39 Disable diagnostics on modeline mode. (defalias 'lsp-modeline--disable-diagnostics #[0 "\300\301!\207" [lsp-modeline-diagnostics-mode -1] 2 (#$ . 11704)]) (byte-code "\300\301\302\303#\210\304\301\302\305#\207" [defalias lsp-diagnostics-modeline-mode lsp-modeline-diagnostics-mode nil make-obsolete "lsp-mode 7.0.1"] 4) #@127 Non-nil if Lsp-Modeline-Diagnostics mode is enabled. Use the command `lsp-modeline-diagnostics-mode' to change this variable. (defvar lsp-modeline-diagnostics-mode nil (#$ . 12031)) (make-variable-buffer-local 'lsp-modeline-diagnostics-mode) #@612 Toggle diagnostics modeline. This is a minor mode. If called interactively, toggle the `Lsp-Modeline-Diagnostics mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `lsp-modeline-diagnostics-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'lsp-modeline-diagnostics-mode #[256 "\303 \304=\203 ?\202\247\203\305W\203\306\202\307\310\301!\2031\311\300 \"\2031\300 B\203P\312\313\314\306\307$\210\312\315\316\306\307$\210\317\302\320\"\210\312\321\322\"\210\202f\323\313\314\307#\210\323\315\316\307#\210\323\321\322\"\210\324\325\n\"\326\327\203p\330\202q\331\"\210\332\333!\203\223\303 \203\205\211\303 \232\203\223\334\335\203\217\336\202\220\337\340#\210\210\341 \210\207" [lsp-modeline-diagnostics-mode local-minor-modes global-mode-string current-message toggle 1 nil t boundp delq add-hook lsp-configure-hook lsp-modeline--enable-diagnostics lsp-unconfigure-hook lsp-modeline--disable-diagnostics add-to-list (t (:eval (lsp-modeline--diagnostics-update-modeline))) lsp-diagnostics-updated-hook lsp-modeline--diagnostics-reset-modeline-cache remove-hook remove (t (:eval (lsp-modeline--diagnostics-update-modeline))) run-hooks lsp-modeline-diagnostics-mode-hook lsp-modeline-diagnostics-mode-on-hook lsp-modeline-diagnostics-mode-off-hook called-interactively-p any message "Lsp-Modeline-Diagnostics mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 7 (#$ . 12280) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar lsp-modeline-diagnostics-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205#\310\211%\207" [lsp-modeline-diagnostics-mode-map lsp-modeline-diagnostics-mode-hook variable-documentation put "Hook run after entering or leaving `lsp-modeline-diagnostics-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode lsp-modeline-diagnostics-mode "" boundp] 6) #@36 Build the workspace status string. (defalias 'lsp-modeline--workspace-status-string #[0 "\300\207" [(t (:eval (-keep #'lsp--workspace-status-string (lsp-workspaces))))] 1 (#$ . 14759)]) #@38 Enable workspace status on modeline. (defalias 'lsp-modeline--enable-workspace-status #[0 "\301 \302\300!\210\303\"\203\202\211B\211\207" [global-mode-string lsp-modeline--workspace-status-string make-local-variable -contains\?] 4 (#$ . 14951)]) #@39 Disable workspace status on modeline. (defalias 'lsp-modeline--disable-workspace-status #[0 "\301 \302\300!\210\303\"\211\207" [global-mode-string lsp-modeline--workspace-status-string make-local-variable remove] 4 (#$ . 15212)]) #@137 Non-nil if Lsp-Modeline-Workspace-Status mode is enabled. Use the command `lsp-modeline-workspace-status-mode' to change this variable. (defvar lsp-modeline-workspace-status-mode nil (#$ . 15452)) (make-variable-buffer-local 'lsp-modeline-workspace-status-mode) #@630 Toggle workspace status on modeline. This is a minor mode. If called interactively, toggle the `Lsp-Modeline-Workspace-Status mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `lsp-modeline-workspace-status-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'lsp-modeline-workspace-status-mode #[256 "\302 \303=\203 ?\202\247\203\304W\203\305\202\306\307\301!\2031\310\300 \"\2031\300 B\203F\311\312\313\305\306$\210\311\314\315\305\306$\210\202R\316\312\313\306#\210\316\314\315\306#\210\317\320\203\\\321\202]\322\"\210\323\324!\203\302 \203q\211\302 \232\203\325\326\203{\327\202|\330\331#\210\210\332 \210\207" [lsp-modeline-workspace-status-mode local-minor-modes current-message toggle 1 nil t boundp delq add-hook lsp-configure-hook lsp-modeline--enable-workspace-status lsp-unconfigure-hook lsp-modeline--disable-workspace-status remove-hook run-hooks lsp-modeline-workspace-status-mode-hook lsp-modeline-workspace-status-mode-on-hook lsp-modeline-workspace-status-mode-off-hook called-interactively-p any message "Lsp-Modeline-Workspace-Status mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 7 (#$ . 15721) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar lsp-modeline-workspace-status-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205#\310\211%\207" [lsp-modeline-workspace-status-mode-map lsp-modeline-workspace-status-mode-hook variable-documentation put "Hook run after entering or leaving `lsp-modeline-workspace-status-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode lsp-modeline-workspace-status-mode "" boundp] 6) (defconst lsp-modeline-plist-value-when-compiled nil) (provide 'lsp-modeline)