Commit Graph

1222 Commits

Author SHA1 Message Date
Mike Harder 01fe818dcd Update dependencies to match Visual Studio 15.3 (#1534) 2017-07-11 16:34:32 -07:00
Mike Harder b8f550fdf6 Enable Travis and AppVeyor in "rel" branches (#1539) 2017-07-11 15:11:12 -07:00
Mike Harder aebb841e41 Upgrade Roslyn to 2.3.0-beta4-* (#1533) 2017-07-10 17:28:23 -07:00
Pranav K 3d62e8e08b Updating KoreBuild branch 2017-07-10 11:58:00 -07:00
Pranav K f0794bfe80 Branching for 2.0.0 rtm 2017-07-10 11:45:30 -07:00
Ryan Nowak 1d5dfcc6b4 Update our VSIX version to 15.5 2017-07-10 08:08:09 -07:00
N. Taylor Mullen 99ff9d44a3 Update repo to utilize ApiCheck.
- Re-enabled api check for `Microsoft.AspNetCore.Razor` and `Microsoft.AspNetCore.Razor.Runtime`. This resulted in me adding known breaking changes for the packages.
- Added empty baseline files for `Microsoft.AspNetCore.Razor.Language`, `Microsoft.AspNetCore.Mvc.Razor.Extensions` and `Microsoft.CodeAnalysis.Razor`.
- Disabled ApiCheck for `Microsoft.CodeAnalysis.Razor.Workspaces`, `Microsoft.CodeAnalysis.Remote.Razor`, `RazorPageGenerator` and `Microsoft.VisualStudio.LanguageServices.Razor` to prevent ApiCheck warnings about missing baselines.

#1107
2017-07-07 15:59:36 -07:00
Ajay Bhargav Baaskaran b70815e317 Made `RazorCodeGenerationOptionsBuilder.DesignTime` getter only
- Made RazorCodeGenerationOptions consistent with RazorParserOptions
2017-07-07 14:41:53 -07:00
Ryan Nowak 9c0a8a5c96 Rename properties on taghelper nodes 2017-07-07 11:32:05 -07:00
Ryan Nowak ff40124594 Convert most of CodeWriter into extensions
We don't really want to ship what we have as a contract. As an emergency
measure we are making it into internal extension methods so we can have
a do-over in 2.1.
2017-07-07 10:55:33 -07:00
Ajay Bhargav Baaskaran 267b3fab0a Made IntermediateNodeWalker.Ancestors indexable 2017-07-06 19:24:25 -07:00
Ajay Bhargav Baaskaran 49eab41726 Made CodeTargetBuilder an abstract class 2017-07-06 19:01:28 -07:00
Ajay Bhargav Baaskaran d6e892b30c Adjusted verbosity of some property names and made
TagHelperIntermediateNode.TagHelpers and IList
2017-07-06 18:05:36 -07:00
N. Taylor Mullen 02160a04d9 Make ViewComponentTagHelperMetadata static.
#1521
2017-07-06 17:17:41 -07:00
Ajay Bhargav Baaskaran 6fdd4d653c Made InvalidNonWhitespaceHtmlCharacters internal 2017-07-06 17:12:46 -07:00
N. Taylor Mullen 45fad171a6 Reduce public surface area of some APIs.
- Change `DefaultRazorEngineBuilder.DesignTime` to be getter only
- Make `DocumentClassifierPassBase.TargetExtensions` private.

#1510
2017-07-06 16:50:11 -07:00
N. Taylor Mullen d891fae4a9 Rename ThrowForMissingEngineDependency.
- Rename `RazorEngineFeatureBase.ThrowForMissingEngineDependency` to `ThrowForMissingFeatureDependency`
- Rename `RazorEnginePhaseBase.ThrowForMissingEngineDependency` to `ThrowForMissingFeatureDependency`

#1510
2017-07-06 16:50:11 -07:00
N. Taylor Mullen bba508c7c6 Change TagHelperDescriptor APIs to use IReadOnlyList.
- Change `TagHelperDescriptor.AllowedChildTags` to be `IReadOnlyList`.
- Change `TagHelperDescriptor.BoundAttributes` to be `IReadOnlyList`.
- Change `TagHelperDescriptor.TagMatchingRules` to be `IReadOnlyList`.
- Change `TagMatchingRuleDescriptor.Attributes` to be `IReadOnlyList`.

#1510
2017-07-06 16:01:46 -07:00
N. Taylor Mullen c34a99e188 Update the TagHelperBinding API to use IReadOnlyList.
- Changed `Attributes` to return `IReadOnlyList<KeyValuePair<string, string>>`.
- Changed `GetBoundRules` to return `IReadOnlyList<TagMatchingRuleDescriptor>`.
- Updated tests to react to new signature.

#1510
2017-07-06 15:42:24 -07:00
Pranav K 93875f973b Update version suffix for 2.0.0 RTM release 2017-07-06 15:08:44 -07:00
N. Taylor Mullen cb40da4e0f Rename ParseOnlyLeadingDirectives.
- Was renamed to `ParseLeadingDirectives`.

#1510
2017-07-06 14:34:15 -07:00
N. Taylor Mullen b68290ddb7 Make `RazorParserOptions` creation more like RazorEngine
- Removed verbose `Create` methods in favor of the `RazorParserOptionsBuilder`. This is similar to how the `RazorEngine` functions.
- Added a `CreateDesignTime` method.
- Updated existing tests to use new Create syntax.

#1510
2017-07-06 14:33:33 -07:00
N. Taylor Mullen 87a5435036 Make `RazorParserOptions.DesignTime` getter only.
- Renamed `IRazorParserOptionsFeature` to `IConfigureRazorParserOptionsFeature`, the original interface was re-purposed to get the options rather than configure them.
- This involved re-designing how we set design time on the `RazorParserOptions` object. The indicator of `DesignTime` is now configured at the RazorEngine level via a parser options provider feature.
- Moved options construction from the phase into an `IRazorParserOptionsFeature` type.

#1510
2017-07-06 14:33:05 -07:00
Ryan Brandenburg 17f97397e6 TreatWarningsAsErrors 2017-07-06 12:33:35 -07:00
Ajay Bhargav Baaskaran 11c5293862 Unnest IntermediateToken.TokenKind 2017-07-06 11:15:36 -07:00
Nate McMaster 03c92fe36b React to aspnet/BuildTools#293
[ci skip]
2017-07-06 10:40:22 -07:00
N. Taylor Mullen afa61e7080 Rename LineMapping => SourceMapping.
- Also removed the == and `!=` operators for `SourceMapping`.

#1510
2017-07-06 10:34:19 -07:00
N. Taylor Mullen a78202e937 Have `@page` understand malformed directives.
- The `@page` directive will now look for malformed directives and treat a view as a Razor page based on the existence of the malformed directive.
- Updated the `PageDirective` type to contain a reference to its responsible directive node.
- Added unit tests to validate malformed directives were picked up accordingly.
- Updated code generation test baselines to reflect the new malformed directive understanding.

#1448
2017-07-05 16:57:51 -07:00
Ryan Nowak 647ce7515d Remove explicit scope managment 2017-07-05 15:47:46 -07:00
Ryan Nowak 7408bcd025 Rewrite of code rendering context 2017-07-05 15:32:54 -07:00
Ryan Nowak 8dfba25d59 Streamline collections
Makes our collections sealed instead of abstract.

Only the IntermediateNodeCollection needs to have a read only variant.
2017-07-05 13:46:37 -07:00
N. Taylor Mullen d36838ed88 Handle imported @page directives.
- Prior to this imported `@page` directives would flow through the Razor system without error. This resulted in inconsistent behavior between MVC and Razor. Now, imported `@page` directives result in diagnostics on the page directive node.
- Added two tests to verify that we still treat views with imported page directives as Razor pages BUT we also log a diagnostic on the page directive node.
- Renamed the `ViewComponentDiagnosticFactory` class to `RazorExtensionsDiagnosticFactory` so it can be used for more than just view component diagnostics. This way we can ensure that our diagnostics don't end up overlapping.

#1503
2017-07-03 17:11:17 -07:00
Ryan Nowak 8a9bf9c71a Rewrite of code rendering context 2017-07-03 16:29:34 -07:00
Ryan Nowak 35889cba81 Add properties to the body node that it needs
Removes a usage of TagRenderingContext
2017-07-03 16:29:34 -07:00
Ryan Brandenburg ddef61485b DiagnosticSource to 4.4.1 2017-07-03 15:09:38 -07:00
Pranav K 8cb1a31385 Update LICENSE.txt text 2017-07-03 14:07:34 -07:00
N. Taylor Mullen 8090216dbe Make RequiredAttributeDescriptor IEquatable.
- All the other descriptors are already `IEquatable` this should be as well.
- Moved the required attribute descriptor comparer from Legacy => Language. It wasn't in the Legacy folder to begin with so this made sense given that it's already internal.

#1495
2017-07-03 11:23:51 -07:00
N. Taylor Mullen 4654997201 Add AllowedChildTagDescriptor.
- Changed the `AllowedChildTags` collection on `TagHelperDescriptor` to have a custom object type to represent child tags.
- Created comparers and builders to work with the child tag descriptor.
- Removed the validation methods on `TagHelperDescriptorBuilder` since there's no longer any bits to validate (they're contained within the sub-properties).
- Unit tested the `DisplayName`.

#1493
2017-07-03 11:04:10 -07:00
Ryan Nowak a7cc63d6e1 Simplification of IntermediateNode 2017-07-03 10:41:15 -07:00
Ryan Nowak 112cbc0bb6 Check for warnrings in tests taht compile
This fixes and issue that snuck through and broke MVC as well as
preventing this from happening in the future.
2017-07-01 11:52:41 -07:00
Ryan Nowak 7aeb228063 Redesign tag helper codegen 2017-06-30 17:34:01 -07:00
N. Taylor Mullen 2a6f0e4dc9 Productionize the csharp rendering context APIs.
- Rename `CSharpRenderingContext` => `CodeRenderingContext`.
- Rename `CSharpCodeWriter` => `CodeWriter`
- Rename `BasicWriter` => `IntermediateNodeWriter`
- Rename `...BasicWriter` => `...NodeWriter`
- Made `CodeRenderingContext` a public abstract API. Left temporary TagHelper pieces in the class since these will be removed soon.
- Moved several `CodeRenderingContext` methods into extension methods. These make use of the Items collection.
- Moved the reporting of missing code target extensions into the `ExtensionIntermediateNode`. This is the integration point of `CodeTarget`s and `CodeRenderingContext`s; therefore, it made more sense existing there.
- Left SetRenderChildren/SetRenderNode as extension methods due to how they're wired up. Aka, to create a `CodeTarget` you need a `CodeRenderingContext`... To Create a `DocumentWriter` you need a `CodeTarget`... To set the render methods on the context you need a `DocumentWriter`.
- Updated tests to utilize the new code renering constructs.
- Moved code generation testability features from `CSharpLoweringPhase` to the `CodeRenderingContext.Items`.

#1043
2017-06-30 16:35:53 -07:00
Ryan Brandenburg f5c55727a4 Remove AssetTargetFallback 2017-06-30 14:42:00 -07:00
Ajay Bhargav Baaskaran 9c031e6fb5 Moved all TagHelperDescriptor related builders to have getter setter
instead of methods

More polish to the tag helper descriptor builders.
- Expose underlying builders as getter only list
- Added AsDictionary() extension method to BoundAttributeDescriptorBuilder
- Expose diagnostics as RazorDiagnosticCollection
- Got rid of Require** prefix in TagMatchingRuleBuilder
- Workaround issue aspnet/Razor#1492 by copying the test descriptor
  extensions
2017-06-30 14:08:05 -07:00
Pranav K 4db7f2eb6d Update to Roslyn 2.3.0-beta3 version 2017-06-30 11:35:59 -07:00
Ajay Bhargav Baaskaran 34e3c249e4 Remove Test.Common dependency from LanguageServices.Razor.Test 2017-06-30 10:42:24 -07:00
Ajay Bhargav Baaskaran 7c7bb627b9 Moved typename and propertyname to extension methods 2017-06-29 16:47:53 -07:00
Pranav K 413c1c919f Update to StreamRpc 1.1.92 2017-06-29 12:21:07 -07:00
Ajay Bhargav Baaskaran 36fbb532cd Merge branch 'ajbaaska/th-node' into dev 2017-06-29 12:06:14 -07:00
Ajay Bhargav Baaskaran bcf790b9d5 Added convenience properties to TagHelperIntermediateNode 2017-06-29 12:05:42 -07:00