ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Kulture

by OmniSharp ST3

Sublime extension for ASP.NET vNext

Details

  • 2015.09.26.18.05.46
  • github.​com
  • github.​com
  • 2 years ago
  • 1 hour ago
  • 3 years ago

Installs

  • Total 15K
  • Win 7K
  • OS X 6K
  • Linux 1K
May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13
Windows 0 2 5 4 6 3 8 3 2 4 3 4 4 5 2 4 12 4 5 4 5 2 4 5 2 7 5 4 2 5 10 4 7 5 3 2 3 5 6 5 5 6 1 2 8 3
OS X 0 2 1 6 4 2 1 1 2 1 4 3 3 3 2 2 1 3 2 2 2 0 2 0 1 2 2 1 3 3 2 4 2 3 2 0 1 2 3 2 2 4 3 0 3 2
Linux 0 0 2 2 1 1 3 2 0 1 3 2 2 0 1 0 1 4 0 0 1 0 1 0 1 1 0 0 0 6 2 1 0 0 4 1 1 1 1 3 3 0 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime Kulture

A Sublime Text 3 extension for ASP.NET vNext

In this readme you will learn how to install the components to get started with ASP.NET in Sublime Text 3. There is also a getting started tutorial to show you some of the features included with this release.

Video

Installation: Mac OS X

  1. Install ASP.NET vNext Command Line Tools

  2. Download Sublime Text 3

  3. Install Sublime Kulture Using the Package Control Plugin

    • Follow these instructions to install package control
    • Bring up the Command Palette (Cmd + Shift + P on OS X, Ctrl + Shift + P on Windows).
    • Select Package Control: Install Package
    • Select Kulture when the list appears.
    • Package Control will automatically keep Kulture up to date with the latest version.

Manual Install * Install Sublime Kulture by cloning this repo into /Users/{user}/Library/Application\ Support/Sublime\ Text\ 3/Packages

git clone https://github.com/OmniSharp/Kulture.git

Installation: Windows

  1. Install ASP.NET vNext Command Line Tools

    • Perpare Powershell execution policy. In an Admin PowerShell window execute the following command.
      Set-ExecutionPolicy RemoteSigned
    • From an admin command prompt window run the following command
      powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"
    • Close the command prompt window and open a new command prompt window and run the following commands
      kvm upgrade
    • If Sublime was already installed and running while installing ASP.NET vNext Command Line Tools, you will need to restart Sublime for the changes to work.
  2. Download and Install Sublime Text 3

  3. Install Sublime Kulture

Using the Package Control Plugin * Follow these instructions to install package control * Bring up the Command Palette (Cmd + Shift + P on OS X, Ctrl + Shift + P on Windows). * Select Package Control: Install Package * Select Kulture when the list appears. * Package Control will automatically keep Schema Validator up to date with the latest version.

Manual Install * Install Sublime vNext by cloning this repo into C:\Users\{user}\AppData\Roaming\Sublime Text 3\Packages

git clone https://github.com/OmniSharp/Kulture.git

Note: The Sublime Text 3 directory may not exist if you have never launched Sublime before. If you are unable to locate this directory try launching Sublime and try again

Getting Started

This tutorial will show you how you can get started with ASP.NET vNext in Sublime Text 3. After completing this tutorial you will be familiar with how to use Sublime Kulture and its primary features.

To get started you can use yeoman

Note: This requires you to have node.js and npm already installed

npm install -g yo
npm install -g generator-aspnet

To run the yeoman scaffolder, type

yo aspnet

Let's go ahead and create a new Web project using yo aspnet. In Sublime, click on File -> Open Folder and navigate to the folder to open it up.

Note: In Sublime for Mac use the File -> Open command

Since we just grabbed this from source control there are NuGet packages which this project requires that are missing. To restore the NuGet packages

  • Press Ctrl(Cmd) + Shift + P to bring up the command palette
  • Type Run K Commands and hit Enter (Return)
  • Type dnu restore and hit Enter (Return)

Note: when executing dnu restore if you get an error about missing NuGet packages you can execute the alternate command dnu restore -s https://www.myget.org/F/aspnetvnext/api/v2

You should see a Terminal/Powershell window launch and execute your commands.

Now, let's go ahead and tell Sublime to use ASP.NET as the build system. To do this, click Tools -> Build System -> ASP.NET

  • Press Ctrl(Cmd) + B or F7 to build projects

You should be able to see the output of your build in the output window towards the bottom of your screen. At this point your code should have built successfully.

Now let's see what the experience looks like if there is an error in your .cs file. Introduce an error in the Startup.cs file and try building again. You should now see errors in the output window. You can navigate through the errors as follows

  • F4 takes you to the next error
  • Shft + F4 takes you to the previous error

When an error has focus it will be highlighted in the build results and your cursor will be taken to the line and column where the error was reported.

After we resolve all the errors we have introduced, let us try and run the application

  • Press Ctrl(Cmd) + Shift + P to bring up the command palette
  • Type Run K Commands and hit Enter (Return)
  • Type dnx web and hit Enter (Return)
  • If you are on a Mac or Linux, type dnx kestrel and hit Enter (Return)

You should see a Terminal/Powershell window launch and start running your server. You can navigate to http://localhost:5001 (or http://localhost:5000 on a Mac) in your favorite browser you view the website.

Intellisense

To be able to get intellisense working within Sublime please install OmnisharpSublime (follow the instructions in the README).

To get intellisense with ASP.Net vNext projects you need to create a project file in Sublime. Go to Project - Save Project As and enter in a name for your project. OmniSharpSublime will use this to know what files and assemblies it needs to provide intellisense for (TIP : Close & Re-Open Sublime if you do not see intellisense, it may take 10 secs for the intellisense server OmniSharpServer to start once Sublime has loaded all the plugins)

Once OmniSharpSublime is installed and you have a project file you should be able to see intellisense:

intellisense

Credits

Sublime Terminal

All of Sublime Terminal is licensed under the MIT license.

  Copyright (c) 2011 Will Bond 

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.