Commit Graph

56 Commits

Author SHA1 Message Date
N. Taylor Mullen ebe8ab4612 Rename TagHelperBoundAttributeDescriptorBuilder => BoundAttributeDescriptorBuilder.
#1369
2017-05-19 12:44:07 -07:00
N. Taylor Mullen 9bc9f0ef05 Rename HtmlCase => HtmlConventions.
- Moved the invalid non-whitespace html character entries from the various builders into the new HtmlConventions class.
- Updated test file name.
2017-05-19 12:36:55 -07:00
N. Taylor Mullen 2eb443acb6 Merge branch 'rel/15.3' into dev
# Conflicts:
#	src/Microsoft.AspNetCore.Razor.Language/Legacy/CSharpCodeParser.cs
#	src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorBuilder.cs
#	src/Microsoft.CodeAnalysis.Razor/ViewComponentTagHelperDescriptorFactory.cs
#	test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/CSharpDirectivesTest.cs
#	test/Microsoft.CodeAnalysis.Razor.Test/ViewComponentTagHelperDescriptorFactoryTest.cs
2017-05-19 11:23:00 -07:00
N. Taylor Mullen 5aababce6e Remove magic string keys from TH builders.
- Replaced the magic strings with extension methods that produce the same behavior as the string keys did.
- Added tests to validate new extension methods.

#1307
2017-05-19 11:15:38 -07:00
N. Taylor Mullen 4c98b7f8f3 Make ViewComponentTagHelper's display name nicer.
- Went from `__Generated__SomeViewComponentTagHelper` to `SomeViewComponentTagHelper`.
- Updated `TagHelperDescriptorBuilder` to allow setting of `DisplayName`.
- Added `TagHelperDescriptorBuilderTest` class to verify new `DisplayName` additions.
- Updated `ViewComponentTagHelperDescriptorFactoryTest` expectations.

#1251
2017-05-18 14:48:59 -07:00
N. Taylor Mullen 03f3975360 Allow directive string tokens to be colorized.
- Without a directive string token having a `SpanKind.Code` it cannot have any sort of C# coloring associated with it.
- Updated tests to reflect new `SpanKind` expectations.

#1269
2017-05-18 10:36:54 -07:00
Ryan Nowak e391ac7a3c Split options into ParserOptions and CodeGenerationOptions 2017-05-18 10:22:39 -07:00
Ryan Nowak 5a1090f324 Api Cleanup for language services
Created internal + public versions of
- BlockKind
- SpanKind
- AcceptedCharacters

That way these types are only exposed through the VS apis and not
through the runtime API surface.

Also deleted RazorEditorParser. Yep. It's going to take significant work
to just port it to the language services assembly. Let's reevaluate this
when we get closer to the next foundational update.
2017-05-17 22:09:01 -07:00
Ryan Nowak 94aaa3db9e Configure xunit for better display 2017-05-17 20:31:37 -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 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
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
Ryan Nowak ad294fb4ba Add a new THProvider api
This change adds an API for Tag Helper discovery.

I also got rid of the 'design time' flag for the provider as an
experimental change. We need to think through the consequences of this
before committing to it. Right now I've left those tests failing until we
can make a decision.

This change decouples VCTH discovery a bit more, but we're still not ready
to move that into a the MVC extensions assembly. For that we need the
ability to discover the MVC extensibility.
2017-05-16 14:59:37 -07:00
N. Taylor Mullen 9fe7c77d30 Move TagHelperBinding out of Legacy.
- Added additional properties to the class to make it more production ready.

#1092
2017-05-16 11:06:07 -07:00
Ryan Nowak 2167e4151e Fix #1311 add a base class for features 2017-05-12 21:15:59 -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
Ryan Nowak a8dd0355d0 Remove default usings
This change removes the default usings for 'System' and
'System.Threading.Tasks' and adds them to the MVC template engine.

This is preparation for removing this feature from the razor options, I
wanted to get all of the intentional diff out of the way.
2017-05-12 17:08:58 -07:00
Ajay Bhargav Baaskaran 8cf7d248e7 [Issue #1318] Renamed RuntimeTarget to CodeTarget 2017-05-12 16:32:55 -07:00
Ryan Nowak 86d045c667 Fix #1305 move instrumentation to MVC 2017-05-12 16:14:17 -07:00
Nate McMaster 682d630fa2 Upgrade test framework versions and fix issues with tests 2017-05-12 15:41:49 -07:00
Ryan Nowak b9dabd24be Fix #1309 make CSharpDocument abstract 2017-05-12 14:23:30 -07:00
Ryan Nowak b17e506ce8 Some API cleanup around directivest 2017-05-12 13:27:28 -07:00
Ryan Nowak ab98c5d837 Fix #1322 #1328 #1310 #1325
This are mechanical API Cleanup issues.
2017-05-12 13:11:16 -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 4bc1a76e22 Moved TagHelperBinder from pass to a phase 2017-05-10 17:16:27 -07:00
Ryan Nowak eb3c47b6ca Add annotations
Fixes #990. This should make a lot of IR manipulations very simple.
2017-05-10 16:38:11 -07:00
N. Taylor Mullen 774aebaa01 Rename TagHelperDescriptorProvider => TagHelperBinder.
- Moved the type out of the Legacy namespace.
- Renamed the types method to `GetBinding` since `TagHelper` is now inferred.
- Updated test names to reflect new method/class name.
- Updated product code variables to reflect new naming (provider => binder).

#1289
2017-05-08 16:59:53 -07:00
Ryan Nowak a570139b08 Fix #1059 and #1060 2017-05-08 12:30:19 -07:00
Ryan Nowak 1705888721 Add a test for #153 - already fixed 2017-05-05 12:48:01 -07:00
Ajay Bhargav Baaskaran c71f6e7c3f [Fixes #1058] Added a test to verify nested enum behavior 2017-05-05 11:50:31 -07:00
Ryan Nowak e15d1be616 Introduce SourceChange in place of TextChange
This is the first step on the journey to replacing RazorEditorParser. We
can't just get rid of this because VS is using it today.
2017-05-03 17:53:08 -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
Ryan Brandenburg 8af9f656dd Add CodeGen tests for @inherits 2017-05-01 10:42:00 -07:00
N. Taylor Mullen f0d0c3d0b8 Merge branch 'preview-1/stabilization' into dev
# Conflicts:
#	build/dependencies.props
2017-04-28 17:20:20 -07:00
N. Taylor Mullen 207e0f0b59 Change `GetImports` to allow querying of information on non-existent files.
- Added tests to validate imports can still be found on non-existent files.

#1267
2017-04-28 17:00:24 -07:00
N. Taylor Mullen 49e3533bc3 Add test to validate unbalanced triple dash comment inside razor block.
#302
2017-04-27 12:03:59 -07:00
N. Taylor Mullen 344862fbc3 Change string token parsing to not flow errored tokens.
- Found that our extensible directive string parsing system wasn't consistent with the rest of the extensible directive tokens. Basically, if there were malformed string tokens we'd consume them and pass them along to extensible directive passes. This was a big no-no because it means extensible directive passes weren't able to rely on tokens being passed to them being well-formed.
- Fixed up existing extensible directive tests that relied on output of string tokens.

#1247
2017-04-26 16:38:58 -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
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 715aa9bcae Fix cross plat tests for TagHelperBinderSyntaxTreePassTest. 2017-04-20 13:33:00 -07:00
N. Taylor Mullen f31b45d84a Enable TagHelper directives to handle malformed text.
- Prior to this change we'd try to substring a TagHelper directive with length 1 but our substring call would be for -1 (explosions).
- Added tests to validate that `@tagHelperPrefix`, `@removeTagHelper` and `@addTagHelper` all behave properly when they have malformed quotes.

#1242
2017-04-20 11:43:38 -07:00
Ajay Bhargav Baaskaran 0b17f14d68 Moved AddTagHelperHtmlAttribute from renderer to writer 2017-04-14 11:49:56 -07:00
Ajay Bhargav Baaskaran cd486226d6 [Fixes #1195] Add a way to parse just until the first directive 2017-04-13 15:02:17 -07:00