[Archived] This repo has been migrated. Please use the https://github.com/aspnet/AspNetCore repo instead.
Перейти к файлу
Artak 9047124ffd
Merge pull request #407 from aspnet/mkArtakMSFT-patch-1
Update README.md
2019-09-23 16:04:57 -07:00
.github Update issue template to utilize issue reporter 2019-04-10 10:59:39 -07:00
.vscode Programatically set OmniSharpPlugin path at dev time. 2019-04-11 20:54:35 -07:00
.vsts ci you an npm for great robustness 2018-11-29 14:57:04 -08:00
build Update OmniSharp LanguageServer extension package version. 2019-08-27 15:54:21 -07:00
client Updated dependencies 2019-07-23 18:45:55 -07:00
src Depend on OmniSharp.MSBuild package version. 2019-08-27 14:49:23 -07:00
test Update OmniSharp LanguageServer extension package version. 2019-08-27 15:54:21 -07:00
.editorconfig Use KoreBuild and add Razor.VSCode.sln. 2018-06-25 10:28:27 -07:00
.gitattributes Add initial git and README.md pieces. 2018-06-25 10:21:47 -07:00
.gitignore Move client logic into a new NPM package project (#117) 2018-09-13 11:17:23 +01:00
CONTRIBUTING.md Add license and contributing guide (#165) 2018-10-04 12:28:44 -07:00
Directory.Build.props Make the repo buildable. 2018-08-07 15:04:08 -07:00
Directory.Build.targets Add support for 3.0 Razor projects. 2019-01-11 16:23:56 -08:00
LICENSE.txt Add license and contributing guide (#165) 2018-10-04 12:28:44 -07:00
NuGet.config Use KoreBuild and add Razor.VSCode.sln. 2018-06-25 10:28:27 -07:00
NuGetPackageVerifier.json Update to preview9 Razor bits. 2019-08-19 14:38:15 -07:00
README.md Update README.md 2019-09-23 16:04:30 -07:00
Razor.VSCode.sln Depend on OmniSharp.MSBuild package version. 2019-08-27 14:49:23 -07:00
build.cmd Use KoreBuild and add Razor.VSCode.sln. 2018-06-25 10:28:27 -07:00
build.sh Set executable bit on build.sh and run.sh 2018-10-02 10:25:20 +01:00
korebuild-lock.txt Update korebuild to acquire new SDK. 2019-03-21 16:36:59 -07:00
korebuild.json Update to latest Razor 2019-01-11 16:23:56 -08:00
omnisharp.json Fix F5 task hang. 2019-04-11 16:26:15 -07:00
run.cmd Use KoreBuild and add Razor.VSCode.sln. 2018-06-25 10:28:27 -07:00
run.ps1 Update bootstrappers and korebuild.json. 2018-08-13 10:40:42 -07:00
run.sh Set executable bit on build.sh and run.sh 2018-10-02 10:25:20 +01:00
version.props Update version to 1.0.0-alpha3 2019-03-21 19:09:20 -07:00

README.md

Razor.VSCode

This GitHub project has been archived. Ongoing development on this project can be found in https://github.com/aspnet/AspNetCore.

The Razor syntax provides a fast, terse, clean and lightweight way to combine server code with HTML to create dynamic web content. This repo contains the tooling to enable Razor in Visual Studio Code. The Razor tooling ships as part of the Visual Studio Code C# extension.

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the Home repo.

Get started

To use the Razor tooling for Visual Studio Code:

Disabling the Razor tooling

To disable the Razor tooling in Visual Studio Code:

  • Open the Visual Studio Code User Settings: File -> Preferences -> Settings
  • Search for "razor"
  • Check the "Razor: Disabled" checkbox

Building from source

Win/Linux/Mac Prerequisites:

Linux/Mac Prerequisites:

  • Mono (5.18.1 or later)

Clone the repo and restore Git submodules by running the following:

git clone https://github.com/aspnet/Razor.VSCode.git
cd Razor.VSCode
git submodule update --init --recursive

This repo uses the same set of build tools as the other ASP.NET Core projects. The developer documentation for building is the authoritative guide. Please read this document and check your PATH setup if you have trouble building or using Visual Studio Code

To build at the command line, run build.cmd or build.sh from the solution directory.

Run in Visual Studio Code

To run the built Razor tooling in Visual Studio Code:

  • Ensure you've run build.cmd or build.sh.

  • Ensure the installed dotnet from running the build script is on your path.

  • In the client directory run the following:

    npm install
    npm run compile
    
  • Open the solution folder in Visual Studio Code

  • Set the "razor.devmode" setting to true in the Visual Studio Code Workspace settings (File -> Preferences -> Settings -> Workspace Settings)

  • Run in the debugger (F5) using the Extension launch profile

  • A new Visual Studio Code instance will open as an Extension Development Host

  • Try out Razor tooling features in Pages/Index.cshtml or any other Razor file

    • NOTE: there may be a delay while the Razor Language Service starts up. See the Razor Log and OmniSharp log in the output window (View -> Output) to see the current status

Run all extension tests

To run all extension tests:

  • Close all instances of Visual Studio Code

  • From the client directory run:

    npm test