Commit Graph

207 Commits

Author SHA1 Message Date
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
Doug Bunting 0f724a51df Delete trailing whitespace
- #EngineeringDay
- Total replaced: 506  Matching files: 118

Did not change any files under test/Microsoft.AspNet.Razor.Test/TestFiles
- avoiding need to redo hashes
2014-11-20 14:16:32 -08:00
N. Taylor Mullen 15348b0468 Refactored error handling mechanisms for parsing.
- This is needed to make passing error handling devices into more pieces of the parser easy.

#210
2014-11-20 10:59:09 -08:00
N. Taylor Mullen 62e07305cf Add hook to add TagHelperDirectiveDescriptors.
- Also added a test to validate that you can hook into the TagHelperDescriptorResolutionContext.

#214
2014-11-20 10:44:03 -08:00
N. Taylor Mullen c67ec264ed Modify tests to use new ITagHelperDescriptorResolver signature.
- Updated all of the tests to use the new ITagHelperDescriptorResolver signature so instead of passing strings they now construct TagHelperDescriptorResolutionContexts.
- Removed several tests from the AddOrRemoveTagHelperSpanVisitorTests. This was due to the change in responsibility of managing the found TagHelperDescriptors; the TagHelperDescriptorResolver now does this.
- Added several new tests to verify the TagHelperDescriptorResolver manages resolved TagHelperDescriptors based on the given TagHelperDirectiveDescriptors.

#214
2014-11-20 10:42:55 -08:00
N. Taylor Mullen c35d19142c Add ability to resolve all TagHelperDescriptors with one method call.
- Modified the AddOrRemoveTagHelperSpanVisitor to no longer manage TagHelperDescriptors found in the system. Instead it now manages TagHelperDirectiveDescriptors which are then used to resolve TagHelperDescriptors.
- Changed the signature of ITagHelperDescriptorResolver to take in a TagHelperResolutionContext which will allow us to pass more information without breaking tooling.
- TagHelperDescriptorResolver now resolves all TagHelperDescriptors at once and manages descriptors found in the system based on values on the provided TagHelperDirectiveDescriptors.

#214
2014-11-20 10:42:46 -08:00
N. Taylor Mullen 64a5b8ee22 Addressed code review comments. 2014-11-19 10:07:33 -08:00
N. Taylor Mullen bad8b16a2a Add extensibility point to resolve descriptors in assembly.
- Modified our default TagHelperDescriptorResolver to provide a protected virtual method that it uses under the covers to resolve descriptors for an entire assembly. This will enable tooling to cache descriptors on a per-assembly basis.

#214
2014-11-14 10:45:19 -08:00
N. Taylor Mullen 829faaaa4b Change TagHelperAttributeDescriptor to not depend on PropertyInfo.
- Right now the only information that is used from the PropertyInfo is the PropertyName and the PropertyType, therefore changed the PropertyInfo property on TagHelperAttributeDescriptor to be AttributeTypeName since we already had an accessor for AttributePropertyName.
- Modified test comparers to validate type names.

#214
2014-11-14 10:45:14 -08:00
N. Taylor Mullen 2200f7dc3a Add AssemblyName to TagHelperDescriptor.
- TagHelperDescriptor's need a way to showcase where they came from so tooling can reverse look them up.
- Update tests to specify TagHelperDescriptor assembly names.

#214
2014-11-14 10:45:08 -08:00
N. Taylor Mullen 8d4bdbdb84 Allow invalid HTML to be in Razor pages.
- Modified the TagHelperParseTreeRewriter to not remove invalid HTML snippets.
- Added tests to validate invalid HTML is allowed.

#212
2014-11-14 10:30:51 -08:00
Victor Hurdugaci 39accef1ad Update KProj to the latest format 2014-11-12 15:24:16 -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
Pranav K 878be8922f Merge branch 'release' into dev 2014-11-06 10:48:41 -08:00
Pranav K 2efbc75f8e Updating to release NuGet.config 2014-11-06 10:48:39 -08:00
Kirthi Krishnamraju a858373409 Merge branch 'release' into dev 2014-10-29 13:26:50 -07:00
Kirthi Krishnamraju 85d0ddc45a Added description in project.json for all projects 2014-10-29 11:38:09 -07: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
N. Taylor Mullen 30221f7ce0 Add @removetaghelper directive.
- Added parsing recognition of the @removetaghelper directive.
- Added TagHelperDescriptor handling: @removetaghelper will cause the system to ignore TagHelpers that are added via @addtaghelper.
- Added Chunk generation, this involved building a CodeGenerator (soon to be named ChunkGenerator) that pulled out the stringified @removetaghelper lookup text which it then uses to construct a RemoveTagHelperChunk.
- Modified CodeVisitors to now understand RemoveTagHelperChunk's.
- Added code generation, this involved creating a dummy string in order to give the @removetaghelper "..." coloring.

#112
2014-10-29 10:24:57 -07:00
N. Taylor Mullen 0dba621965 Make TagHelperOutput.Attributes case insensitive.
- Changed the Attributes dictionary to utilize a StringComparer.OrdinalIgnoreCase comparer.
- Changed TagHelperExecutionContext to ignore attribute casing.
- Updated the AllAttributes and HtmlAttributes dictionaries to ignore attribute casing.
- Added tests to validate their new behavior.

#186
2014-10-23 22:22:11 -07:00
Pranav K 21d64b4ae2 MQ: Cleanup to use var 2014-10-22 15:35:43 -07:00
Pranav K d12bb79714 Updating build.sh to work on Mono 2014-10-21 12:46:59 -07:00
Pranav K 473f642dde Modifying tests to run in both in aspnet50 and aspnetcore50
* Additionally trimming references from project.json
2014-10-19 21:18:43 -07:00
Pranav K 99fe8294e9 Modifications to support providing tag descriptors from derived hosts 2014-10-16 07:11:46 -07:00
N. Taylor Mullen f8020e8e85 Make @addtaghelper directive not be nested.
- Whenever we encounter an @addtaghelper directive we add it to the CodeTree at the top level (not nested in any chunk blocks).
- Added a test to validate that @addtaghelper inside of a ChunkBlock doesn't add to the ChunkBlock's children.

#195.
2014-10-15 12:10:27 -07:00