Commit Graph

52 Commits

Author SHA1 Message Date
N. Taylor Mullen 2d20063ba5 Remove layout directive.
- Removed all instances of the layout directive from src and test projects.

#359
2015-04-27 14:48:53 -07:00
N. Taylor Mullen 7d7b2795e1 Change tests to utilize Environment.NewLine.
- Normalized newlines for code generation tests. We default all tests to use \r\n. This way we can have a consistent test experience cross plat.
- For tests that expected indexes that were affected by new lines I modified them to account for cross plat scenarios.
- Added a few test classes to ensure we could normalize newlines for codegen tests.

#106
2015-04-03 23:50:21 -07:00
Doug Bunting 33407ef1be Enforce new invariants around HTML encoding
- #335
- bound `string` attribute values are _not_ encoded
 - rework `CSharpCodeVisitor` and `CSharpTagHelperCodeRenderer` to enable this case
- values in `TagHelperOutput.Attributes` are encoded unless special-cased elsewhere
 - `Dictionary<string, object>` type allows `RazorPage` to use `HtmlString`
- wrap HTML unbound attribute values using `Html.Raw()`
2015-03-30 11:09:26 -07:00
N. Taylor Mullen 2b6220205d Updated duplicate TargetElement TagHelper tests.
#326
2015-03-20 00:20:36 -07:00
N. Taylor Mullen 842549bba9 De-dupe TagHelperDescriptors based on Type for rendering.
- This can occur if you have multiple [TargetElement] attributes that overlap. Ultimately the descriptor is the same because its the same type, just the required attributes differ.
- Added tests to validate.

#326
2015-03-19 22:46:49 -07:00
Ajay Bhargav Baaskaran fa40fe6e46 Fix build break 2015-03-19 16:16:18 -07:00
Ajay Bhargav Baaskaran 7b468344c0 [Fixes #169] Await TagHelper generated objects 2015-03-19 16:08:07 -07:00
N. Taylor Mullen 4345b06e88 Add tests to validate TagHelper attribute targeting.
- Added tests to validate TargetElementAttribute, TagHelperDescriptorFactory, CSharpTagHelperCodeRenderer and TagHelperParseTreeRewriterTests.
- Renamed HtmlElementNameAttributeTest to TargetElementAttributeTest.

#311
2015-03-17 21:48:54 -07:00
Ajay Bhargav Baaskaran b3c60976a4 Removed @helper directive 2015-03-17 13:54:37 -07:00
sornaks 7daec14e49 Issue #318: Removing Generate*() methods. 2015-03-17 13:15:03 -07:00
sornaks bd9d57d33e Introducing buffering in TagHelperOutput.PreContent, Content, PostContent. 2015-03-04 12:56:13 -08:00
Ajay Bhargav Baaskaran 7ecce1b666 Replaced WebUtility.HtmlEncode with IHtmlEncoder.HtmlEncode 2015-03-03 11:32:05 -08:00
N. Taylor Mullen 4bd02badda Add tests to verify tagHelperPrefix directive.
- Added parsing, sub-rewriting, rewriting and code generation tests for runtime/designtime.
- Fixed existing tests to utilize new class structures.

#309
2015-03-02 17:07:07 -08:00
Youngjune Hong 23e6264715 Fix1571 - Supporting self-closing tags for taghelpers 2015-02-20 16:27:31 -08:00
N. Taylor Mullen f53b6bb0e3 Change '?' in add and remove TagHelper to mean 1 character.
- Modified tests to account for new behavior of the '?' character in @addtaghelper and @removetaghelper.

#297
2015-02-16 18:59:20 -08:00
Doug Bunting fbe331c1ab Camel-case tag helper directives
- #264
2015-02-13 15:10:37 -08:00
N. Taylor Mullen cf3d049272 Add tests to validate TagHelper escape functionality.
- Added extensive unit tests.
- Added functional test to validate output for runtime and design time.

#187
2015-02-03 14:34:47 -08:00
N. Taylor Mullen 32f0858e8f Add tests for @addtaghelper and @removetaghelper wildcard ability.
- Also added tests to ensure cases of @addtaghelper "MyAssemblyName" create an error.
- Regenerated all CS files to folow new format.

#285
2015-02-03 12:16:01 -08:00
N. Taylor Mullen 7afd78b36a Fix empty attribute projections for TagHelpers.
- Added TagHelperParseTreeRewriter tests, attempted to cover all empty attribute edge cases.
- Added Codegen tests to validate output and DesignTimeLineMappings.

#271
2015-02-02 15:49:08 -08:00
N. Taylor Mullen a658c1336f Added CodeGen for TagHelper content mode redesign.
- Modified the CSharpTagHelperCodeRenderer to understand a single line of TagHelper rendering (instead of doing different things based on ContentBehavior).
- Modified existing CodeGen output to reflect new content changes.

#221
2015-01-16 11:51:02 -08:00
N. Taylor Mullen c38761f504 Remove ContentBehavior.
- Removed all tests and instances of ContentBehavior in preparation for moving to a non-ContentBehavior based design.
- Removed ContentBehavior specific CodeGeneration.

#221
2015-01-16 11:34:45 -08:00
Doug Bunting de4cafa8cd Handle complex expressions for bound non-string tag helper attributes
- #129 and support aspnet/Mvc#1253
- add new `CSharpTagHelperAttributeValueVisitor` that writes the raw expression
- add tests of embedded `@(...)` and mix that with normal expressions
- add new resources for errors in `CSharpTagHelperAttributeValueVisitor`
 - write errors using `ParserErrorSink`
- update baselines to match new code generation

nits:
- cleanup long lines in `CSharpTagHelperCodeRenderer`
- remove a few unused resources
2015-01-15 16:32:16 -08:00
N. Taylor Mullen 2d2c2cdf0f Add warning disable for unused variable warnings for TagHelper fields.
- Added a 0414 warning disable/restore around the __tagHelperStringValueBuffer since it's the only TagHelper utility field that "may" never be used.
- Regenerated baselines for TagHelper test files.

#260
2015-01-13 14:44:22 -08:00
DamianEdwards 7890a1b34c Added TagHelperContext.UniqueId:
- The ID is created at view compilation time and is unique per TagHelperExecutionContext and thus per HTML element in the source for which Tag Helpers will run
- #241
2014-12-12 16:25:42 -08:00
N. Taylor Mullen 54155e47e5 Add DesignTime code generation support for TagHelpers.
- We now generate a subset of the TagHelper runtime code during DesignTime. This enables users to see errors in the editor
- Added tests to validate design time code generation.
- Refactored runtime code generation tests (we now use a lot of their infrastructure for the design time pieces).

#208
2014-11-07 10:57:50 -08:00
N. Taylor Mullen 7ab25918e0 Add tests to validate @removetaghelper functionality.
- Added utility methods to construct valid SyntaxTreeNodes that represent the @removetaghelper directive.
- Added parse level unit tests to validate the @removetaghelper generates an accurate SyntaxTreeNode.
- Added parse level unit tests to validate the @removetaghelper throws with bad formats.
- Added TagHelperRegistration unit tests to validate the AddOrRemoveTagHelperCodeGenerators are understood and affect the descriptors found.
- Added Designtime mapping tests to validate correct source mappings are made to ensure proper coloring and lack-of C# intellisense.
- Added end-to-end tests to validate @removetaghelper can essentially disable TagHelpers on a page.

#112
2014-10-29 11:31:00 -07:00
Pranav K a2a05e7153 Modify CSharpCodeWriter to generate async lambdas for section
Fixes #85
2014-10-13 17:00:38 -07:00
N. Taylor Mullen 7db4ed7f7e Add tests to validate @addtaghelper directive.
- Fixed existing tests to work with new RazorParser.
- Validated directive syntax tree creation, errors and code generation.

#111
2014-10-09 12:57:46 -07:00
NTaylorMullen 05d8193775 Add test for TagHelperAttributeValueCodeRenderer extensibility.
- Tested that we can successfully plugin our own TagHelperAttributeValueCodeRenderer.
- Moved some existing TagHelper test logic into its own base type to enhance code reusability.

#119
2014-10-09 12:57:40 -07:00
N. Taylor Mullen c3b51cbbdf Add code generation tests for tag helpers.
#72
2014-10-09 12:57:34 -07:00
Pranav K 83da8e257d Generate code for expressions in design time to enable intellisense
Fixes #80
2014-10-08 09:53:27 -07:00
Pranav K f913d8929f Updating CSharpCodeVisitor to generate implicit expressions on a single
line

Fixing 151
2014-10-01 17:20:00 -07:00
Pranav K 5369842384 Ensure pragma checksum is prepended to generated file
Fixes #160
2014-09-29 14:45:26 -07:00
Pranav K 11ee402eec Reviving support for instrumentation in CSharpCodeVisitor
Fixes #42
2014-09-22 17:59:29 -07:00
N. Taylor Mullen 9bd2fdecac Modified tests to account for await accepting dots.
#45
2014-05-15 10:52:01 -07:00
N. Taylor Mullen 662dc087bd Addressed code review comments.
#28
2014-05-09 14:49:02 -07:00
N. Taylor Mullen 32f6f4df00 Modify tests to account for new generated output.
Added pragma warning disable 1998 to surrounded generated execute method.

#28
2014-05-09 11:09:45 -07:00
N. Taylor Mullen 20c91146f1 Remove copyright header from generated test files. 2014-05-09 11:08:22 -07:00
N. Taylor Mullen 570760ddc7 Modified tests to account for new code generation.
#30
2014-05-09 11:06:30 -07:00
Andrew Peters 477141564f Updating copyright headers 2014-05-08 23:01:26 -07:00
anpete 6c2130239f Update file headers 2014-05-01 17:40:52 -07:00
Pranav K 9c4a6e901d Modifying DefineSection to generate HelperResult types 2014-04-01 18:32:37 -07:00
N. Taylor Mullen 4cfef3c6d1 Add tests to verify flexibility of await keyword.
Added sample files to evaluate accuracy of generated code for the await keyword.  Also added a line mapping test to ensure that we're mapping the keyword correctly.
2014-03-18 12:37:16 -07:00
N. Taylor Mullen aef8a79081 Update tests to verify async rendering.
Also changed naming of the CreateBuilder method in the Razor language to CreateCodeBuilder.
2014-03-17 11:29:19 -07:00
N. Taylor Mullen 6ea8d7721b Re-applied code review changes for formatting fix.
The previous fix was accidentally overridden.  Also changed how we
render chunk block's children.  New way avoids casts and removes logic
from base.
2014-03-05 11:24:06 -08:00
N. Taylor Mullen b6082d1523 Modify tests to account for no indent helpers.
Modified outputs of generated files to not indent helpers.  Also fixed LineMapping verifications.
2014-03-04 12:05:59 -08:00
N. Taylor Mullen f5759635b1 Modify tests to account for no indent helpers.
Modified outputs of generated files to not indent helpers.  Also fixed LineMapping verifications.
2014-02-26 11:12:12 -08:00
N. Taylor Mullen f43a17369c Transition tests to use new CodeTree.
Previously they would use CodeDOM dependent concepts.
2014-02-13 15:03:19 -08:00
N. Taylor Mullen d85927166b Remove unneeded chunk data.
Instead lets keep utilizing the Context's state to properly generate a C# file.
2014-02-10 11:49:49 -08:00
N. Taylor Mullen 3a214ab213 ifdef all of the razor bits that are reliant on non-coreclr bits.
Big thing we're missing is Char.GetUnicodeCategory(...) and Thread.Yield.  Tried to do my best to fill in the blanks.  Ripped out VB.
2014-01-27 18:52:02 -08:00