Replace ‘omnisharp’ with ‘lsp’ for C# development
This commit is contained in:
parent
dc25705048
commit
cf27d78d15
1 changed files with 9 additions and 19 deletions
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2020.0407.114436
|
;; Version: 2020.0714.095918
|
||||||
;; Package-Requires: (csharp-mode omnisharp oni-company oni-flycheck oni-yasnippet oni-hydra oni-fci smartparens)
|
;; Package-Requires: (csharp-mode oni-company oni-flycheck oni-yasnippet oni-hydra oni-fci oni-lsp smartparens)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
;; it under the terms of the GNU General Public License as published by
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
@ -50,18 +50,14 @@
|
||||||
|
|
||||||
(defhydra oni-csharp-hydra (:color teal :hint nil)
|
(defhydra oni-csharp-hydra (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
^Compile^ ^Refactor^ ^Maintenance^
|
^Compile^
|
||||||
^^^^^^------------------------------------
|
^^------------
|
||||||
_cp_: Project _rr_: Rename _ms_: Start Omnisharp
|
_cp_: Project
|
||||||
_cs_: Solution ^^ _mr_: Reload Solution
|
_cs_: Solution
|
||||||
^^ ^^ _mS_: Stop Omnisharp
|
^^
|
||||||
"
|
"
|
||||||
("cp" oni-csharp-compile-project)
|
("cp" oni-csharp-compile-project)
|
||||||
("cs" oni-csharp-compile-solution)
|
("cs" oni-csharp-compile-solution))
|
||||||
("rr" omnisharp-rename)
|
|
||||||
("ms" omnisharp-start-omnisharp-server)
|
|
||||||
("mr" omnisharp-reload-solution)
|
|
||||||
("mS" omnisharp-stop-server))
|
|
||||||
|
|
||||||
(defun oni-csharp-compile-solution ()
|
(defun oni-csharp-compile-solution ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -146,22 +142,16 @@ _cs_: Solution ^^ _mr_: Reload Solution
|
||||||
"Set style rules according to personal (or recommended) preference."
|
"Set style rules according to personal (or recommended) preference."
|
||||||
(setf (alist-get 'arglist-intro c-offsets-alist) '+))
|
(setf (alist-get 'arglist-intro c-offsets-alist) '+))
|
||||||
|
|
||||||
(with-eval-after-load 'company
|
|
||||||
(add-to-list 'company-backends
|
|
||||||
'(company-omnisharp :with company-yasnippet)))
|
|
||||||
|
|
||||||
(add-hook 'csharp-mode-hook 'company-mode)
|
(add-hook 'csharp-mode-hook 'company-mode)
|
||||||
(add-hook 'csharp-mode-hook 'electric-indent-local-mode)
|
(add-hook 'csharp-mode-hook 'electric-indent-local-mode)
|
||||||
(add-hook 'csharp-mode-hook 'fci-mode)
|
(add-hook 'csharp-mode-hook 'fci-mode)
|
||||||
(add-hook 'csharp-mode-hook 'flycheck-mode)
|
(add-hook 'csharp-mode-hook 'flycheck-mode)
|
||||||
(add-hook 'csharp-mode-hook 'omnisharp-mode)
|
(add-hook 'csharp-mode-hook 'lsp)
|
||||||
(add-hook 'csharp-mode-hook 'oni-csharp--auto-fill-mode)
|
(add-hook 'csharp-mode-hook 'oni-csharp--auto-fill-mode)
|
||||||
(add-hook 'csharp-mode-hook 'oni-csharp--update-style)
|
(add-hook 'csharp-mode-hook 'oni-csharp--update-style)
|
||||||
(add-hook 'csharp-mode-hook 'rainbow-delimiters-mode)
|
(add-hook 'csharp-mode-hook 'rainbow-delimiters-mode)
|
||||||
(add-hook 'csharp-mode-hook 'smartparens-mode)
|
(add-hook 'csharp-mode-hook 'smartparens-mode)
|
||||||
|
|
||||||
(define-key csharp-mode-map (kbd "M-.") 'omnisharp-go-to-definition)
|
|
||||||
(define-key csharp-mode-map (kbd "M-?") 'omnisharp-find-usages)
|
|
||||||
(define-key csharp-mode-map (kbd "C-c SPC") 'oni-csharp-hydra/body)
|
(define-key csharp-mode-map (kbd "C-c SPC") 'oni-csharp-hydra/body)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
Loading…
Reference in a new issue