2015-06-15 09:06:10 +02:00
|
|
|
;;; module-csharp.el
|
|
|
|
|
|
|
|
(use-package csharp-mode
|
|
|
|
:mode "\\.cs$"
|
2016-03-29 23:13:31 -04:00
|
|
|
:init (add-hook 'csharp-mode-hook 'flycheck-mode))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
(use-package shader-mode :mode "\\.shader$") ; unity shaders
|
2015-10-08 01:48:47 -04:00
|
|
|
|
2015-06-15 09:06:10 +02:00
|
|
|
(use-package omnisharp
|
2016-03-29 23:13:31 -04:00
|
|
|
:commands (omnisharp-mode)
|
|
|
|
:preface
|
|
|
|
(setq omnisharp-auto-complete-want-documentation nil
|
|
|
|
omnisharp-server-executable-path (concat narf-ext-dir "/OmniSharp.exe"))
|
2016-03-27 00:46:52 -04:00
|
|
|
:when (file-exists-p omnisharp-server-executable-path)
|
2016-05-13 00:28:44 -04:00
|
|
|
:init (add-hook! csharp-mode '(turn-on-eldoc-mode omnisharp-mode))
|
2015-10-08 01:48:47 -04:00
|
|
|
:config
|
2016-05-01 01:10:30 -04:00
|
|
|
(def-company-backend! csharp-mode (omnisharp))
|
2015-11-30 05:31:20 -05:00
|
|
|
(map! :map omnisharp-mode-map
|
|
|
|
"gd" 'omnisharp-go-to-definition
|
2016-03-03 15:04:14 -05:00
|
|
|
(:localleader
|
2015-12-11 22:43:31 -05:00
|
|
|
"tr" (λ! (omnisharp-unit-test "fixture"))
|
|
|
|
"ts" (λ! (omnisharp-unit-test "single"))
|
|
|
|
"ta" (λ! (omnisharp-unit-test "all"))))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2015-10-28 17:27:56 -04:00
|
|
|
;; Map all refactor commands (see emr)
|
2015-10-01 13:49:36 -04:00
|
|
|
(mapc (lambda (x)
|
|
|
|
(let ((command-name (car x))
|
|
|
|
(title (cadr x)))
|
2016-03-29 23:13:31 -04:00
|
|
|
(emr-declare-command
|
|
|
|
(intern (format "omnisharp-%s" (symbol-name command-name)))
|
2015-10-01 13:49:36 -04:00
|
|
|
:title title :modes 'omnisharp-mode)))
|
|
|
|
'((find-usages "find usages")
|
|
|
|
(find-implementations "find implementations")
|
|
|
|
(fix-code-issue-at-point "fix code issue at point")
|
|
|
|
(fix-usings "fix usings")
|
|
|
|
(rename "rename")
|
|
|
|
(current-type-information "current type information")
|
|
|
|
(current-type-documentation "current type documentation")
|
|
|
|
(navigate-to-current-file-member "navigate to current file member")
|
|
|
|
(navigate-to-solution-member "navigate to solution member")
|
|
|
|
(navigate-to-solution-file-then-file-member "navigate to solution file then member")
|
|
|
|
(navigate-to-solution-file "navigate to solution file")
|
|
|
|
(navigate-to-region "navigate to region")
|
|
|
|
(show-last-auto-complete-result "last auto complete result")
|
|
|
|
(show-overloads-at-point "show overloads at point")
|
|
|
|
(recompile "recompile"))))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
|
|
|
(provide 'module-csharp)
|
|
|
|
;;; module-csharp.el ends here
|