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 @@ -125,13 +125,26 @@ Execute CALLBACK to display candidates in sideline."
125125 (doc-id (lsp--text-document-identifier)))
126126 (lsp-request-async
127127 " textDocument/codeAction"
128- (-let (((start . end) (if (eq sideline-lsp-update-mode 'line )
129- (cons 0 (- eol bol))
130- (--> (- (point ) bol) (cons it it)))))
128+ (-let* ((diagnostics (sideline-lsp--line-diags (1- line-widen)))
129+ ((start . end) (cond ((eq sideline-lsp-update-mode 'line )
130+ (cons 0 (- eol bol)))
131+ (diagnostics
132+ (let* ((start (- (point ) bol))
133+ (end start))
134+ (mapc
135+ (-lambda
136+ ((&Diagnostic
137+ :range (&Range :start (&Position :character c1)
138+ :end (&Position :character c2))))
139+ (setq start (min c1 start))
140+ (setq end (max c2 end)))
141+ diagnostics)
142+ (cons start end)))
143+ (t (--> (- (point ) bol) (cons it it))))))
131144 (list :textDocument doc-id
132145 :range (list :start (list :line (1- line-widen) :character start)
133146 :end (list :line (1- line-widen) :character end))
134- :context (list :diagnostics (sideline-lsp--line-diags ( 1- line-widen)) )))
147+ :context (list :diagnostics diagnostics )))
135148 (lambda (actions )
136149 (when (eq (current-buffer ) buffer)
137150 (sideline-lsp--code-actions callback actions)))
You can’t perform that action at this time.
0 commit comments