2015-06-15 09:06:10 +02:00
|
|
|
;;; module-csharp.el
|
|
|
|
|
|
|
|
(use-package csharp-mode
|
|
|
|
:functions (csharp-log)
|
|
|
|
:mode "\\.cs$"
|
2015-10-28 03:31:51 -04:00
|
|
|
:init (add-hook! csharp-mode 'flycheck-mode)
|
|
|
|
:config (require 'omnisharp))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2015-10-08 01:48:47 -04:00
|
|
|
;; unity shaders
|
2015-10-12 04:31:55 -04:00
|
|
|
(use-package shader-mode :mode "\\.shader$")
|
2015-10-08 01:48:47 -04:00
|
|
|
|
2015-06-15 09:06:10 +02:00
|
|
|
(use-package omnisharp
|
2015-10-28 17:27:56 -04:00
|
|
|
:defer t
|
2015-10-08 01:48:47 -04:00
|
|
|
:preface
|
|
|
|
(setq omnisharp-server-executable-path "~/Dropbox/lib/omnisharp-server/OmniSharp/bin/Debug/OmniSharp.exe"
|
2015-07-18 12:13:54 +02:00
|
|
|
omnisharp-auto-complete-want-documentation nil)
|
2015-10-08 01:48:47 -04:00
|
|
|
:if (file-exists-p omnisharp-server-executable-path)
|
|
|
|
:init
|
|
|
|
(add-hook! csharp-mode '(emr-initialize omnisharp-mode))
|
|
|
|
:config
|
2015-11-30 05:31:20 -05:00
|
|
|
(map! :map omnisharp-mode-map
|
|
|
|
"gd" 'omnisharp-go-to-definition
|
|
|
|
(:prefix "\\"
|
|
|
|
"tr" (λ (omnisharp-unit-test "fixture"))
|
|
|
|
"ts" (λ (omnisharp-unit-test "single"))
|
|
|
|
"ta" (λ (omnisharp-unit-test "all"))))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
|
|
|
(after! company
|
2015-10-14 03:39:32 -04:00
|
|
|
(define-company-backend! csharp-mode (omnisharp))
|
2015-10-01 13:49:36 -04:00
|
|
|
(add-hook! csharp-mode 'turn-on-eldoc-mode))
|
|
|
|
|
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)))
|
|
|
|
(emr-declare-command (intern (format "omnisharp-%s" (symbol-name command-name)))
|
|
|
|
: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
|