Commit Graph

1002 Commits

Author SHA1 Message Date
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 c25aadf599 Enable page directive to handle malformed text.
- Made a targeted fix to PageDirective that stops it from crashing Visual Studio when its malformed.
- Added unit test to validate PageDirective didn't throw when attempting to determine if something was a page.
- Added an integration test to validate malformed page tags can make their way through the entire Razor pipeline and don't destroy the rest of the content.

#1247
2017-04-20 14:05:54 -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
Andrew Stanton-Nurse e856224682 react to removal of PlatformAbstractions (#1243) 2017-04-20 09:30:59 -07:00
Kiran Challa 4319593e7f Updated dependency model version to 2.0.0-* 2017-04-18 15:42:27 -07:00
N. Taylor Mullen a4a194e273 Make ViewComponentTagHelper discovery resilient to null. 2017-04-18 14:33:44 -07:00
N. Taylor Mullen 385e2523a9 Re-enable ViewComponentTagHelpers for tooling.
#1231
2017-04-14 17:11:26 -07:00
N. Taylor Mullen 1d10293db5 Revert "Uncap version max for vsix manifest."
This reverts commit ee1fd61e64.
2017-04-14 16:19:03 -07:00
N. Taylor Mullen ee1fd61e64 Uncap version max for vsix manifest. 2017-04-14 14:12:47 -07:00
N. Taylor Mullen 6f7cb763a2 Update TModel code generation.
- Prior to this TModel would be set to a potentially non-fully qualified name. This would cause errors in default MVC templates.
- Regenerated test files to reflect new TModel.
- Updated unit test to reflect new behavior.

#1222
2017-04-14 12:32:20 -07:00
N. Taylor Mullen d273c6cd4c Ensure output hint descriptors don't schema check.
- Prior to this if you had a `TagHelper` whos output hint was not in the final form of the completions we'd fall through into a schema check which resulted in a completion being added when it shouldn't. Example: `TagHelper` for `my-tr` that has an output hint of `tr` would end up getting added to the completion list under `body` because `my-tr` was not in the schema and would then be treated like the `environment` `TagHelper` (a new element).
- Added a test to validate that `TagHelper`s with output hints are cross referenced vs. existing completions and do not fall through to a schema check.

#1225
2017-04-14 12:14:52 -07:00
Ajay Bhargav Baaskaran 0b17f14d68 Moved AddTagHelperHtmlAttribute from renderer to writer 2017-04-14 11:49:56 -07:00
N. Taylor Mullen cf44f103c1 Prefix TagHelpers with tag helper prefix in completion list.
- We don't want tooling applying tag helper prefix to what we deem `TagHelper`s. Ultimately we should consume all the necessary data and do that work.
- Added two tests to validate that we're applying tag helper prefix to `TagHelper` element completions for catch-all's and non-catch-alls.

#1224
2017-04-14 11:40:28 -07:00
Pranav K b8aa060f32 Target 1.0.4 RuntimeFrameworkVersion in the tool 2017-04-14 10:00:02 -07:00
N. Taylor Mullen 46a5ca972f Allow catch-all THDs to apply to all completions.
- Prior to this catch-alls were explicitly ignored not to populate the IntelliSense with an excess amount of `TagHelper`s. To maintain backwards compatible expectations this commit reverts that expectation.
- Scoped an existing test to only test its primary scenario.
- Added a new test to verify that catch-alls accurately apply to all completions (including dynamically added ones).

#1219
2017-04-13 23:35:59 -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
Ryan Nowak c0e3519bc3 Set an order on @inject to run behind @namespace
The problem is that @inject uses the type name, and @namespace can change
it. Setting an explicit order makes sure that these things happen in a
sensible sequence.
2017-04-13 13:59:47 -07:00
N. Taylor Mullen 3b31e977b2 Fix ability to generate baselines.
- Prior to this removing the `__RemoveThisBitTo__` wasn't sufficient to generate baselines; reason being the constants were defined in the wrong assembly. Since we moved test infrastructure bits around the constants needed to follow.
2017-04-13 11:07:02 -07:00
N. Taylor Mullen 688731983c Add dependencies.props to Solution Items. 2017-04-13 11:05:19 -07:00
N. Taylor Mullen a1cfd22a32 Add element completion API for TagHelpers.
- Added a new `TagHelperCompletionService` which can be queried for information on what completion information should be provided.
- Added tests to validate the completion service's expectations.
- Fixed an issue where `TagHelper`s with output hints that did not exist in a passed in completion would never be highlighted as `TagHelper`'s; even when their primary targeting element was already in the element completion list.

#1181
2017-04-12 14:31:11 -07:00
N. Taylor Mullen 1b8a4e704c Rename ITagHelperDescriptorBuilder => TagHelperDescriptorBuilder.
#1210
2017-04-11 17:08:38 -07:00
Ryan Nowak e5cac9fb7f Implement @namespace
This change adds support for @namespace, and introduces a set of
changes that are needed to support @namespace in the parser.

@namespace and @class have always been treated as reserved words by Razor,
with the intent that someday they would be allowed as directives.

This changes makes that possible.

You will still get an error about @namespace being a reserved word if you
don't have the directive.
2017-04-11 12:46:02 -07:00
Ryan Nowak b4b4a19549 Fix #1194 - DirectiveIRNode doesn't have source
Now with line mappings!
2017-04-11 10:45:24 -07:00
Ryan Nowak 64e5aaf478 Remove some dead code 2017-04-11 10:24:34 -07:00
Pranav K e2267f54a6 Add support for naming a page (#1204) 2017-04-11 10:10:45 -07:00
Pavel Krymets 69b019ebd8 Third party rule name changed 2017-04-11 10:04:29 -07:00
Ryan Nowak 1fbdb30186 Normalize newlines in default imports
Needed for xplat
2017-04-11 08:19:56 -07:00
Ryan Nowak 35bbede0ac Remove unused files 2017-04-10 19:47:41 -07:00
Ryan Nowak 303636db13 Updates to generated .cs files
A separate commit so that it's reviewable. Only things derived from the
file path have changed.
2017-04-10 19:43:03 -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
Ryan Nowak 1262a6d4b2 Adding CodeGeneration benchmark 2017-04-10 14:25:43 -07:00
Ryan Nowak acf3e759d1 Add BenchmarkDotNet boilerplate 2017-04-10 14:25:43 -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
Ajay Bhargav Baaskaran fe60c2426c Moved HtmlContentIRNode from renderer to writer 2017-04-07 12:55:24 -07:00
N. Taylor Mullen ea3b7b0a76 Add vscode artifacts to .gitignore. 2017-04-07 11:50:43 -07:00
N. Taylor Mullen 96d97f65e9 Allow null parent tag when calling `GetTagHelpersGivenParent`.
- A `null` parent tag in all of our other API represents "any" parent tag, or in this case "root". Prior to this change we'd expect the caller to do their own verification of the parent and then assume all `TagHelperDescriptor`s are valid; this isn't sufficient because only our code base should have that knowledge.

#1188
2017-04-06 17:02:06 -07:00
N. Taylor Mullen af3cf497a6 Update TagHelperMatchingConventions to disallow opt-out prefix.
- Prior to this change the `TagHelper` parsing would strip the opt-out character (`!`) from tag names that got passed to the TagHelper matching services. At design time this proved to be a problem because they have their own understanding of the HTML document and only pass us full tag names (names that include `!`). This changes the matching conventions to immediately return false if a tag name is seen to contain the `TagHelper` opt-out.
- Added two `DefaultTagHelperFactService` tests to verify that tag names with opt-out prefixes are denied `TagHelperDescriptor`s.

#1186
2017-04-06 16:10:35 -07:00
Ajay Bhargav Baaskaran 0228fd2770 Moved ExecuteTagHelpersIRNode from renderer to writer 2017-04-06 11:43:35 -07:00
Ryan Nowak 0481cc6569 Fix travis
We were missing the newline normalization from the test base class.
2017-04-06 11:26:52 -07:00
Ryan Nowak 0cb7ae7fbf Add support for namespace tokens in extensible directives
This change adds support for accepting a namespace name in extensible
directives. This will be needed for the @namespace directive.

Implemented new parsing and codegen for namespaces using nameof().

Also fixed any issue where we were not global::-qualifying object where it
was used in the design time code for tokens.
2017-04-05 15:37:50 -07:00
Ajay Bhargav Baaskaran 6fea6454f0 Moved CreateTagHelperIRNode from renderer to writer 2017-04-04 16:33:28 -07:00
Ajay Bhargav Baaskaran 1a05359d12 Reset writer scope for tag helpers inside template 2017-04-04 15:43:42 -07:00
Pranav K fa378842af Use NuGetPackageRoot instead of NuGetPackageFolders 2017-04-04 15:32:46 -07:00
N. Taylor Mullen dda9cf3259 Do not generate C# line pragmas without a file path.
- Prior to this change default imports would get line pragmas generated for them because thye'd have a source location but no file path (they were a dynamic document).
- Re-generated C# files to reflect new line pragma changes.

#1110
2017-04-04 15:32:25 -07:00
Yves57 c7e2e1880e Make FileSystemRazorProject internal (#1152)
Fixes #1117
2017-04-04 14:09:53 -07:00
N. Taylor Mullen 68554f8106 Updated the ir lowering phase to lazily add namespaces.
- The lazy addition of namespaces gives the main document lowering phase an opportunity to add source location information which we then add after the main lowering.
- Re-generated csharp to capture addition of using statements that were previously overridden by defaults/imports.

#1174
2017-04-04 12:09:34 -07:00