- Exposed `VisualStudioRazorParser`, `DocumentStructureChangedEventArgs` and `ICanHasContextChangedListener` as ways to consume the new parser for a Razor document. - Split the `VisualStudioRazorParser` into an abstract base and an implementation to avoid internal constructors. - Changed the parser and corresponding smart indenter to take in document trackers, template engine factories and parser context change listeners. Of these additions the parser context change listeners will be deprecated once we own the TagHelper discovery mechanisms. - Changed how the parser manages its internal parsing life cycle. It now creates template engines when the document tracker tells it to. So when project changes happen or new documents are opened the parser will re-instantiate its internal parser to ensure that it is parsing against the correct configurations. - Removed all accessor services in favor of a singular RazorEditorFactoryService. This service is responsible for retrieving/creating various Razor components. - Changed the code document provider to now use the parser provider in order to locate code documents associated with buffers. Prior to this that logic was hard coded. - Removed old template engine reconstruction logic in the document tracker now that the parser owns that piece. - Updated tracker to notify listeners when it's unsubscribing. This is how listeners can know when to tear bits down. - Refactored/added pieces to the `DefaultVisualStudioRazorParser` in order to improve its unit/integration testing ability. - Updated existing tests to react to new signatures. - Added new visual studio razor parser tests, uncommented existing ones, and re-enforced ones that were previously flakey. - Added various tests for the new services added, i.e. text buffer factory service tests. #1630 |
||
|---|---|---|
| build | ||
| shared/Microsoft.AspNetCore.Razor.TagHelpers.Testing.Sources | ||
| src | ||
| test | ||
| tooling | ||
| .appveyor.yml | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| Directory.Build.props | ||
| Directory.Build.targets | ||
| LICENSE.txt | ||
| NuGet.config | ||
| NuGetPackageVerifier.json | ||
| README.md | ||
| Razor.Slim.sln | ||
| Razor.sln | ||
| build.cmd | ||
| build.sh | ||
| run.cmd | ||
| run.ps1 | ||
| run.sh | ||
| version.xml | ||
README.md
Razor
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 parser and the C# code generator for the Razor syntax.
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.
Building from source
To run a complete build on command line only, execute build.cmd or build.sh without arguments.
Before opening this project in Visual Studio or VS Code, execute build.cmd /t:Restore (Windows) or ./build.sh /t:Restore (Linux/macOS).
This will execute only the part of the build script that downloads and initializes a few required build tools and packages.
See developer documentation for more details.