2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/csharp/config.el -*- lexical-binding: t; -*-
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2017-05-25 20:11:24 +02:00
|
|
|
(def-package! csharp-mode :mode "\\.cs$")
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2015-10-08 01:48:47 -04:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! omnisharp
|
2017-05-25 20:11:24 +02:00
|
|
|
:after csharp-mode
|
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 04:49:05 -05:00
|
|
|
(add-hook! csharp-mode #'(eldoc-mode flycheck-mode omnisharp-mode))
|
|
|
|
|
|
|
|
(unless (file-exists-p (omnisharp--server-installation-path t))
|
2017-05-25 20:11:24 +02:00
|
|
|
(warn "csharp-mode: omnisharp server isn't installed, completion won't work"))
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(set! :company-backend 'csharp-mode '(company-omnisharp))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2018-01-19 04:17:19 -05:00
|
|
|
(set! :lookup 'csharp-mode
|
|
|
|
: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
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! shader-mode :mode "\\.shader$") ; unity shaders
|
2017-02-19 18:57:16 -05:00
|
|
|
|