lang/csharp: minor refactor
Ensure csharp-mode specific config can work without omnisharp.
This commit is contained in:
parent
cee851f55b
commit
e01781a3d9
1 changed files with 12 additions and 8 deletions
|
@ -1,5 +1,17 @@
|
|||
;;; lang/csharp/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! csharp-mode
|
||||
(add-hook 'csharp-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(set-electric! 'csharp-mode :chars '(?\n ?\}))
|
||||
(set-rotate-patterns! 'csharp-mode
|
||||
:symbols '(("public" "protected" "private")
|
||||
("class" "struct")))
|
||||
(sp-local-pair 'csharp-mode "<" ">"
|
||||
:when '(+csharp-sp-point-in-type-p)
|
||||
:post-handlers '(("| " "SPC"))))
|
||||
|
||||
|
||||
(def-package! omnisharp
|
||||
:hook (csharp-mode . omnisharp-mode)
|
||||
:commands omnisharp-install-server
|
||||
|
@ -14,20 +26,12 @@
|
|||
(add-hook! csharp-mode
|
||||
(add-hook 'kill-buffer-hook #'omnisharp-stop-server nil t))
|
||||
|
||||
(set-electric! 'csharp-mode :chars '(?\n ?\}))
|
||||
(set-company-backend! 'csharp-mode 'company-omnisharp)
|
||||
(set-rotate-patterns! 'csharp-mode
|
||||
:symbols '(("public" "protected" "private")
|
||||
("class" "struct")))
|
||||
(set-lookup-handlers! 'csharp-mode
|
||||
:definition #'omnisharp-go-to-definition
|
||||
:references #'omnisharp-find-usages
|
||||
:documentation #'omnisharp-current-type-documentation)
|
||||
|
||||
(sp-local-pair 'csharp-mode "<" ">"
|
||||
:when '(+csharp-sp-point-in-type-p)
|
||||
:post-handlers '(("| " "SPC")))
|
||||
|
||||
(map! :localleader
|
||||
:map omnisharp-mode-map
|
||||
"b" #'omnisharp-recompile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue