Commit Graph

231 Commits

Author SHA1 Message Date
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 94230a5a14 Add TagHelper parse level opt-out character '!'.
- Added the ability to opt-out of TagHelper parsing by adding a '!' to the beginning of a tag name.
- Modified parsing logic to allow bangs in tags.
- Bangs in tags are removed from output always and are handled as meta code.

#187
2015-02-03 14:25:30 -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 a78ed663d0 Add ability for wildcards in @addtaghelper and @removetaghelper.
- @addtaghelper and @removetaghelper can now utilize the '*' wild card to represent 0 or more characters.
- Restricted the @addtaghelper to need the TypeName. @addtaghelper "MyAssemblyName" => @addtaghelper "*, MyAssemblyName".

#285
2015-02-03 12:15:56 -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
Wei Wang efab52c082 Merge remote-tracking branch 'origin/release' into dev 2015-01-29 16:31:51 -08:00
Pranav K 37433056be Fixing NuGet.config 2015-01-28 23:15:50 -08:00
Wei Wang 211dc7d9d8 Change SKIP_DOTNET_INSTALL to SKIP_KRE_INSTALL 2015-01-28 18:27:12 -08:00
Wei Wang 7ae470539f Update build.cmd and build.sh to use kvm 2015-01-28 18:26:45 -08:00
Wei Wang ba387a3a22 Merge branch 'release' of github.com:aspnet/Razor into release 2015-01-28 18:25:49 -08:00
N. Taylor Mullen a0574fb9be Add tests for TagHelper order control.
- Tested runtime run execution order control.

#94
2015-01-27 20:11:44 -08:00
NTaylorMullen 53d60159f9 Add order property to control TagHelper execution order.
- Added order property to the ITagHelper class. Lower values indicates higher execution priority.

#94
2015-01-27 20:11:42 -08:00
Aligned c789ff1eb5 Update README.md 2015-01-22 10:56:48 -08:00
Suhas Joshi 2b41e374ff Merge branch 'release' into dev 2015-01-21 15:50:10 -08:00
Suhas Joshi a0440ff918 Updating to release NuGet.config 2015-01-21 15:50:08 -08:00
Wei Wang 1bb8dc0aff Rename SKIP_KRE_INSTALL to SKIP_DOTNET_INSTALL 2015-01-20 18:31:35 -08:00
Suhas Joshi 825823fd4c Updating NuGet.config 2015-01-20 17:23:41 -08:00
Pranav K 26a193ca62 Updating build.cmd and build.sh to use dotnetsdk 2015-01-20 01:36:30 -08:00
Pranav K 529670d9a3 Updating build.cmd and build.sh to use dotnetsdk 2015-01-20 01:32:32 -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 0eb614b027 Modify tests to allow new content mode design for runtime components.
- Added a new internal ctor for TagHelperExecutionContext since it's used in multiple tests to allow for less friction testing.

#221
2015-01-16 11:34:47 -08:00
N. Taylor Mullen 1ef8c088d1 Re-design TagHelperOutput and runtime dependencies to allow all content modes.
- Added PreContent, PostContent and ContentSet properties to TagHelperOutput.
- Added GeneratePreContent, GeneratePostContent and SupressOutput methods to TagHelperOutput.
- Added multile ExecuteChildContentAsync and GetChildContentAsync to the rendering phase, ultimately only exposing GetChildContentAsync to a TagHelper author.
- Added more knowledge of StartWritingScope and EndWritingScope to the TagHelper runtime components. This is to enable the runtime components to utilize the RazorPage's infrastructure to render a delegate to a writer and retrieve its value to ultimately expose it to the user.

#221
2015-01-16 11:34:46 -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
Doug Bunting 7b8126367c Minor: `LineMapping` and `MappingLocation` debug visualizations were types' full names
- add `ToString()` overrides for these classes

Nits:
- improve assertion failures about code mapping mismatches
- add `GENERATE_BASELINES` reminder to test project.json
2015-01-15 16:32:06 -08:00
Doug Bunting 26afdbd889 Plumb `ParserErrorSink` through to `CodeBuilderContext`
- precursor for #129
- remove unused `GeneratorResults` ctor to avoid duplicating `ParserResults` code

nit: make a few `ParserResults` properties immutable
- also change `ParserErrors` type to `IEnumerable<RazorError>`
2015-01-15 16:31:33 -08:00
N. Taylor Mullen 8c47f6a67e Modify tests to account for new tag and attribute names for TagHelpers.
- Also added additional tests to validate new lower kebab casing.

#240
2015-01-13 22:51:20 -08:00
N. Taylor Mullen 2ad828f5bc Change TagHelper tag and attribute names to be lower kebab cased.
- Lower kebab casing is the HTML convention.

#240
2015-01-13 22:51:19 -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
Ajay Bhargav Baaskaran ff3ddfcc53 removed SessionState directive 2014-12-29 14:56:20 -08:00
Ajay Bhargav Baaskaran 891dfa5e3e renamed TagNameAttribute to HtmlElementNameAttribute 2014-12-29 10:50:27 -08:00
N. Taylor Mullen e30e74dc5a Handle unclosed and invalid structure HTML tags for TagHelpers.
- Added detection of unclosed tags (tags without begin/end).
- Added recovery of potentially unclosed tags.
- Added detection of invalid structure tags (tags that do not end with '>').
- Modified detection of bad attribute values to be parse errors instead of runtime errors.
- Modified RazorParser to sort errors. This made writing tests more intuitive and ultimately ensures that the editor shows errors in the correct order.
- Added tests to validate invalid tag structure.
- Added tests to validate invalid attributes.
- Added tests to validate unclosed tags.

#104
2014-12-22 14:28:35 -08:00
N. Taylor Mullen a86b0dca3e Add line mappings to project TagHelper attribute values.
- We now create LineMappings for instances where a TagHelper's attribute value is not of a string type.
- This will enable the Razor editor to create projections from .cshtml => .cs for TagHelper attributes.
- Modified the TagHelperCodeGenerator and TagHelperBlockBuiler to accurately track the attribute values start locations so it could flow into code generation.
- Modified existing tests to account for the new line mappings.

#207
2014-12-19 17:26:33 -08:00
Ryan Nowak ceaf257cd5 Update Razor to use official xunit runner 2014-12-16 12:05:53 -08:00
Pranav K 67e8e8b421 Reacting to System.Threading version changes 2014-12-15 14:49:19 -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 170b7a76fd Expose TagHelperDescriptors on TagHelperBlock.
- This will enable tooling to determine which descriptors are relevant to which TagHelperBlocks in the syntax tree.
2014-12-11 14:19:01 -08:00
N. Taylor Mullen c680833350 Expose GetExportedTypes on TagHelperTypeResolver.
- This will enable tooling to provide their own mechanism for resolving assemblies.
2014-12-09 12:39:02 -08:00
Suhas Joshi 6d2fb23f7d Updating to dev NuGet.config 2014-12-08 15:24:47 -08:00
Suhas Joshi b94ea56b72 Updating to release NuGet.config 2014-12-08 15:14:47 -08:00
N. Taylor Mullen c2fae3b6fc Change TagHelperDescriptor to 1 ctor so it can be deserialized.
Made existing ctor that was only ever used in Razor tests to be internal.
2014-12-05 15:08:39 -08:00
N. Taylor Mullen cc0d5dd324 Add found TagHelperDescriptors on a Razor page to GeneratorResults.
- Ultimately this enables tooling to inspect what TagHelperDescriptors were found on a document and construct HTML schema based off of them.
- Added XML doc on the classes I touched that didn't have docs.
- Added [NotNull] to the result construct parameters.
- Added tests to validate that TagHelperDescriptors flow when found after parsing a Razor document.

#215
2014-12-05 14:53:06 -08:00
Doug Bunting 06a2f72bb3 Address #236, recreate XML files when xml-docs-test target is run directly
- must still `build initialize` between `git clean` and `build xml-docs-test`

nit: add description of xml-docs-test target
2014-11-30 21:34:02 -08:00
Victor Hurdugaci 810146115b Add schema version to kproj files 2014-11-25 11:00:49 -08:00
NTaylorMullen c947e9ffaa Changed TagHelper attributes to be SpanKind.Code if not string typed.
- Also added tests to validate that non string TagHelper attributes inherit the SpanKind.COde behavior.
- Removed a block wrapping around single markup spans.
2014-11-24 11:21:20 -08:00
N. Taylor Mullen 0d60da296d Add and modify tests to validate TagHelperDescriptorResolver doesn't throw.
- Modified existing tests that expected the resolvers to throw to no longer throw.
- Added new test to validate that unexpected errors that are thrown are also handled.

#210
2014-11-24 10:30:11 -08:00
N. Taylor Mullen ed9c432889 Modify TagHelperDescriptorResolver and dependencies to not throw.
- Changed the TagHelperDescriptorResolver, TagHelperTypeResolver and AddOrRemoveTagHelperSpanVisitor to not throw when they're unable to understand the users directive lookup text.
- This involved utilizing the new ParserErrorSink to capture errors found during TagHelperDescriptor resolution.

#210
2014-11-24 10:30:01 -08:00
Doug Bunting a477bd5cb1 Add missing license headers
- #EngineeringDay
- skip generated files such as Resources.Designer.cs and files under
  test\Microsoft.AspNet.Razor.Test\TestFiles\CodeGenerator\CS\Output
2014-11-20 23:17:48 -08:00
Doug Bunting 8f81007517 Add xml-docs-test target to end of default build
- #EngineeringDay
- correct a couple of XML doc issues in the repo
2014-11-20 15:24:49 -08:00
Doug Bunting 26034fb5b2 Apply VS' FormatDocument and RemoveAndSort to all *.cs files
- #EngineeringDay

Did not change any files under test/Microsoft.AspNet.Razor.Test/TestFiles
- avoiding need to redo hashes
2014-11-20 14:43:16 -08:00