;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\301\311\312&\210\313\314\315\316\310\317%\210\313\320\321\316\310\317%\207" [require lsp-mode custom-declare-variable lsp-lens-debounce-interval funcall function #[0 "\300\207" [0.2] 1] "Debounce interval for loading lenses." :group :type number custom-declare-face lsp-lens-mouse-face ((t :height 0.8 :inherit link)) "The face used for code lens overlays." lsp-faces lsp-lens-face ((t :height 0.8 :inherit shadow))] 8) (defvar lsp-lens--modified\? nil nil) (make-variable-buffer-local 'lsp-lens--modified\?) #@17 Current lenses. (defvar lsp-lens--overlays nil (#$ . 653)) (make-variable-buffer-local 'lsp-lens--overlays) #@77 Pair of points which holds the last window location the lenses were loaded. (defvar lsp-lens--page nil (#$ . 767)) (make-variable-buffer-local 'lsp-lens--page) #@56 The number of lenses the last time they were rendered. (defvar lsp-lens--last-count nil (#$ . 933)) (make-variable-buffer-local 'lsp-lens--last-count) #@28 Backends providing lenses. (defvar lsp-lens-backends '(lsp-lens--backend) (#$ . 1090)) #@31 Refresh timer for the lenses. (defvar lsp-lens--refresh-timer nil (#$ . 1183)) (make-variable-buffer-local 'lsp-lens--refresh-timer) #@77 Pair of points which holds the last window location the lenses were loaded. (defvar lsp-lens--data nil (#$ . 1322)) (make-variable-buffer-local 'lsp-lens--data) (defvar lsp-lens--backend-cache nil nil) (make-variable-buffer-local 'lsp-lens--backend-cache) #@131 Measure the width of the text between FROM and TO. Results are meaningful only if FROM and TO are on the same line. (fn FROM TO) (defalias 'lsp-lens--text-width #[514 "\212\211b\210i)\212b\210i)Z\207" [] 4 (#$ . 1585)]) #@40 Redraw quick-peek overlay OV. (fn OV) (defalias 'lsp-lens--update #[257 "\300\212\301 \210`)\212\302 \210`)\"\303\304\"\305\306\"\307Q\212\310!b\210\311\312#\210\311\313#)\207" [lsp-lens--text-width beginning-of-visual-line beginning-of-line-text make-string 32 overlay-get lsp--lens-contents "\n" overlay-start overlay-put before-string lsp-original] 7 (#$ . 1813)]) #@54 Find or create a lens for the line at POS. (fn POS) (defalias 'lsp-lens--overlay-ensure-at #[257 "\301\302\303\"\"\211\205\212b\210\304\305 \306 T#\210)\211\262\206C\212\211b\210\307\305 \306 T\310\311\211%)\312\313\311#\210\312\314\311#\210\312\315#\210\211\262\207" [lsp-lens--overlays -first make-closure #[257 "\301\300\"\207" [V0 lsp-lens--overlay-matches-pos] 4 "\n\n(fn OV)"] move-overlay point-at-bol point-at-eol make-overlay nil t overlay-put lsp-lens evaporate lsp-lens-position] 7 (#$ . 2195)]) #@80 Show STR in an inline window at POS including METADATA. (fn STR POS METADATA) (defalias 'lsp-lens--show #[771 "\300!\212b\210\211\301\302#\266\211\301\303#\266\304!\210)\207" [lsp-lens--overlay-ensure-at overlay-put lsp--lens-contents lsp--metadata lsp-lens--update] 9 (#$ . 2723)]) #@64 Create idle function for buffer BUFFER. (fn &optional BUFFER) (defalias 'lsp-lens--idle-function #[256 "\211\203\np=\205\301 \302 B\232?\205\303\304!\207" [lsp-lens--page window-start window-end lsp-lens--schedule-refresh nil] 3 (#$ . 3023)]) #@50 Check if OV is a lens covering POS. (fn OV POS) (defalias 'lsp-lens--overlay-matches-pos #[514 "\300\301\"\205\302!\205\302!X\205\211\303!W\207" [overlay-get lsp-lens overlay-start overlay-end] 5 (#$ . 3280)]) #@46 Handler for `after-save-hook' for lens mode. (defalias 'lsp-lens--after-save #[0 "\300\301!\207" [lsp-lens--schedule-refresh t] 2 (#$ . 3508)]) #@120 Call each of the backend. BUFFER-MODIFIED? determines whether the buffer is modified or not. (fn BUFFER-MODIFIED\=\?) (defalias 'lsp-lens--schedule-refresh #[257 "\211\203 \304!\210\210\305 \306 B\307\n\310\311 \206p%\211\207" [lsp-lens--refresh-timer lsp-lens--page lsp-lens-debounce-interval lsp-lens--modified\? cancel-timer window-start window-end run-with-timer nil lsp-lens--refresh] 7 (#$ . 3659)]) #@50 Build the lens keymap for COMMAND. (fn COMMAND) (defalias 'lsp-lens--keymap #[257 "\300 \301\302\303!#\210\207" [make-sparse-keymap define-key [mouse-1] lsp-lens--create-interactive-command] 7 (#$ . 4080)]) #@64 Create an interactive COMMAND? for the lens. (fn COMMAND\=\?) (defalias 'lsp-lens--create-interactive-command #[257 "\206\303 @\304! >\204\305\306\307D\"\210\211\310H\262\304!\n>\204*\305\306\311D\"\210\211\312H\262\313!\2037\207\314\315#\207" [lsp--cur-workspace cl-struct-lsp--workspace-tags cl-struct-lsp--client-tags lsp-workspaces type-of signal wrong-type-argument lsp--workspace 5 lsp--client 15 functionp make-closure #[0 "\302\301\303\304\300!!\305\300!#\207" [V0 V1 lsp-execute-command intern lsp:command-command lsp:command-arguments\?] 5 nil nil]] 6 (#$ . 4296)]) #@27 Show LENSES. (fn LENSES) (defalias 'lsp-lens--display #[257 "\303\304\305\"\204\211G =\204\211?\2053\211G\306\307\310\311\312\313\314\315\"\"\"\"\316\317\320\"\n\"\210\211\211\262\207" [lsp-lens--modified\? lsp-lens--last-count lsp-lens--overlays nil -any\? #[257 "\300\301\"\211?\207" [gethash "_processed"] 4 "\n\n(fn INPUT0)"] -map #[257 "\211A\300\301\"\302\303\"\304\305\306\307\310\311#\"\312\313\314@!!!#\207" [-sort #[128 "\211AA\203\302\300\303\301\"\"\207\211A\203\300\301@!\301A@!\"\207\211\203*\300\301@!!\207\300 \207" [< #[128 #1="\302\300\"\301\303\304\211\203#\211A\262\242\262\262T\262!\262\202\266\207" [lsp:code-lens-range (lsp:range-start lsp:position-character) apply 0 nil] 8 #2="\n\n(fn &rest ARGS)"] apply mapcar] 6 "\n\n(fn &rest ARGS)"] -map #[257 "\211\300\301\"\300\302\"\300\303\"\304\305\206\306\307\310!\311\312\313\314\f!& \207" [gethash "command" "title" "_face" propertize face lsp-lens-face action lsp-lens--create-interactive-command mouse-face lsp-lens-mouse-face local-map lsp-lens--keymap] 16 "\n\n(fn INPUT0)"] lsp-lens--show s-join propertize "|" face lsp-lens-face lsp--position-to-point lsp:range-start lsp:code-lens-range] 10 "\n\n(fn INPUT0)"] -group-by #[128 #1# [lsp:code-lens-range (lsp:range-start lsp:position-line) apply 0 nil] 8 #2#] mapcar #[257 "\211\300\301\302#\210\207" [lsp-put :_processed t] 6 "\n\n(fn IT)"] -filter lsp:code-lens-command\? mapc make-closure #[257 "\301\300\"\205\302!\205\303e\304\305\"d#?\205\306!\207" [V0 -contains\? overlay-start <= overlay-get lsp-lens-position delete-overlay] 6 "\n\n(fn OVERLAY)"]] 10 (#$ . 4896)]) #@148 Refresh lenses using lenses backend. BUFFER-MODIFIED? determines whether the BUFFER is modified or not. (fn BUFFER-MODIFIED\=\? &optional BUFFER) (defalias 'lsp-lens--refresh #[513 "\211\206p\301!\205*r\211q\210\211\205'\211@\211\302\303#\"\210A\266\202\202\262)\207" [lsp-lens-backends buffer-live-p make-closure #[514 "\302\300!\205r\300q\210\303\301#)\207" [V0 V1 buffer-live-p lsp-lens--process] 6 "\n\n(fn LENSES VERSION)"]] 11 (#$ . 6570)]) #@196 Process LENSES originated from BACKEND. VERSION is the version of the file. The lenses has to be refreshed only when all backends have reported for the same version. (fn BACKEND LENSES VERSION) (defalias 'lsp-lens--process #[771 "\206\302 \303\304\305\"B#\210\306\307\310!\" G\311!U\2032\312\313\"\2032\314\315\304\316\307\"\"!\210\210\207" [lsp-lens--data lsp-lens-backends make-hash-table puthash append nil -filter cl-rest ht-values hash-table-count seq-every-p #[257 "\211@\211?\206\n\211=\207" [lsp--cur-version] 4 "\n\n(fn INPUT0)"] lsp-lens--display apply -map] 10 (#$ . 7043)]) #@49 Return t if LENS has to be loaded. (fn INPUT0) (defalias 'lsp--lens-backend-not-loaded\? #[257 "\300\301\300\302\"\"\300\303\"\300\304\"\305\306 \307!\310 #\205\"?\205\"\211?\207" [gethash "start" "range" "command" "_pending" < window-start lsp--position-to-point window-end] 8 (#$ . 7652)]) #@49 Return t if LENS has to be loaded. (fn INPUT0) (defalias 'lsp--lens-backend-present\? #[257 "\300\301\300\302\"\"\300\303\"\211\206\304\305 \306!\307 #?\207" [gethash "start" "range" "command" < window-start lsp--position-to-point window-end] 7 (#$ . 7958)]) #@320 Fetch LENSES without command in for the current window. TICK is the buffer modified tick. If it does not match `buffer-modified-tick' at the time of receiving the updates the updates must be discarded.. CALLBACK - the callback for the lenses. FILE-VERSION - the version of the file. (fn LENSES CALLBACK FILE-VERSION) (defalias 'lsp-lens--backend-fetch-missing #[771 "\300\301\302$\303\304\"\"\207" [seq-each make-closure #[257 "\304\305\"\306\307\310#\210\306\305\311#\210\312\313\314\315\300\301\302%\316\317%)\207" [V0 V1 V2 lsp--cur-workspace lsp-get :_workspace lsp-put :_pending t nil lsp-request-async "codeLens/resolve" make-closure #[257 "\304\305\"\306\303\307\310#\210\306\303\311#\210\312\313\300\"\205\301\300\302\"\207" [V0 V1 V2 V3 gethash "command" lsp-put :_pending nil :command seq-every-p lsp--lens-backend-present\?] 6 "\n\n(fn INPUT0)"] :mode tick] 10 "\n\n(fn IT)"] seq-filter lsp--lens-backend-not-loaded\?] 9 (#$ . 8230)]) #@176 Lenses backend using `textDocument/codeLens'. MODIFIED? - t when buffer is modified since the last invocation. CALLBACK - callback for the lenses. (fn MODIFIED\=\? CALLBACK) (defalias 'lsp-lens--backend #[514 "\302\303!\2058\203'\304\305\303\306\307\310 DD\311\312\"\313\314\315\316\317\320\321\322p!\323P& \207\324\325\"\2033\211 \"\207\326 #\207" [lsp-lens--backend-cache lsp--cur-version lsp--find-workspaces-for "textDocument/codeLens" nil lsp-request-async :textDocument :uri lsp--buffer-uri make-closure #[257 "\303\304\"\305\306 \"\203\300 \n\"\207\307 \300\n#\207" [V0 lsp-lens--backend-cache lsp--cur-version seq-mapcat #[257 "\211\211A\262\242\300\301\302\303#\"\210\207" [seq-do -rpartial lsp-put :_workspace] 9 "\n\n(fn INPUT0)"] -every\? lsp:code-lens-command\? lsp-lens--backend-fetch-missing] 5 "\n\n(fn LENSES)"] :error-handler ignore :mode tick :no-merge t :cancel-token buffer-name "-lenses" -all\? lsp--lens-backend-present\? lsp-lens--backend-fetch-missing] 15 (#$ . 9201)]) #@19 Enable lens mode. (defalias 'lsp-lens--enable #[0 "\205 \301\302!\205 \303\304!\207" [lsp-lens-enable lsp-feature\? "textDocument/codeLens" lsp-lens-mode 1] 2 (#$ . 10222)]) #@20 Disable lens mode. (defalias 'lsp-lens--disable #[0 "\300\301!\207" [lsp-lens-mode -1] 2 (#$ . 10405)]) #@31 Display lenses in the buffer. (defalias 'lsp-lens-show #[0 "\301\302\303\304\305\306\307\310!DD\"\"!\207" [buffer-file-name lsp-lens--display seq-map #[257 "\211\300\301\"\211\203 \207\302\303\"\207" [gethash "command" lsp-request "codeLens/resolve"] 6 "\n\n(fn INPUT0)"] lsp-request "textDocument/codeLens" :textDocument :uri lsp--path-to-uri] 9 (#$ . 10515) nil]) #@20 Delete all lenses. (defalias 'lsp-lens-hide #[0 "\302\303\304 \"\210\305\211)\207" [scroll-preserve-screen-position lsp-lens--overlays t seq-do delete-overlay nil] 3 (#$ . 10892) nil]) #@95 Non-nil if Lsp-Lens mode is enabled. Use the command `lsp-lens-mode' to change this variable. (defvar lsp-lens-mode nil (#$ . 11085)) (make-variable-buffer-local 'lsp-lens-mode) #@578 Toggle code-lens overlays. This is a minor mode. If called interactively, toggle the `Lsp-Lens 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-lens-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'lsp-lens-mode #[256 "\304 \305=\203 ?\202\247\203\306W\203\307\202\310\311\301!\2031\312\300 \"\2031\300 B\203f\313\314\315\307\310$\210\313\316\317\307\310$\210\313\320\321\307\310$\210\313\322\323\307\310$\210\313\324\325\307\310$\210\313\326\327\307\310$\210\330\310!\210\202\221\327 \210\331\314\315\310#\210\331\316\317\310#\210\331\320\321\310#\210\331\322\332\310#\210\331\324\333\310#\210\331\326\327\310#\210\307\211\334\335\203\233\336\202\234\337\"\210\340\341!\203\276\304 \203\260\211\304 \232\203\276\342\343\203\272\344\202\273\345\346#\210\210\347 \210\207" [lsp-lens-mode local-minor-modes lsp-lens--last-count lsp-lens--backend-cache current-message toggle 1 nil t boundp delq add-hook lsp-configure-hook lsp-lens--enable lsp-unconfigure-hook lsp-lens--disable lsp-on-idle-hook lsp-lens--idle-function lsp-on-change-hook #[0 "\300\301!\207" [lsp-lens--schedule-refresh t] 2] after-save-hook #[0 "\300\301!\207" [lsp-lens--schedule-refresh t] 2] before-revert-hook lsp-lens-hide lsp-lens--refresh remove-hook #[0 "\300\301!\207" [lsp-lens--schedule-refresh nil] 2] #[0 "\300\301!\207" [lsp-lens--schedule-refresh t] 2] run-hooks lsp-lens-mode-hook lsp-lens-mode-on-hook lsp-lens-mode-off-hook called-interactively-p any message "Lsp-Lens mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 8 (#$ . 11270) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar lsp-lens-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-lens-mode-map lsp-lens-mode-hook variable-documentation put "Hook run after entering or leaving `lsp-lens-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-lens-mode "Lens" boundp] 6) #@37 Click lsp lens using `avy' package. (defalias 'lsp-avy-lens #[0 "\204\303\304!\207\305\306\307\310\n\"\311\312#AA@\313!)\207" [lsp-lens-mode avy-action lsp-lens--overlays user-error "`lsp-lens-mode' not active" identity avy-process -mapcat #[257 "\300\301\302\"\303\304\"\"\207" [-map-indexed make-closure #[514 "\300\301\302\303#E\207" [V0 get-text-property 0 action] 8 "\n\n(fn INDEX LENS-TOKEN)"] overlay-get lsp--metadata] 6 "\n\n(fn OVERLAY)"] #[514 "\211A\262\242\211A\262\242@\300\301\302\"\303\304\305!@!\306\307#\310\311\"\312\313\"\314\"\315\316\"\317\320\"A\211\203g\211A\262\242\211\203^@\211\203T Q\202YP\262\202bP\262\202kP\262C\321\nT\"#\322\303\313\306\323#\"\324\325\"\203\211\211\202\214\211\325P\326 \311#\207" [nil mapcar avy--key-to-char propertize string last face avy-lead-face overlay-get before-string s-split "|" seq-elt append -take s-match "\\(^[[:space:]]+\\)\\(.*\\)" -drop s-join lsp-lens-face s-ends-with\? "\n" overlay-put] 21 "\n\n(fn INPUT0 INPUT1)"] #[0 "\301\302\"\207" [lsp-lens--overlays mapcar #[257 "\300\301\302\303\"#\207" [overlay-put before-string overlay-get lsp-original] 7 "\n\n(fn IT)"]] 3] funcall-interactively] 4 (#$ . 13833) nil]) (provide 'lsp-lens)