File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,13 @@ CALLBACK - callback for the lenses."
309
309
(funcall callback lsp-lens--backend-cache lsp--cur-version)
310
310
(lsp-lens--backend-fetch-missing lsp-lens--backend-cache callback lsp--cur-version)))))
311
311
312
+ (defun lsp--lens-on-refresh (workspace )
313
+ " Clear lens within all buffers of WORKSPACE, refreshing all workspace buffers."
314
+ (cl-assert (not (eq nil workspace)))
315
+ (cl-loop
316
+ for ws-buffer in (lsp--workspace-buffers workspace) do
317
+ (lsp-lens-refresh t ws-buffer)))
318
+
312
319
;;;### autoload
313
320
(defun lsp-lens--enable ()
314
321
" Enable lens mode."
Original file line number Diff line number Diff line change @@ -3347,7 +3347,7 @@ disappearing, unset all the variables related to it."
3347
3347
(workspaceFolders . t)
3348
3348
(configuration . t)
3349
3349
,@(when lsp-semantic-tokens-enable '((semanticTokens . ((refreshSupport . t)))))
3350
- ,@(when lsp-lens-enable '((codeLens . ((refreshSupport . :json-false )))))
3350
+ ,@(when lsp-lens-enable '((codeLens . ((refreshSupport . t )))))
3351
3351
(fileOperations . ((didCreate . :json-false)
3352
3352
(willCreate . :json-false)
3353
3353
(didRename . :json-false)
@@ -6181,6 +6181,11 @@ WORKSPACE is the active workspace."
6181
6181
(fboundp 'lsp--semantic-tokens-on-refresh))
6182
6182
(lsp--semantic-tokens-on-refresh workspace))
6183
6183
nil)
6184
+ ((equal method "workspace/codeLens/refresh")
6185
+ (when (and lsp-lens-enable
6186
+ (fboundp 'lsp--lens-on-refresh))
6187
+ (lsp--lens-on-refresh workspace))
6188
+ nil)
6184
6189
(t (lsp-warn "Unknown request method: %s" method) nil))))
6185
6190
;; Send response to the server.
6186
6191
(unless (eq response 'delay-response)
You can’t perform that action at this time.
0 commit comments