Skip to content

Commit b96102c

Browse files
authored
Revert #4848
1 parent 226df20 commit b96102c

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

lsp-mode.el

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6111,28 +6111,12 @@ It will show up only if current point has signature help."
61116111

61126112
(defun lsp--text-document-code-action-params (&optional kind)
61136113
"Code action params."
6114-
(let* ((diags (lsp-cur-possition-diagnostics))
6115-
(range (cond ((use-region-p)
6116-
(lsp--region-to-range (region-beginning) (region-end)))
6117-
(diags
6118-
(let* ((start (point))
6119-
(end (point)))
6120-
(seq-doseq (diag diags)
6121-
(when-let* ((diag-range (gethash "range" diag))
6122-
(diag-start (gethash "start" diag-range))
6123-
(l1 (gethash "line" diag-start))
6124-
(c1 (gethash "character" diag-start))
6125-
(diag-end (gethash "end" diag-range))
6126-
(l2 (gethash "line" diag-end))
6127-
(c2 (gethash "character" diag-end)))
6128-
(setq start (min (lsp--line-character-to-point l1 c1) start))
6129-
(setq end (max (lsp--line-character-to-point l2 c2) end))))
6130-
(lsp--region-to-range start end)))
6131-
(t (lsp--region-to-range (point) (point))))))
6132-
(list :textDocument (lsp--text-document-identifier)
6133-
:range range
6134-
:context `( :diagnostics ,diags
6135-
,@(when kind (list :only (vector kind)))))))
6114+
(list :textDocument (lsp--text-document-identifier)
6115+
:range (if (use-region-p)
6116+
(lsp--region-to-range (region-beginning) (region-end))
6117+
(lsp--region-to-range (point) (point)))
6118+
:context `( :diagnostics ,(lsp-cur-possition-diagnostics)
6119+
,@(when kind (list :only (vector kind))))))
61366120

61376121
(defun lsp-code-actions-at-point (&optional kind)
61386122
"Retrieve the code actions for the active region or the current line.

0 commit comments

Comments
 (0)