C# IDE Plugin for Sublime Text 3
Python JavaScript Other
Latest commit 574d22e Sep 8, 2016 @jchannon jchannon committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
commands Using quickpanel in swap server instead of popup Jan 22, 2016
docs Update index.md Jun 18, 2015
documents/ko + korean tutorial Sep 30, 2014
lib Improved Status and fixed a bug for server restarts Jan 18, 2016
listeners Merge branch 'master' of https://github.com/OmniSharp/omnisharp-sublime Jan 30, 2016
messages Create 1.9.6 Jun 19, 2015
omnisharp-roslyn @ a92f0f5 Finished basic Roslyn + Legacy OmniSharpServer Jan 16, 2016
omnisharp-server @ e190291 Finished basic Roslyn + Legacy OmniSharpServer Jan 16, 2016
prebuilt-omnisharp-roslyn working on prebuilt-roslyn support Jan 17, 2016
prebuilt-omnisharp-server working on prebuilt-roslyn support Jan 17, 2016
templates shortcuts added for new class Oct 23, 2014
tests Adding in CI via Appveyor and Travis-CI Feb 5, 2016
.anaconda + async로 동작하는 자동완성 기능 추가 Mar 1, 2014
.gitignore .DS_Store added to gitignore and first crack at syntax and semantic e… Sep 13, 2014
.gitmodules Finished basic Roslyn + Legacy OmniSharpServer Jan 16, 2016
.no-sublime-package Update .no-sublime-package Oct 19, 2014
.travis.yml Adding in CI via Appveyor and Travis-CI Feb 5, 2016
BuildConsole.hidden-tmLanguage Build: add highlighting for build output Apr 5, 2015
BuildConsole.hidden-tmTheme Build: add highlighting for build output Apr 5, 2015
BuildConsole.sublime-settings Build: fix file refering Apr 3, 2015
Context.sublime-menu Rename "Syntax Error" to "Code Issue" Apr 9, 2015
Default.sublime-commands Added in command to restart omnisharp. Jan 17, 2016
Default.sublime-keymap fix for new file key binding Apr 27, 2015
Main.sublime-menu pass config.json arg, show settings in menu, save config location on … Oct 31, 2014
OmniSharpSublime.py Finished basic Roslyn + Legacy OmniSharpServer Jan 16, 2016
OmniSharpSublime.sublime-project + async로 동작하는 자동완성 기능 추가 Mar 1, 2014
OmniSharpSublime.sublime-settings Merge branch 'master' of https://github.com/OmniSharp/omnisharp-sublime Jan 30, 2016
OutputPanel.hidden-tmLanguage fix output panel color scheme by use buildin BuildConsole.hidden-tmTheme Jun 19, 2015
README.md Update README.md Sep 8, 2016
Side Bar.sublime-menu shortcuts added for new class Oct 23, 2014
appveyor.yml Adding in CI via Appveyor and Travis-CI Feb 5, 2016
build.cmd Fixing an issue with build.cmd Jan 18, 2016
build.sh Finished basic Roslyn + Legacy OmniSharpServer Jan 16, 2016
messages.json fix for new file key binding Apr 27, 2015
mkdocs.yml file templates Nov 4, 2014

README.md

Help Required

****Looking for a maintainer. If you'd like to help manage this plugin please file and issue****

Linux & OSX Windows
Build Status Build status

OmniSharpSublime for ST3

OmnisharpSublime is a plugin for ST3 to provide a C# development environment. It communicates with OmniSharpServer by nosami for IDE functions.

It works on:

  1. Mac OSX
  2. Linux
  3. Windows

Features

  1. Auto OmniSharpServer running
  2. Asynchronous communication with OmniSharpServer (Never freeze!)
  3. Auto Completion
  4. Goto definition
  5. Rename
  6. Goto implementation
  7. Syntax/Semantic error highlighting
  8. Displays possible override methods
  9. Find Usages
  10. Format Document
  11. Displays code issues such as assigment is redundant
  12. Fix code issues - put cursor on highlighted issue and select Fix Code Issue
  13. Remove Unused, Add Missing and Sort Using Statements
  14. Code Actions eg. Convert LINQ query to Fluent Syntax
  15. Add File To Project
  16. Remove File from Project (via sidebar and context menu)
  17. Add New C# Class & Interface (via sidebar and context menu) via File Templates which also adds to csproj
  18. Type Lookup with Documentation
  19. Hide/Show Info Panel
  20. Run Unit Tests
  21. Build/ReBuild/Clean Solution
  22. Reload Solution

Requirements

Installation

Building From Source

  1. Move to ST3 plugin directory in console.

    cd {path to ST3 plugin directory}/Packages
    
  2. Clone repository.

    git clone https://github.com/OmniSharp/omnisharp-sublime.git OmniSharp
    
  3. Move to plugin directory, update submodule and build.

    #Windows
    cd OmniSharp
    git submodule update --init --recursive
    build.cmd
    
    
    #Linux Or Mac OSX
    cd OmniSharp
    git submodule update --init --recursive
    ./build.sh or ./build.cmd
    

Selecting OmniSharp Version

Currently both omnisharp-server and omnisharp-roslyn are both supported. To swap between the different version open up the sublime command window ctrl-shift-p, type Select Server Version and press enter. Prebuilt-Roslyn and Prebuilt-Legacy are the only two working servers that work unless you have built the plugin from source.

Project Setting

The server will automatically find the the solution file from the folder you have opened in Sublime. If you have multiple solutions you have to specify the solution file you wish to use in a sublime-project.

  1. Go to File -> Open and select the folder with your solution in it.

  2. Go to Project -> Save Project As and save a YOURPROJECTNAME.sublime-project in the same location as your *.sln

  3. Open your YOURPROJECTNAME.sublime-project file that should now appear in the sidebar on the left

  4. Enter the location to the *.sln file like below

Example of a sublime-project

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "."
        }
    ],
    "solution_file": "./testconsoleprj.sln"
}

Once the YOURPROJECT.sublime-project is set up and saved, follow the below:

  1. Close Sublime (YMMV but this seems to be the best way to open the YOURPROJECTNAME.sublime-project)
  2. Open Sublime
  3. Click Project -> Open Project, and select your YOURPROJECT.sublime-project file

NOTE : For ASP.Net vNext applications please use the Roslyn branch of this repository.

C# language-specific settings

Create C# settings file as shown in this picture

Imgur

Paste the below in. This will launch intellisense on . and < symbols

 {
    "auto_complete": true,
    "auto_complete_selector": "source - comment",
    "auto_complete_triggers": [ {"selector": "source.cs", "characters": ".<"} ],
 }

OmniSharpServer Settings

The Sublime plugin communicates to OmniSharp Server which has various available settings stored in a config.json file. By default the location of this file is in a folder under the Sublime OmniSharp packages folder called PrebuiltOmniSharpServer and there is also a user specific plugin setting that specifies the location of this config.json file. To prevent your settings being overridden on new releases of the Sublime package, we recommend you store your config.json file somewhere other than the default location. Once you have taken a copy of config.json and put it somewhere safe you will need to update the Sublime plugin's user setting called "omnisharp_server_config_location".

Format Document Settings

When you press Ctrl + K + D to format the document you may see CR markers.

CR Markers

This is to do with the settings for OmniSharpServer.

  1. Click Preferences - Browse Packages
  2. Go to OmniSharp/PrebuiltOmniSharpServer/ sub directory
  3. Open config.json and modify the eolMarker setting to \n like below

OR

Open your safely tucked away config.json file and modify the eolMarker setting to \n like below

  "TextEditorOptions": {
    "tabsToSpaces": true,
    "tabSize": 4,
    "indentSize": 4,
    "continuationIndent": 4,
    "labelIndent": 0,
    "eolMarker": "\n",
    "indentBlankLines": false,
    "wrapLineLength": 80
  },

Unit Tests

For the plugin to be able to run unit tests you need to configure the test runner. This is done in the server config file.

  1. Click Preferences - Browse Packages
  2. Go to OmniSharp/PrebuiltOmniSharpServer/ sub directory
  3. Open config.json and modify the TestCommands like below

OR

Open your safely tucked away config.json file and modify the TestCommands like below

 "TestCommands": {
    "All": "nunit-console.exe -nologo {{AssemblyPath}}",
    "Fixture": "nunit-console.exe -nologo {{AssemblyPath}} -run={{TypeName}}",
    "Single": "nunit-console.exe -nologo {{AssemblyPath}} -run={{TypeName}}.{{MethodName}}"
   },