lang/csharp: clean up omnisharp server when killing last csharp-mode buffer
This commit is contained in:
parent
64d0e28f80
commit
fb5fbf69dc
1 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,12 @@
|
|||
(unless (file-exists-p (omnisharp--server-installation-path t))
|
||||
(warn "csharp-mode: omnisharp server isn't installed, completion won't work"))
|
||||
|
||||
(defun +csharp|cleanup-omnisharp-server ()
|
||||
"Clean up the omnisharp server once you kill the last csharp-mode buffer."
|
||||
(unless (doom-buffers-in-mode 'csharp-mode (buffer-list))
|
||||
(omnisharp-stop-server)))
|
||||
(add-hook! csharp-mode (add-hook 'kill-buffer-hook #'omnisharp-stop-server nil t))
|
||||
|
||||
(set! :company-backend 'csharp-mode '(company-omnisharp))
|
||||
|
||||
(set! :lookup 'csharp-mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue