Giter Club home page Giter Club logo

kulture's Introduction

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/ligershark/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.
  1. Download and Install Sublime Text 3

  2. 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/ligershark/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.

The first thing we will do is grab the samples. Using your favorite git client clone the repo at ASP.NET vNext Home

git clone https://github.com/shirhatti/Home.git

If you prefering using yo instead you can download our yeoman generator

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 open the included HelloMvc sample in Sublime. In Sublime, click on File -> Open Folder and navigate to the Home\Samples\HelloMvc 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 kpm restore and hit Enter (Return)

Note: when executing kpm restore if you get an error about missing NuGet packages you can execute the alternate command kpm 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 k web and hit Enter (Return)
  • If you are on a Mac, type k 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

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.

kulture's People

Contributors

bmsullivan avatar bradygaster avatar btbytes avatar e00dan avatar jchannon avatar kenegozi avatar maximrouiller avatar sayedihashimi avatar shirhatti avatar voltagex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kulture's Issues

Error Message

I get this error on Sublime startup from time to time.

screen shot 2014-10-31 at 15 58 12

Update readme to install OmniSharp sublime extension

We have worked with OmniSharpSublime team members to create a new sublime text plugin OmniSharp we should update the readme.md to tell users to install OmniSharp sublime text extension instead of manually installing.

Error when calling kpm commands

We are getting an error on mac that the kpm command is not recognized. This is because source kvm.sh is not getting called.

Build fails when using CMD+B, but not 'kpm build'

When I use the CMD+B shortcut on a newly-generated MVC project from yeoman, I get the following error messages:

 /Users/brian/Projects/MvcApplication1/Startup.cs(1,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Startup.cs(2,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Startup.cs(3,17): error CS0234: The type or namespace name 'Framework' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Controllers/HomeController.cs(1,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Models/User.cs(1,29): error CS0234: The type or namespace name 'DataAnnotations' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Startup.cs(9,31): error CS0246: The type or namespace name 'IBuilder' could not be found (are you missing a using directive or an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Controllers/HomeController.cs(6,35): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Controllers/HomeController.cs(8,16): error CS0246: The type or namespace name 'IActionResult' could not be found (are you missing a using directive or an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Models/User.cs(7,10): error CS0246: The type or namespace name 'Required' could not be found (are you missing a using directive or an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Models/User.cs(8,10): error CS0246: The type or namespace name 'MinLength' could not be found (are you missing a using directive or an assembly reference?)
 /Users/brian/Projects/MvcApplication1/Controllers/HomeController.cs(10,20): error CS0103: The name 'View' does not exist in the current context

 Build failed.
     0 Warnings(s)
     11 Error(s)

 Time elapsed 00:00:01.0468637
 [Finished in 1.3s with exit code 255]
 [cmd: ['sh', '/Users/brian/Library/Application Support/Sublime Text 3/Packages/Kulture/build.sh']]
 [dir: /Users/brian/Projects/MvcApplication1]
 [path: /usr/bin:/bin:/usr/sbin:/sbin]

However, when I use the command palette to do a kpm build, it builds just fine.

Also, if I add the following to build.sh within the Kulture package, CMD+B starts to work (I got this snippet from my .bash_profile):

 [ -s "/Users/brian/.kre/kvm.sh" ] && . "/Users/brian/.kre/kvm/kvm.sh"

Is something screwed up in my environment, or does this need to be included in build.sh?

project.json IntelliSense

We have an implementation of completions in project.json in the autocomplete branch, but that functionality is limited to the top 100 NuGet packages so it's not very useful. We should re-implement that.

We should enable the following features.

  • Complete package name
  • Complete package versions
  • Basic IntelliSense for the entire file

Ideas on design

For completing package name we have the following options.

  1. When a user enters CMD + Spacebar to query nuget.org/myget.org to get the names of packages that start with the previously entered text
  2. When a user enters CMD + Spacebar we look up available package names in a file which is shipped with Kulture
    1 Have a combined approach where we have an index of package names, and when there is no hit on that cache we query nuget.org/myget.org

I like the idea of having a cache, but I'm not sure if it's required. Perhaps directly querying nuget.org/myget.org is good enough. Maybe we could prototype that and see what the experience feels like. If it is too slow then we can start adding caching/using an index.

Sublime for windows: kpm restore cannot be found

In windows 8.1, when running 'kpm restore', power shell opens up but is not able to find kpm:

kpm : The term 'kpm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • kpm restore
  • - CategoryInfo          : ObjectNotFound: (kpm:String) [], CommandNotFoundException
    - FullyQualifiedErrorId : CommandNotFoundException
    
    

Anything else that should be done extra for sublime on windows?

Thx

Handling multiple projects

Currently have a test lib and a class lib.

Just wondering about the functionality to either build or run either of the projects from root?

"Run K Commands" does nothing

Mac OSX 10.9.4, Sublime text 3 build 3059. Things are installed properly, Run K Commands shows up in the command list, but hitting return doesn't open a console, doesn't do anything.

Build fails

Build fails when no file is selected OR when selected file is nested deep in the folder structure.

Build only works when selected file is in the same directory as project.json

Spec'ing the path forward

Continuing from our last week meet I have some vague ideas that I like to jot down into action points:

  1. Omnisharp is awesome + all the new K stuff is awesome + scriptcs is awesome

As discussed in last week meeting the intend is to combine them all (atleast the first two) into something super awesome instead of diverging too much from one another in the context of the editing experience outside of visual studio.

Why the focus on building out OmniSharpServer instead of going from scratch (for anyone reading this fresh)?

The contracts that are in place right now in omnisharpserver already provide an awesome foundation to build on.
*The work @sp3ctum did on the emacs plugin is jawdroppingly awesome.
*The fact that @nosami and @stephen-james and I were able to get from zero to:

atom-sharper

in 4 days is also testament to that.

OmniSharpServer improvements

  • I'd like to start omnisharp server with no filename directory so that startup is almost instant.
  • Instead of specifying a port from the editor I'd like the server to automatically start in the range 2000-2100 and report back which was taken.
  • Push based message on standard/error out in a specific format i.e :: [EVENT] :: [DATA] e.g: :: project-loading :: picked up blah.dll , :: project loaded
  • Specify a /load-project?path=(file or dir)&async endpoint
    • returns immediately (editors can read status in console output)
  • Omnisharp is not limited to one project you just send /syntaxErrors?file=(file) and the server knows which project the file belongs to and which handler should be used
  • /load-project should have all the heuristics that are now inside the editors themselves
  • Ideally omnisharpserver does this all in seperate AppDomains so that crashes of the server itself are rare.

handlers for different project types

  • Have different handlers based on what the heuristics of the previous call determine the project is
    • if its a k project use the KProjectHandler to handle all the urls that OmniSharpServer exposes with aditional rosylin and designtimehost smarts.
    • if its a scriptcs project/file use the ScriptCsHandler
    • fallback to OmniSharpHandler
    • Its ok for endpoints to throw 501 Not Implemented if a particular handler does not support the functionality.

This obliviates our initial thought of having a C# brain and an Editor Brain that would also need to communicate out of process with each other and possibly
over complicating things and making the thing easier to topple over.

Random thought: should we conceptually make a move from OmniSharpServer 2.0 to Kulture to signal the even broader community effort?

As stated these are my vague views on how to move forward, would love to hear what everyone involved thinks the next steps should be so we can come to concrete actions on this!

K kestrel fails

System.Exception: Unable to locate project.json is thrown when k kestrel is run when the selected file in Sublime is in different directory than project.json

Invalid project.json is considered valid by the validator

Following JSON is considered valid but will not run since "web" should be in the "commands" node:

{
  "version": "0.1-alpha-*",
  "dependencies": {
    "Microsoft.AspNet.Diagnostics": "0.1-alpha-build-0682",
    "Microsoft.AspNet.Hosting": "0.1-alpha-build-0572",
    "Microsoft.AspNet.Mvc": "0.1-alpha-build-1268",
    "Microsoft.AspNet.Server.WebListener": "0.1-alpha-build-0520"
  },
  "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001",
  "configurations": {
    "net45": {
      "dependencies": {
        "System.Runtime": "",
        "System.ComponentModel.DataAnnotations": ""
      }
    },
    "k10": {}
  }
}

Use a .sublime-project file

Using a .sublime-project similar to a .sln as employed by Visual Studio would make it easier to store project specific settings without modifying the global package settings.

Pros

Easier to store project-specific settings
Handle multiple projects
No more project.json not found bugs

Cons

Stores a extra file on disk that you need to check-in into Source Control.
This file will be useless to most folks using Visual Studio

kulture error: Terminal: The terminal terminal was not found in xubuntu

I have the error in title on xubuntu

I realize the error is coming from line 90 in Kulture.py whereby default terminal program is assumed to be terminal when window manager is xfce4.

elif wm[0] == 'xfce4-session':
    default = 'terminal'
elif wm[0] == 'ksmserver':

In my case I'm running Xubuntu with no particular changes to system and default terminal program is xfce terminal.

kpm restore does nothing

Hi there!

I just followed the instructions you gave , but when i do ctrl+shift+p > run k commands > kpm restore! it does not open the terminal window as described

Plz Help

Next meeting (1st week of October)

I was wondering if you guys would be interested in meeting up to see how things are going? I'm hoping to setup some time for us to sync up on October 8. We should have more info on the design time host (and hopefully the sample repo you need) by this date. Once we have that it should unblock more of the interesting ASP.NET vNext scenarios.

I'll also have some other good news to share that you're likely interested in.

I'd like to see if we can get the following folks on the call, but everyone is invited.
@shanselman @davidfowl @jchannon @nosami @Mpdreamz @stephen-james @mat-mcloughlin

_How is October 8 at 12:00 PM (noon) Pacific Time?_

Next meeting

Hey guys I'd like to see if we can meetup to review all the good work that has progressed this past week, and for us to sync up on our plans going forward. I'm going to be in Vegas next week so I'm hoping we can meet this week.

How is Friday at 10 AM Pacific Time?

I'd like to see if we can get the following folks on the call, but everyone is invited.
@shanselman (optional) @davidfowl @jchannon @nosami @Mpdreamz

If you would like to join but are not listed above please add your Skype user name below.

Invoking k commands will fail if not in the folder with

If you invoke the Run K commands from a file that is not in a directory with project.json then you will get an error project.json not found. I think the resolution to that is to set the working directory to the folder that has project.json or pass the path to the folder as an arg to the script and have the script cd to that folder.

If you have a change please try out changes in master branch and let me know if you run into any issues other than what I have noted above.

Is Sublime Text 3 the right target editor?

A few of us met today to discuss Kulture and one of the questions that came up was, is Sublime Text 3 the correct editor for this effort?

For some background we'd like to enable ASP.NET vNext on all platforms and with all tools. We would like to create an experience for a single third party editor/tool which is popular on Mac. That implementation would ensure that we have all the features we need in ASP.NET vNext and it will serve as a model for how others can develop similar experiences.

We chose Sublime Text because it seems like it's a widely used editor for many web developers and has a good (heavily used) plugin ecosystem. We chose Sublime Text 3 because targeting Sublime Text 2 and then upgrading that code for 3 would be very costly. Supporting two different versions would have been difficult as well.

The question of Sublime came up primarily because it is not open source. Ideally we could support an open source tool instead of a close source tool which requires a license fee.

Is there any open source editor which is as popular as Sublime is on Mac? Any links to data on this would be helpful.

Let's discuss here. In the meantime let's keep the momentum we have and continue to see how far we can get with Sublime Text 3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.