Troll coworkers - use Emacs at work for csharp!
Emacs Lisp Shell Gherkin C#
Latest commit 5619172 Aug 19, 2017 @razzmatazz razzmatazz committed on GitHub Merge pull request #356 from juergenhoetzel/remove-needless-macro
Remove needless macro omnisharp--setq-and-restore
Permalink
Failed to load latest commit information.
doc README.md: split off fallback server installation docs Jul 21, 2017
features-tbd-on-the-server-side Fix tbd integration tests running anyway Jul 4, 2015
ignored-from-melpa-build Add a way to start developing nicely May 3, 2016
test-stuff fix test file paths Jul 22, 2017
test Implementation for go-to-definition for types in metadata. Aug 4, 2017
travis-stuff Update server version to 1.22.0 Aug 4, 2017
.gitignore Implementation for go-to-definition for types in metadata. Aug 4, 2017
.travis.yml Probably building image every time is faster than uploading/downloadi… Jul 22, 2017
Cask update integration tests to v1.19.0 and fix broken tests with newer s… Jul 2, 2017
Dockerfile.testing fix test file paths Jul 22, 2017
LICENSE add LICENSE and insert GPLv3 license headers to most of the files Aug 3, 2017
README.md README.md: add example setup code for csharp-mode-hook Aug 13, 2017
docker-compose.yml Pass travis related environment variables to container Jul 22, 2017
omnisharp-auto-complete-actions.el Remove needless macro omnisharp--setq-and-restore Aug 17, 2017
omnisharp-current-symbol-actions.el add LICENSE and insert GPLv3 license headers to most of the files Aug 3, 2017
omnisharp-format-actions.el add LICENSE and insert GPLv3 license headers to most of the files Aug 3, 2017
omnisharp-helm-integration.el omnisharp-helm-find-symbols: tune the helm candidate output slightly Aug 14, 2017
omnisharp-http-utils.el add LICENSE and insert GPLv3 license headers to most of the files Aug 3, 2017
omnisharp-navigation-actions.el Implementation for go-to-definition for types in metadata. Aug 4, 2017
omnisharp-server-actions.el Remove needless macro omnisharp--setq-and-restore Aug 17, 2017
omnisharp-server-installation.el omnisharp-settings.el: move all remaining defcustom's to this file Aug 13, 2017
omnisharp-server-management.el add LICENSE and insert GPLv3 license headers to most of the files Aug 3, 2017
omnisharp-settings.el omnisharp-settings.el: move all remaining defcustom's to this file Aug 13, 2017
omnisharp-solution-actions.el add LICENSE and insert GPLv3 license headers to most of the files Aug 3, 2017
omnisharp-utils.el Remove needless macro omnisharp--setq-and-restore Aug 17, 2017
omnisharp.el omnisharp.el: update version to 4.1 Aug 13, 2017
run-tests.sh Make Docker as a default way to run tests at any environment, includi… Jul 21, 2017
start-emacs-in-this-project.sh Add helper script for starting emacs in the project environment Oct 18, 2014

README.md

omnisharp-emacs

omnisharp-emacs is a port of the awesome omnisharp-roslyn server to the Emacs text editor. It provides IDE-like features for editing files in C# solutions in Emacs, provided by an OmniSharp server instance that works in the background.

This package is licensed under GNU General Public License version 3, or (at your option) any later version.

See omnisharp-emacs Features.

Package Installation

This package requires Emacs 24.3 and above. It has been tested on Ubuntu, Windows 7+ and on macOS.

Installation on Spacemacs

Add csharp layer to dotspacemacs-configuration-layers on your .spacemacs file. csharp-mode and omnisharp packages will get installed automatically for you on restart.

Installation on Regular Emacs

To install, use MELPA. After MELPA is configured correctly, use

M-x package-refresh-contents RET
M-x package-install omnisharp RET

to install.

When installing the omnisharp package package.el will also automatically pull in csharp-mode for you as well.

To automatically load omnisharp-emacs when editing csharp files, add something like this to csharp-mode-hook on your init.el:

(add-hook 'csharp-mode-hook 'omnisharp-mode)

For autocompletion via company mode you will also need this in your init.el:

(eval-after-load
 'company
 '(add-to-list 'company-backends 'company-omnisharp))

Configuration

To start using omnisharp-emacs, start the server with M-x omnisharp-start-omnisharp-server RET. The command will prompt you for a project or solution file you want to work with.

You will probably want to create a custom configuration for omnisharp-emacs in your normal coding sessions. Usually all this customization goes in your custom csharp-mode-hook.

Here is a sample configuration script (that goes into your ~/.emacs.d/init.el or in your dotspacemacs/user-config() in ~/.spacemacs):

  (defun my-csharp-mode-setup ()
    (setq indent-tabs-mode nil)
    (setq c-syntactic-indentation t)
    (c-set-style "ellemtel")
    (setq c-basic-offset 4)
    (setq truncate-lines t)
    (setq tab-width 4)
    (setq evil-shift-width 4)
    (local-set-key (kbd "C-c C-c") 'recompile))

  (add-hook 'csharp-mode-hook 'my-csharp-mode-setup t)

There is also an example configuration for evil-mode included in the project, please see doc/example-config-for-evil-mode.el.

Server Installation

This emacs package requires the omnisharp-roslyn server program. Emacs will manage connection to the server as a subprocess.

The easiest/default way to install the server is to invoke M-x omnisharp-install-server and follow instructions on minibufer.

If that fails (or you feel adventurous) please see installing omnisharp server on how to install the server manually.

Contributing

How to run tests

You can run all kind of tests by following shell script.

./run-tests.sh

Pull requests welcome!