Commit Graph

927 Commits

Author SHA1 Message Date
Jass Bagga 582ffe2e10 Add HeadTagHelper and BodyTagHelper
Addresses aspnet/Mvc#5728
2017-03-29 12:23:55 -07:00
Pranav K e7f563843c Updating to 2.0.0 Internal.AspNetCore.Sdk 2017-03-29 12:06:15 -07:00
Ajay Bhargav Baaskaran 0b5113c76e Suppress compilation errors for TModel in imports 2017-03-29 11:42:13 -07:00
Kiran Challa 56c2d76e03 Upgrade Json.Net version to 10.0.1 2017-03-28 15:20:27 -07:00
Ryan Nowak 737a9a58ad Fix breaks in Razor Tests
I removed a reference from a src project which exposed this issue. We
shouldn't be using these types in new Razor.
2017-03-27 14:32:30 -07:00
Ryan Nowak af7798a9be Fix a type error in the tag helper comparison 2017-03-27 14:04:12 -07:00
Ryan Nowak 8d1cc43f8e Get rid of extra dependencies
This project shouldn't have any dependencies besides Razor.
2017-03-27 14:04:11 -07:00
Ryan Nowak bc9b9876e5 Add a service for initializing tooling
This is a new API for tooling to call to get a RazorTemplateEngine that's
initialized correctly. For now this is hardcoded to use MVC's conventions.

This is also a very temporary design to get us past the next wave of
changes.

We'll eventually want to change this to an ILanguageService, but this will
require some new plumbing in the editor, so let's defer that for another
day.

(cherry picked from commit a73b5f58a8713076433d24668b99705388b6d6b3)
2017-03-27 14:04:10 -07:00
Ajay Bhargav Baaskaran ed8425800a Revert: Don't generate CSharpStatementIRNode for whitespace 2017-03-27 12:45:49 -07:00
Ajay Bhargav Baaskaran 5928d0d54b Don't generate CSharpStatementIRNode for null or whitespace 2017-03-24 17:54:09 -07:00
Ryan Nowak 1683018d71 Add a static 'register' method to MVC's extensions
This will be called by the IDE, and by MVC to register all of the
functionality in Microsoft.AspNet.Mvc.Razor.Extensions.
2017-03-24 15:56:32 -07:00
Ryan Nowak 565dd30957 Make the parser options configurable
The RazorParserOptions were only configurable via an internal interface
and an extension method on the builder. This isn't suitable for VS because
we need to be able to update the configuration while the editor is open,
without creating a new engine.
2017-03-24 15:21:26 -07:00
Jass Bagga fe6517dcdd Add ITagHelperComponent
Addresses https://github.com/aspnet/Mvc/issues/5728
2017-03-24 13:53:17 -07:00
Ryan Brandenburg b4640f8bb8 Use AspNetCore.Mvc.RazorPages 2017-03-24 13:08:07 -07:00
Ryan Brandenburg 9ffc745e76 Add Mvc.Razor.Extensions to VSIX 2017-03-24 11:45:04 -07:00
N. Taylor Mullen 0fa79818e1 Add DisplayName to RequiredAttributeDescriptor.
- When `RequiredAttributeDescriptor`s are displayed in an editor their display name differs based on their name comparison mode. If their name comparison mode happens to be a prefix match then we need to append three dots to indicate that it's a required prefix for an attribute.
- Added a new descriptor builder test to validate `DisplayName` is created correctly.

#1119
2017-03-24 11:07:52 -07:00
Pranav K 2ea0659e60 Change compilation targets.
* Remove net451 as a compilation target
* Upgrade to netcoreapp2.0
2017-03-24 07:49:34 -07:00
Ajay Bhargav Baaskaran 54831fed35 Simplified if condition 2017-03-23 19:17:32 -07:00
Ajay Bhargav Baaskaran ae34e14358 Don't generate line mappings for imports 2017-03-23 10:39:07 -07:00
Ryan Nowak 6278dbeac5 Don't filter by assembly name if null is provided
This will nullref if null is provided for the assembly name filters. We
want to transition tooling to not pass any assembly names.
2017-03-22 17:12:21 -07:00
N. Taylor Mullen c07759996f Fix absolute path handling.
- Normalize paths to be absolute and to also use forward slashes.
- Updated our `EnsureValidPath` method to be `NormalizeAndEnsureValidPath`.
- Added tests to validate new `NormalizeAndEnsureValidPath`.
- Updated existing tests to react to `NormalizeAndEnsureValidPath` correctly.

#1106
2017-03-22 16:35:19 -07:00
Ryan Brandenburg 72febdac64 Move Razor.Host to Razor 2017-03-22 16:10:44 -07:00
Ajay Bhargav Baaskaran cab6eea663 Set file path from RazorSourceDocument in syntax tree 2017-03-22 15:13:38 -07:00
Doug Bunting 6fbbd5d148 Disable API Check in projects with untracked breaking changes 2017-03-22 08:35:10 -07:00
Ajay Bhargav Baaskaran c6a35e7b26 Added HasIndexer property to BoundAttributeDescriptor 2017-03-21 16:18:31 -07:00
Nate McMaster 9aa4048866
Switch off Travis container-based infrastructure
Something about running tests inside a docker container causes the tests to timeout

[skip appveyor]
2017-03-21 13:39:05 -07:00
N. Taylor Mullen 8e7d853bf9 Add global.json to git ignore. 2017-03-21 12:40:43 -07:00
Nate McMaster 049de5d631
Update Travis to macOS Sierra
[skip appveyor]
2017-03-21 12:21:01 -07:00
Ajay Bhargav Baaskaran 55d6362325 [Fixes #1094] Use custom JsonConverters for serializing/deserializing TagHelperResolutionResult 2017-03-21 12:08:06 -07:00
Ryan Nowak 5f547d8e32 Add intentation support
This is a code dump from the editor
2017-03-20 19:52:29 -07:00
N. Taylor Mullen f302d68589 Remove ViewComponent descriptor resolution from tooling.
#1074
2017-03-20 16:38:20 -07:00
Ajay Bhargav Baaskaran f3744efc5c Use Version 8.0.3 of Json.Net 2017-03-20 16:31:10 -07:00
N. Taylor Mullen d5e003fa4c Fix `RazorLanguageService`.
- Previously our constructor was calling down into the wrong overload.
2017-03-20 16:27:56 -07:00
Ryan Nowak 53ac097ce4 Add TagHelperFactsService 2017-03-20 15:50:34 -07:00
Stefan Nikolei 319c535224 Remove RazorIrNodeVisitorOfT (#1089) 2017-03-20 14:51:51 -07:00
Ajay Bhargav Baaskaran 4a71b1d57d [Fixes #980] Generate parser error for unquoted string token directives 2017-03-20 11:58:55 -07:00
Ryan Nowak ca6f988bd9 Add GetTagHelperSpans
This is a code dump from the editor
2017-03-20 11:18:05 -07:00
Ryan Nowak fdd08ceab2 Adding RazorSyntaxFactsService
This is a code dump from tooling -> Razor

This service will exist to answer questions about syntax trees for the
editor. Right now I'm just moving in the code in the simplest way
possible. Tests + cleanup to follow.
2017-03-20 08:21:28 -07:00
Ryan Nowak 8a6a22c767 Fix one of Taylor's broken comparers
This was a bug that wasn't being caught by tests until I implemented
IEquatable on the TagHelper types.
2017-03-19 12:39:33 -07:00
Ryan Nowak bbd08f0cc9 Add TagHelper directive and match info to CodeDocument 2017-03-19 12:33:09 -07:00
Ryan Nowak feb5f395d2 Make TagHelperDescriptor and friends IEquatable 2017-03-19 11:38:41 -07:00
Ryan Nowak b6aa6b8099 Make AcceptedCharacters non-legacy 2017-03-19 11:30:19 -07:00
Ryan Nowak acbbdf0b2c Rename BlockType -> BlockKind
Also moved BlockKind and SpanKind out of .Legacy
2017-03-19 11:18:40 -07:00
Ryan Nowak 0aee9152bd Make AcceptedCharacters public
Needed for tooling
2017-03-19 11:02:31 -07:00
Ryan Brandenburg a7eb30ddca Remove old razor 2017-03-17 14:58:13 -07:00
N. Taylor Mullen 8f9ff1abd9 Clean up TagHelperDescriptor APIs.
- Removed all design time descriptors and put their API surface into their corresponding descriptor. Part of removing the design time API surface was removing the tracking of `<Remarks>`, it wasn't used so there's on need to track it until we need it.
- Removed the Type requirement from `TagHelperDescriptor`. With this separation we'll be able to have abstract `TagHelper`s that aren't based on a class implementation.
- Removed Prefix from the `TagHelperDescriptor` API surface. It was a legacy requirement based on how the Razor parser was put together. We can work around this now.
- Stripped correlation information from the immediate `TagHelperDescriptor` API surface. Instead this information is now tracked in `TagMatchingRule`s. This change means that you will not have multiple `TagHelperDescriptor`s per `TagHelper`; instead it's all tracked in a single descriptor. A side effect of this change was the transformation of `IsIndexer` => 3 new properties.
- Renamed many descriptor types and property names.
- Added builder APIs to construct TagHelpers since they're inherently immutable in their API surface.
- Added `ITagHelperDescriptorBuilder` to represent `TagHelper`s that are built from an `ITagHelper` implementing class. It re-introduces the `TypeName` association of a `TagHelper`.
- Added `ITagHelperBoundAttributeDescriptorBuilder` to represent that an attribute was associated with a property.
- Added validation methods to the descriptor builders to enable consumers to validate the current state of the builder and add diagnostics as necessary.
- Moved descriptors away from RazorError.
- Updated the various comparers to understand the descriptors new API.
- Added a new `RazorDiagnosticFactory` abstraction to handle `RazorDiagnostic`s and their corresponding errors/ids etc. This new API should allow for easy addition of new `RazorDiagnostic` errors.
- Updated the `DefaultTagHelperDescriptorFactory` to construct `TagHelperDescriptor`s using the new builder APIs and in the new descriptor format (1 descriptor per type).
- Updated `ViewComponentTagHelperDescriptorFactory` to construct `TagHelperDescriptor`s with the builder API.
- With both factory implementations code was duplicated because the ViewComponent work will be moving outside of Razor once we have the proper hooks.
- Updated `TagHelper` binding bits to capture a binding result in order to query which rules appy to a given tag name.
Addressed feedback
- Update tests to react to new `TagHelperDescriptor` API.
- Remove case sensitive comparers and some cleanup
- Added TagHelperDescriptorJsonConverter, RazorDiagnosticJsonConverter and added serialization tests
2017-03-17 12:18:05 -07:00
Ryan Nowak 90b48347a5 Port the legacy RazorEditorParser 2017-03-16 12:47:29 -07:00
Nate McMaster 9b3e8d0cda React to aspnet/Testing#259 2017-03-16 09:31:55 -07:00
Nate McMaster 43a41398ac Unify dependency versions to one file 2017-03-15 16:44:00 -07:00
Ajay Bhargav Baaskaran 310ccc31d0 Include default imports when ImportsFileName is null 2017-03-14 19:33:18 -07:00