2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/csharp/config.el -*- lexical-binding: t; -*-
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2018-09-07 22:08:11 -04:00
|
|
|
;; `shader-mode' --- unity shaders
|
2018-06-23 16:48:58 +02:00
|
|
|
(add-to-list 'auto-mode-alist '("\\.shader$" . shader-mode))
|
2018-02-14 07:42:22 -05:00
|
|
|
|
2015-10-08 01:48:47 -04:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! omnisharp
|
2018-05-25 00:46:11 +02:00
|
|
|
:hook (csharp-mode . omnisharp-mode)
|
|
|
|
:commands omnisharp-install-server
|
2016-03-29 23:13:31 -04:00
|
|
|
:preface
|
|
|
|
(setq omnisharp-auto-complete-want-documentation nil
|
2018-02-04 04:49:05 -05:00
|
|
|
omnisharp-cache-directory (concat doom-cache-dir "omnisharp"))
|
2015-10-08 01:48:47 -04:00
|
|
|
:config
|
2018-02-04 05:32:43 -05:00
|
|
|
(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)))
|
2018-09-07 22:08:11 -04:00
|
|
|
(add-hook! csharp-mode
|
|
|
|
(add-hook 'kill-buffer-hook #'omnisharp-stop-server nil t))
|
2018-02-04 05:32:43 -05:00
|
|
|
|
2018-09-07 22:08:11 -04:00
|
|
|
(set-company-backend! 'csharp-mode 'company-omnisharp)
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2018-06-15 17:27:48 +02:00
|
|
|
(set-lookup-handlers! 'csharp-mode
|
2018-01-19 04:17:19 -05:00
|
|
|
:definition #'omnisharp-go-to-definition
|
|
|
|
:references #'omnisharp-find-usages
|
|
|
|
:documentation #'omnisharp-current-type-documentation)
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(map! :map omnisharp-mode-map
|
2018-01-19 04:17:19 -05:00
|
|
|
:localleader
|
|
|
|
:n "b" #'omnisharp-recompile
|
|
|
|
|
|
|
|
(:prefix "r"
|
|
|
|
:n "i" #'omnisharp-fix-code-issue-at-point
|
|
|
|
:n "u" #'omnisharp-fix-usings
|
|
|
|
:n "r" #'omnisharp-rename
|
|
|
|
:n "a" #'omnisharp-show-last-auto-complete-result
|
|
|
|
:n "o" #'omnisharp-show-overloads-at-point)
|
|
|
|
|
|
|
|
(:prefix "f"
|
|
|
|
:n "u" #'omnisharp-find-usages
|
|
|
|
:n "i" #'omnisharp-find-implementations
|
|
|
|
:n "f" #'omnisharp-navigate-to-current-file-member
|
|
|
|
:n "m" #'omnisharp-navigate-to-solution-member
|
|
|
|
:n "M" #'omnisharp-navigate-to-solution-file-then-file-member
|
|
|
|
:n "F" #'omnisharp-navigate-to-solution-file
|
|
|
|
:n "r" #'omnisharp-navigate-to-region
|
|
|
|
:n "ti" #'omnisharp-current-type-information
|
|
|
|
:n "td" #'omnisharp-current-type-documentation)
|
|
|
|
|
|
|
|
(:prefix "t"
|
|
|
|
:n "r" (λ! (omnisharp-unit-test "fixture"))
|
|
|
|
:n "s" (λ! (omnisharp-unit-test "single"))
|
|
|
|
:n "a" (λ! (omnisharp-unit-test "all")))))
|
2017-02-19 18:57:16 -05:00
|
|
|
|