Added support for C# using OmniSharp #500

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@bjarkevad
Contributor

Added initial support for C#, comments et al is of course very welcome.
OmniSharp seems to work reasonably well for the tests I've done on Linux with Mono, but someone should probably try it out with some larger solutions on other system configs.

@syl20bnr syl20bnr commented on an outdated diff Jan 29, 2015
contrib/lang/csharp/packages.el
+ "mtt" 'omnisharp-unit-test-single
+
+ ;; Navigation
+ "mgg" 'omnisharp-go-to-definition
+ "mgG" 'omnisharp-go-to-definition-other-window
+ "mgu" 'omnisharp-helm-find-usages
+ "mgs" 'omnisharp-helm-find-symbols
+ "mgi" 'omnisharp-find-implementations
+ "mgr" 'omnisharp-navigate-to-region
+ "mgm" 'omnisharp-navigate-to-solution-member
+ "mgM" 'omnisharp-navigate-to-solution-member-other-window
+ "mgf" 'omnisharp-navigate-to-solution-file
+ "mgF" 'omnisharp-navigate-to-solution-file-then-file-member
+
+ ;; Type info
+ "mt" 'omnisharp-current-type-information
@syl20bnr
syl20bnr Jan 29, 2015 Owner

you have a clash here with the test prefix mt

@syl20bnr syl20bnr commented on the diff Jan 29, 2015
contrib/lang/csharp/packages.el
+;; This file is not part of GNU Emacs.
+;;
+;;; License: GPLv3
+
+(defvar csharp-packages
+ '(omnisharp))
+
+(defvar csharp-excluded-packages '()
+ "List of packages to exclude.")
+
+(defun csharp/init-omnisharp ()
+ ;; Load omnisharp-mode with csharp-mode, this should start the omnisharp server automatically
+ (add-hook 'csharp-mode-hook 'omnisharp-mode)
+ (use-package omnisharp
+ :defer t
+ :config (evil-leader/set-key-for-mode 'csharp-mode
@syl20bnr
syl20bnr Jan 29, 2015 Owner

Sort the key bindings

@bjarkevad
bjarkevad Jan 29, 2015 Contributor

How do you want the sorting to be?

@syl20bnr syl20bnr commented on an outdated diff Jan 29, 2015
contrib/lang/csharp/packages.el
+ "mt" 'omnisharp-current-type-information
+ "mT" 'omnisharp-current-type-information-to-kill-ring
+
+ ;; Refactoring
+ "mrm" 'omnisharp-rename
+ "mrr" 'omnisharp-run-code-action-refactoring
+
+ ;; Solution/project manipulation
+ "mpa" 'omnisharp-add-to-solution-current-file
+ "mpA" 'omnisharp-add-to-solution-dired-selected-files
+ "mpr" 'omnisharp-remove-from-project-current-file
+ "mpR" 'omnisharp-remove-from-project-dired-selected-files
+ "mpl" 'omnisharp-add-reference
+
+ ;; Compile
+ "mb" 'omnisharp-build-in-emacs ;; Only one compile command so use top-level
@syl20bnr
syl20bnr Jan 29, 2015 Owner

should be mcc if I'm not mistaken

@syl20bnr syl20bnr commented on an outdated diff Jan 29, 2015
contrib/lang/csharp/packages.el
+ ;; Refactoring
+ "mrm" 'omnisharp-rename
+ "mrr" 'omnisharp-run-code-action-refactoring
+
+ ;; Solution/project manipulation
+ "mpa" 'omnisharp-add-to-solution-current-file
+ "mpA" 'omnisharp-add-to-solution-dired-selected-files
+ "mpr" 'omnisharp-remove-from-project-current-file
+ "mpR" 'omnisharp-remove-from-project-dired-selected-files
+ "mpl" 'omnisharp-add-reference
+
+ ;; Compile
+ "mb" 'omnisharp-build-in-emacs ;; Only one compile command so use top-level
+
+ ;; Code manipulation
+ "mo" 'omnisharp-auto-complete-overrides
@syl20bnr
syl20bnr Jan 29, 2015 Owner

not in the conventions but we can keep mo for the user as well as o

@bjarkevad
Contributor

I've updated the bindings, but I'm still not really satisfied with the mnemonics - suggestions?

@bjarkevad
Contributor

Updated bindings again :)

@syl20bnr
Owner

Very nice layer ! ❤️
Thank you !

Cherry-picked into develop you can safely delete your branch.

I made some modifications/improvements:

@syl20bnr syl20bnr closed this Jan 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment