Commit Graph

32 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran f9d4fba39d Added a taghelpers and imports overload to Process and ProcessDesignTime
We want to have a way to specify the taghelper descriptors and imports to use while
processing a specific document.
- Added an overload to Process and ProcessDesignTime to take in a list
TagHelperDescriptors and a list of imports
- Added the corresponding CreateCodeDocumentCore overload
- Added GetTagHelpers and SetTagHelpers extension methods for
CodeDocument
- Added the necessary plumbing to use the taghelpers from the
CodeDocument when available and fallback logic.
- Added DocumentImportsTracker and updated background code generation
logic to use the new overload
- Added/updated tests
2018-05-22 11:40:21 -07:00
Ajay Bhargav Baaskaran f8dc5c4702 Obsoleted IRazorEngineBuilder APIs 2018-04-13 12:35:53 -07:00
Ryan Nowak d1c0ab587c Add support for type parameters to class nodes
This change will allow someone extending Razor to use generic type
parameters in generated classes.

There's no user-level extensibility provided here yet, as in there is no
language support for adding type parameters.
2018-04-05 15:26:42 -07:00
Nate McMaster 13824c418e Catch 15.7 up with dev
This change integrates most of the non-breaking work that we did in 2.1
including the updates to make Razor less coupled to MVC.
2018-02-19 10:46:16 -08:00
Ajay Bhargav Baaskaran bd8e9ecc31 Added RazorParserFeatureFlags and added support for minimized bool tag
helper bound attributes
 - Fixes #1678, #431
2017-09-29 16:02:09 -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 afa61e7080 Rename LineMapping => SourceMapping.
- Also removed the == and `!=` operators for `SourceMapping`.

#1510
2017-07-06 10:34:19 -07:00
Ryan Nowak 7aeb228063 Redesign tag helper codegen 2017-06-30 17:34:01 -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
Ryan Nowak a580c8fdf1 Get rid of AccessModifiers 2017-06-21 19:10:57 -07:00
Ryan Nowak 21e26ad4aa Rename RazorIRNode
Get rid of references to 'IR'
2017-06-21 12:55:16 -07:00
Ryan Nowak 22d52f2a3c Split the functions/section/inherits directives 2017-06-13 18:05:34 -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 a6d2c04195 [Fixes #1379] Rename CSharpStatement to CSharpCode 2017-06-07 15:20:47 -07:00
N. Taylor Mullen ebe8ab4612 Rename TagHelperBoundAttributeDescriptorBuilder => BoundAttributeDescriptorBuilder.
#1369
2017-05-19 12:44:07 -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 657c2a8da3 Merge branch 'rel/15.3' into dev
# Conflicts:
#	test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs
2017-05-17 11:24:32 -07:00
Ajay Bhargav Baaskaran 7bd13061b5 Set the chunk generator of non-string tag helper attributes to ExpressionChunkGenerator 2017-05-17 11:17:01 -07:00
N. Taylor Mullen 19f895b9ad Validate line mappings for integration tests in Razor.Extensions.
- Split line mapping validation into its own method.
- Prior to this we were calling the wrong method in our design time code generation integration tests within the Razor.Extensions test project.
- Re-generated line mapping baselines to conform with the cshtml files for Razor.extensions code generation integration tests.

#1351
2017-05-17 10:20:36 -07:00
Ryan Brandenburg b96a486650 Compile CodeGeneration tests 2017-05-16 16:26:47 -07:00
N. Taylor Mullen 3830a1b7ac Rename the BoundAttributeDescriptor builder.
- ITagHelperBoundAttributeDescriptor => TagHelperBoundAttributeDescriptorBuilder

#1306
2017-05-12 17:39:45 -07:00
Ryan Nowak 86d045c667 Fix #1305 move instrumentation to MVC 2017-05-12 16:14:17 -07:00
Ryan Nowak b17e506ce8 Some API cleanup around directivest 2017-05-12 13:27:28 -07:00
Ryan Nowak a570139b08 Fix #1059 and #1060 2017-05-08 12:30:19 -07:00
Ajay Bhargav Baaskaran c71f6e7c3f [Fixes #1058] Added a test to verify nested enum behavior 2017-05-05 11:50:31 -07:00
N. Taylor Mullen 0e509b4bbb Add incomplete directive integration tests.
- These tests validate that our extensible directives do not have code that explodes when an incomplete directive is encountered. This is typically the case when a user is in the midst of typing a directive at design time.
- Added an extensions test and a language test.

#1271
2017-05-01 14:32:17 -07:00
N. Taylor Mullen 1696e2aebf Upgrade Razor's Roslyn dependency to 2.0.0.
- Added C# 7 test to validate questionable features work end-to-end.
- Had to add several explicit package references to let our VS specific packages work as expected.

#1046
2017-04-21 11:40:21 -07:00
N. Taylor Mullen 1b8a4e704c Rename ITagHelperDescriptorBuilder => TagHelperDescriptorBuilder.
#1210
2017-04-11 17:08:38 -07:00
Ryan Nowak 207f40f92d Move test infrastructure
This moves the test infrastructure to a common project and udpates the MVC
tests to use the good integration testing features.
2017-04-10 19:42: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