Commit Graph

58 Commits

Author SHA1 Message Date
Nate McMaster 4d737af167 Pin tool and package versions to make builds more repeatable
Part of aspnet/Universe#575
2017-11-01 18:12:08 -07:00
Ajay Bhargav Baaskaran f4e9ddad22 Link syntax tree Span nodes 2017-10-10 13:07:27 -07:00
N. Taylor Mullen 6c8286eed7 Split LanguageServices.Razor.
- Created a new `Microsoft.VisualStudio.Editor.Razor` assembly to contain Visual Studio platform agnostic info.
- Added a new `Microsoft.VisualStudio.Editor.Razor.Test.Common` project to be the centerfold for all VisualStudio agnostic test pieces.
- Added a `Microsoft.VisualStudio.Editor.Razor.Test` project and pulled in LanguageService test files into the the Editor.Razor.Test project to correspond to their movement in the src project.

#1690
2017-09-29 16:26:50 -07:00
Nate McMaster 471722eba1 Use PackageLineup to manage PackageReference versions
This uses a feature of KoreBuild which will select PackageReference
versions based on a lineup file. This helps unify versions between repos
and helps us ensure we are consistent across multiple components.
2017-08-25 15:44:05 -07:00
Ajay Bhargav Baaskaran fa6fde2b20 Moved TagHelper directive validation and parsing from TagHelperBinder to
CSharpCodeParser
2017-08-23 17:14:41 -07:00
Nate McMaster 0c3fff3137 Upgrade to xunit 2.3.0-beta4 (#1640)
Includes a few changes required by xunit.analyzers, such as removing unused theory parameters.
2017-08-23 12:56:31 -07:00
Nate McMaster 4cadee2762 Use Directory.Build.props/targets (#1641) 2017-08-23 12:24:57 -07:00
N. Taylor Mullen 2a69b50a64 Change Razor.Test.Common to not act like an executable.
- There's no need for this test library to have a conditional TFM because it's never run under the desktop TFM when crossplat.
2017-07-13 14:58:27 -07:00
N. Taylor Mullen f8d43853f8 Re-introduce RazorEditorParser.
- Revived `RazorEditorParser`.
- Made `PartialParseResult` internal and renamed it to `PartialParseResultInternal`. This fell in line with other syntax tree types.
- Moved the `RazorEditorParser` implementation away from `TextChange` and `ITextBuffer`. Instead it now relies on `SourceChange` and the VS contract `ITextSnapshot`.
- Added `RazorEditorParserTest` to ensure the changes in implementation did not impact previous functionality.
- Removed some obvious tests that unnecessarily re-tested behavior that was already verified.
- Updated tests.
- Moved several Language.Test types to the common test project so they could be reused.

#1259
2017-07-12 17:01:16 -07:00
Ryan Nowak 9c0a8a5c96 Rename properties on taghelper nodes 2017-07-07 11:32:05 -07:00
Ajay Bhargav Baaskaran d6e892b30c Adjusted verbosity of some property names and made
TagHelperIntermediateNode.TagHelpers and IList
2017-07-06 18:05:36 -07:00
Ajay Bhargav Baaskaran 11c5293862 Unnest IntermediateToken.TokenKind 2017-07-06 11:15:36 -07:00
N. Taylor Mullen afa61e7080 Rename LineMapping => SourceMapping.
- Also removed the == and `!=` operators for `SourceMapping`.

#1510
2017-07-06 10:34:19 -07:00
Ryan Nowak 8a9bf9c71a Rewrite of code rendering context 2017-07-03 16:29:34 -07:00
N. Taylor Mullen 4654997201 Add AllowedChildTagDescriptor.
- Changed the `AllowedChildTags` collection on `TagHelperDescriptor` to have a custom object type to represent child tags.
- Created comparers and builders to work with the child tag descriptor.
- Removed the validation methods on `TagHelperDescriptorBuilder` since there's no longer any bits to validate (they're contained within the sub-properties).
- Unit tested the `DisplayName`.

#1493
2017-07-03 11:04:10 -07:00
Ryan Nowak 7aeb228063 Redesign tag helper codegen 2017-06-30 17:34:01 -07:00
N. Taylor Mullen 2a6f0e4dc9 Productionize the csharp rendering context APIs.
- Rename `CSharpRenderingContext` => `CodeRenderingContext`.
- Rename `CSharpCodeWriter` => `CodeWriter`
- Rename `BasicWriter` => `IntermediateNodeWriter`
- Rename `...BasicWriter` => `...NodeWriter`
- Made `CodeRenderingContext` a public abstract API. Left temporary TagHelper pieces in the class since these will be removed soon.
- Moved several `CodeRenderingContext` methods into extension methods. These make use of the Items collection.
- Moved the reporting of missing code target extensions into the `ExtensionIntermediateNode`. This is the integration point of `CodeTarget`s and `CodeRenderingContext`s; therefore, it made more sense existing there.
- Left SetRenderChildren/SetRenderNode as extension methods due to how they're wired up. Aka, to create a `CodeTarget` you need a `CodeRenderingContext`... To Create a `DocumentWriter` you need a `CodeTarget`... To set the render methods on the context you need a `DocumentWriter`.
- Updated tests to utilize the new code renering constructs.
- Moved code generation testability features from `CSharpLoweringPhase` to the `CodeRenderingContext.Items`.

#1043
2017-06-30 16:35:53 -07:00
Ajay Bhargav Baaskaran 9c031e6fb5 Moved all TagHelperDescriptor related builders to have getter setter
instead of methods

More polish to the tag helper descriptor builders.
- Expose underlying builders as getter only list
- Added AsDictionary() extension method to BoundAttributeDescriptorBuilder
- Expose diagnostics as RazorDiagnosticCollection
- Got rid of Require** prefix in TagMatchingRuleBuilder
- Workaround issue aspnet/Razor#1492 by copying the test descriptor
  extensions
2017-06-30 14:08:05 -07:00
Ajay Bhargav Baaskaran 7c7bb627b9 Moved typename and propertyname to extension methods 2017-06-29 16:47:53 -07:00
N. Taylor Mullen dd10b0b086 Update test node writer to write malformed directives.
- Updated baselines.

#1456
2017-06-28 16:34:56 -07:00
Ryan Nowak e3b3e20738 Move some stuff to .Extensions
Moved design time directives and tag helper attribute preallocation to
.Extensions.

Just mechanical namespace changes here.
2017-06-21 20:26:31 -07:00
Ryan Nowak 7a234ca513 Rename UsingStatement>UsingDirective 2017-06-21 19:54:40 -07:00
Ryan Nowak a580c8fdf1 Get rid of AccessModifiers 2017-06-21 19:10:57 -07:00
Ryan Nowak a40ca857c5 Rename HtmlAttributeValueStyle>AttributeStructure 2017-06-21 18:56:37 -07:00
Ryan Nowak 21e26ad4aa Rename RazorIRNode
Get rid of references to 'IR'
2017-06-21 12:55:16 -07:00
Ryan Nowak 8649e1a4be Add Tag Helper descriptors to the Tag Helper node 2017-06-20 23:19:49 -07:00
Ryan Nowak 062d7561ae Make section an extension node 2017-06-20 19:20:46 -07:00
Ajay Bhargav Baaskaran 3892a6fede Removed ChecksumIRNode 2017-06-16 11:14:54 -07:00
N. Taylor Mullen e3287ae672 Add diagnostics to the IR.
- Added a `Diagnostics` and `HasDiagnostics` properties to `RazorIRNode`. The `HasDiagnostics` property was necessary in order to traverse nodes without forcibly instantiating their diagnostic lists.
- Added `GetAllDiagnostics` extension method for `RazorIRNode` to provide a way to retrieve all diagnostics that exist on and under a `RazorIRNode`.
- Updated `RazorIRNodeWriter` to display any diagnostics that exist on IR nodes.
- Internal `RazorIRNode`s do not have mutable `Diagnostics` because we don't currently add diagnostics to these elements.
- Added `DefaultIRLoweringPhaseTest` to validate that errors flow from syntax tree to IR document. Also added a missing test.
- Updated the `CSharpLoweringPhaseTest`s to properly validate that errors flow from IR document => csharp document. This resulted in movement of code to the ir lowering phase tests.

#1412
2017-06-13 10:28:41 -07:00
Ryan Nowak 6860806213 Make usage of FileName and FilePath consistent
FileName => "Foo.cshtml"
FilePath => "/Bar/Baz/Foo.cshtml"
2017-06-12 16:15:26 -07:00
Ryan Nowak 503ba669d0 Get rid of Parent from IR node 2017-06-08 19:22:14 -07:00
Ryan Nowak e05c697c58 Fix #1356 verify diagnostics in integration tests 2017-06-08 17:03:43 -07:00
Nate McMaster 4d18334573 Target .NET Standard 2.0 2017-06-08 16:37:27 -07:00
Ajay Bhargav Baaskaran a6d2c04195 [Fixes #1379] Rename CSharpStatement to CSharpCode 2017-06-07 15:20:47 -07:00
Ryan Nowak 45dec0dca4 Fix #1407 null refs in VCTH tests
Dictionary isn't thread safe YO.
2017-06-07 12:37:04 -07:00
Ajay Bhargav Baaskaran 74fef5f722 Moved VCTH types to Razor.Extensions 2017-06-06 15:49:35 -07:00
Ajay Bhargav Baaskaran 2f03a39e41 Refactored attribute values IR 2017-05-26 12:34:34 -07:00
N. Taylor Mullen dcccea3004 Add Checksum computation to RazorSourceDocument.
- Renamed many of our `RazorSourceDocument` abstractions to not include the word `Razor`.
- Added a `GetChecksum()` method to `RazorSourceDocument` to allow source documents to compute their own checksums.
- Re-generated codegen tests that did not normalize new lines. Ones that did re-generate newlines converted from stream => string => normalized string and then ran the Razor parser.
- Added tests to validate `GetChecksum` for all source document types.
- Removed unused `LegacySourceDocument`.
2017-05-26 12:29:36 -07:00
Ajay Bhargav Baaskaran 1efcdafa45 Removed ExecuteTagHelpersIRNode 2017-05-22 11:03:34 -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
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
Ryan Nowak 2167e4151e Fix #1311 add a base class for features 2017-05-12 21:15:59 -07:00
Ryan Nowak 2ec2b98f83 Fix #1312 - make ExecuteCore protected 2017-05-12 17:54:09 -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 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
BrennanConroy a562480cd0 Update test project to netcoreapp2.0 (#1292) 2017-05-09 14:22:35 -07:00