File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -619,13 +619,26 @@ from the language server."
619
619
(lsp--registered-capability " textDocument/codeAction" )))
620
620
(lsp-request-async
621
621
" textDocument/codeAction"
622
- (-let (((start . end) (if (eq lsp-ui-sideline-update-mode 'line )
623
- (cons 0 (- eol bol))
624
- (--> (- (point ) bol) (cons it it)))))
622
+ (-let* ((diagnostics (lsp-ui-sideline--line-diags (1- line-widen)))
623
+ ((start . end) (cond ((eq lsp-ui-sideline-update-mode 'line )
624
+ (cons 0 (- eol bol)))
625
+ (diagnostics
626
+ (let* ((start (- (point ) bol))
627
+ (end start))
628
+ (mapc
629
+ (-lambda
630
+ ((&Diagnostic
631
+ :range (&Range :start (&Position :character c1)
632
+ :end (&Position :character c2))))
633
+ (setq start (min c1 start))
634
+ (setq end (max c2 end)))
635
+ diagnostics)
636
+ (cons start end)))
637
+ (t (--> (- (point ) bol) (cons it it))))))
625
638
(list :textDocument doc-id
626
639
:range (list :start (list :line (1- line-widen) :character start)
627
640
:end (list :line (1- line-widen) :character end))
628
- :context (list :diagnostics (lsp-ui-sideline--line-diags ( 1- line-widen)) )))
641
+ :context (list :diagnostics diagnostics )))
629
642
(lambda (actions )
630
643
(when (eq (current-buffer ) buffer)
631
644
(lsp-ui-sideline--code-actions actions bol eol)))
You can’t perform that action at this time.
0 commit comments