This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/csharp
2019-05-15 21:08:21 +03:00
..
img csharp: update layer documentation to be more up to date with the roslyn version 2017-08-27 21:39:43 -04:00
config.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
packages.el [csharp] Change execute test key bindings to conventional ones 2019-05-12 10:09:10 -04:00
README.org Switch to the new layers generator 2019-05-15 21:08:21 +03:00

C# layer

/TakeV/spacemacs/media/commit/02bf928815002b9fc11f9cd945ff511b5b4829e9/layers/+lang/csharp/img/csharp.png

Description

This layer adds support for C# language using the omnisharp-roslyn language server and corresponding omnisharp-emacs package.

Please report any issues encountered to omnisharp-emacs issue page on github. PRs are welcome too!

Features:

  • Syntax checking with flycheck (when syntax-checking layer is used)
  • Support for auto-completion (when auto-completion layer is used)
  • Refactoring
  • Navigation to cross-references
  • Inspecting types in metadata

Packages Included

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add csharp to the existing dotspacemacs-configuration-layers list in this file.

Before you can work with C# files you will need to install the server by invoking SPC m s i (or M-x omnisharp-install-server). Otherwise, if this fails for you, please see omnisharp-emacs/doc/server-installation.md.

While the server will start automatically where possible if the server needs to be started manually use SPC m s s (or M-x omnisharp-start-omnisharp-server). It will prompt a path to your .cpsroj or .sln file.

Caveats

  • You should use dotnet CLI tool from .NET Core download page or an IDE like Visual Studio or Xamarin Studio to manage solution and project files.
  • Debugging on command line is possible using SDB.
  • There can be only one server running at the same time. To switch to a different solution/project you need to invoke SPC m s S and SPC m s s to stop current server and start another one pointing to another solution/project.

Key bindings

Navigation

Key binding Description
SPC m g c Go to member in current file
SPC m g e List errors and warnings in solution
SPC m g f Go to solution file
SPC m g F Go to solution file then member
SPC m g g Go to definition
SPC m g G Go to definition in other window
SPC m g i Find implementations
SPC m g I Find implementations using ido
SPC m g m Go to solution member
SPC m g M Go to solution member in other window
SPC m g r Go to region
SPC m g s Find symbols using Helm
SPC m g u Find usages of symbol under cursor using Helm
SPC m g U Find usages of symbol under cursor using ido

Helpers (documentation, info)

Key binding Description
SPC m h t Get type information for symbol under cursor
SPC m h T Get type information for symbol under cursor and put it into kill-ring

Refactoring

Key binding Description
SPC m r m Rename symbol under cursor
SPC m r M Rename symbol under cursor interactively
SPC m r r Refactor under cursor

OmniSharp server interaction

Key binding Description
SPC m s i Install OmniSharp server
SPC m s r Reload the solution
SPC m s s Start the OmniSharp server
SPC m s S Stop the OmniSharp server

Tests

Key binding Description
SPC m t b Run tests in current buffer
SPC m t t Run the last executed test again
SPC m t t Run the test around point