Override lsp-mode code action autoselect
This commit is contained in:
		
							parent
							
								
									7821b7b605
								
							
						
					
					
						commit
						a254cc2951
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		
							
								
								
									
										16
									
								
								init.el
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								init.el
									
										
									
									
									
								
							| 
						 | 
					@ -348,3 +348,19 @@
 | 
				
			||||||
            (lambda (&optional count file) (hyprctl "hy3:movefocus" "u")))
 | 
					            (lambda (&optional count file) (hyprctl "hy3:movefocus" "u")))
 | 
				
			||||||
(advice-add #'evil-window-down :override
 | 
					(advice-add #'evil-window-down :override
 | 
				
			||||||
            (lambda (&optional count file) (hyprctl "hy3:movefocus" "d")))
 | 
					            (lambda (&optional count file) (hyprctl "hy3:movefocus" "d")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;;; Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;; stop lsp-mode from yoloing code actions when only one is present
 | 
				
			||||||
 | 
					(defun lsp--select-action (actions)
 | 
				
			||||||
 | 
					  "Select an action to execute from ACTIONS."
 | 
				
			||||||
 | 
					  (cond
 | 
				
			||||||
 | 
					   ((seq-empty-p actions) (signal 'lsp-no-code-actions nil))
 | 
				
			||||||
 | 
					   ;;((and (eq (seq-length actions) 1) lsp-auto-execute-action)
 | 
				
			||||||
 | 
					    ;;(lsp-seq-first actions))
 | 
				
			||||||
 | 
					   (t (let ((completion-ignore-case t))
 | 
				
			||||||
 | 
					        (lsp--completing-read "Select code action: "
 | 
				
			||||||
 | 
					                              (seq-into actions 'list)
 | 
				
			||||||
 | 
					                              (-compose (lsp--create-unique-string-fn)
 | 
				
			||||||
 | 
					                                        #'lsp:code-action-title)
 | 
				
			||||||
 | 
					                              nil t)))))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue