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."
619619                     (lsp--registered-capability " textDocument/codeAction"  )))
620620        (lsp-request-async
621621         " 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))))))
625638           (list  :textDocument  doc-id
626639                 :range  (list  :start  (list  :line  (1-  line-widen) :character  start)
627640                              :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 )))
629642         (lambda  (actions )
630643           (when  (eq  (current-buffer ) buffer)
631644             (lsp-ui-sideline--code-actions actions bol eol)))
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments