Skip to content

Commit 515e597

Browse files
authored
Merge pull request #30 from nbfalcon/feature/lsp-ivy-workspace-folder-remove
Add a command to remove workspace folders
2 parents c70ee8b + d046322 commit 515e597

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lsp-ivy.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,18 @@ When called with prefix ARG the default selection will be symbol at point."
220220
"Global workspace symbols: "
221221
(when arg (thing-at-point 'symbol))))
222222

223+
224+
225+
;;;###autoload
226+
(defun lsp-ivy-workspace-folders-remove ()
227+
"Remove a project-root from the list of workspace folders."
228+
(interactive)
229+
(let ((session (lsp-session)))
230+
(ivy-read "Select workspace folder to remove: " (lsp-session-folders session)
231+
:preselect (-some->> default-directory (lsp-find-session-folder session))
232+
:action (lambda (folder)
233+
(lsp-workspace-folders-remove folder)
234+
(ivy--kill-current-candidate)))))
235+
223236
(provide 'lsp-ivy)
224237
;;; lsp-ivy.el ends here

0 commit comments

Comments
 (0)