Commit Graph

47 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran b70815e317 Made `RazorCodeGenerationOptionsBuilder.DesignTime` getter only
- Made RazorCodeGenerationOptions consistent with RazorParserOptions
2017-07-07 14:41:53 -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 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
Ajay Bhargav Baaskaran 11c5293862 Unnest IntermediateToken.TokenKind 2017-07-06 11:15:36 -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
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
Ryan Nowak 8a9bf9c71a Rewrite of code rendering context 2017-07-03 16:29:34 -07:00
Ryan Nowak a7cc63d6e1 Simplification of IntermediateNode 2017-07-03 10:41:15 -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
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
Ryan Nowak 853b458893 This is a different take on Taylor's builders.
This makes it possible to use another 'kind' of tag helpers, which isn't
possible today.

This also further decouples the tag helper api surface from the default
implementation.

VCTH now have their own 'kind'.

Also improved generation of display names and error messages where it
was coupled to the type name.
2017-06-28 17:37:52 -07:00
Ajay Bhargav Baaskaran d73ecf8b36 Suppress warnings for auto generated code 2017-06-26 17:35:11 -07:00
Ryan Nowak e3b3e20738 Move some stuff to .Extensions
Moved design time directives and tag helper attribute preallocation to
.Extensions.

Just mechanical namespace changes here.
2017-06-21 20:26:31 -07:00
Ryan Nowak 7a234ca513 Rename UsingStatement>UsingDirective 2017-06-21 19:54:40 -07:00
Ryan Nowak a580c8fdf1 Get rid of AccessModifiers 2017-06-21 19:10:57 -07:00
Ryan Nowak a40ca857c5 Rename HtmlAttributeValueStyle>AttributeStructure 2017-06-21 18:56:37 -07:00
Ajay Bhargav Baaskaran 4811807329 Moved CSharpCodeWriter out of legacy 2017-06-21 15:05:46 -07:00
Ryan Nowak 21e26ad4aa Rename RazorIRNode
Get rid of references to 'IR'
2017-06-21 12:55:16 -07:00
Ryan Nowak d2469e078a Move Source down to ExtensionIRNode 2017-06-20 23:19:55 -07:00
Ajay Bhargav Baaskaran dd4e163173 Change GenerateChecksum to SuppressChecksum 2017-06-19 16:52:36 -07:00
Ajay Bhargav Baaskaran 3892a6fede Removed ChecksumIRNode 2017-06-16 11:14:54 -07:00
Ajay Bhargav Baaskaran 27ac5da6d5 Add indexer null-check for preallocated tag helper attributes 2017-06-13 10:53:07 -07:00
Ryan Nowak 6860806213 Make usage of FileName and FilePath consistent
FileName => "Foo.cshtml"
FilePath => "/Bar/Baz/Foo.cshtml"
2017-06-12 16:15:26 -07:00
Ajay Bhargav Baaskaran f099232ca4 Moved scope writer logic to BasicWriter 2017-06-09 12:10:00 -07:00
Ryan Nowak 503ba669d0 Get rid of Parent from IR node 2017-06-08 19:22:14 -07:00
Ryan Nowak 14944a2791 Add collection types for IR children 2017-06-08 17:18:15 -07:00
Ajay Bhargav Baaskaran a6d2c04195 [Fixes #1379] Rename CSharpStatement to CSharpCode 2017-06-07 15:20:47 -07:00
Ajay Bhargav Baaskaran 2f03a39e41 Refactored attribute values IR 2017-05-26 12:34:34 -07:00
Ajay Bhargav Baaskaran 1efcdafa45 Removed ExecuteTagHelpersIRNode 2017-05-22 11:03:34 -07:00
N. Taylor Mullen ebe8ab4612 Rename TagHelperBoundAttributeDescriptorBuilder => BoundAttributeDescriptorBuilder.
#1369
2017-05-19 12:44:07 -07:00
Ryan Nowak e391ac7a3c Split options into ParserOptions and CodeGenerationOptions 2017-05-18 10:22:39 -07:00
Ryan Nowak 811ea019a5 Fixes #1245 - Make TemplateCodeExtension public
This removes the hardcoding of an MVC type from Razor.
2017-05-17 20:25:06 -07:00
N. Taylor Mullen b8ea008151 Make extensible directive type token rendering allow value types.
- Instead of rendering a null assigning statement for a type token we now render a `default(TTypeToken)`. With this approach type tokens can be value types without creating a design time error.
- Re-generated baseline files to reflect new directive token code generation.

#1176
2017-05-17 10:31:16 -07:00
Ryan Nowak fd3a34b000 Remove RazorIRBuilder.Document 2017-05-12 18:12:30 -07:00
N. Taylor Mullen 3830a1b7ac Rename the BoundAttributeDescriptor builder.
- ITagHelperBoundAttributeDescriptor => TagHelperBoundAttributeDescriptorBuilder

#1306
2017-05-12 17:39:45 -07:00
Ajay Bhargav Baaskaran 8cf7d248e7 [Issue #1318] Renamed RuntimeTarget to CodeTarget 2017-05-12 16:32:55 -07:00
Ryan Nowak b17e506ce8 Some API cleanup around directivest 2017-05-12 13:27:28 -07:00
Ajay Bhargav Baaskaran b44d59ca36 Remove Redirect writers 2017-05-11 15:38:54 -07:00
Ryan Nowak d3e37f20ce Add some new IR nodes
This adds the basics of a few new node types. I'll do a follow up to start
using these so we can eliminate some misuse of the statement node.
2017-05-11 14:52:31 -07:00
Ryan Nowak 2afe2e1627 Rename RazorMethodDeclaration -> MethodDeclaration 2017-05-11 10:22:45 -07:00
Ajay Bhargav Baaskaran 52c4abee9b Fix build break 2017-04-21 13:38:39 -07:00
Ajay Bhargav Baaskaran 4e2cd0c2d6 Finish writer implementation of the remaining IR nodes and added tests
- SetTagHelperPropertyIRNode
- ChecksumIRNode
- UsingStatementIRNode
- Preallocated attributes target extension
- HtmlAttributeIRNode and friends
- Design time directive helper target extension
- Removed renderers and rendering conventions
- Regenerated IR baselines
Issue - #846 and #1051
2017-04-21 11:46:34 -07:00
Ajay Bhargav Baaskaran 0b17f14d68 Moved AddTagHelperHtmlAttribute from renderer to writer 2017-04-14 11:49:56 -07:00
Ajay Bhargav Baaskaran 0f7b0f5d8c [Fixes #1196] Remove Content property from HtmlContentIRNode 2017-04-10 12:54:11 -07:00
N. Taylor Mullen 0618bae3bd Rename Microsoft.AspNetCore.Razor.Evolution => Microsoft.AspNetCore.Razor.Language.
- Also updated corresponding test project to go from Evolution => Language.
- Regenerated test files to reflect new file paths.

#1169
2017-04-10 10:20:04 -07:00